[R] Using a function for rows over a subset of columns in data.table

2014-10-27 Thread Camilo Mora
Hi everyone, This may be a trivial solution but I have not been able to figure what is wrong with this code. The basic premise of the code is to use data.table to append a new column to a data.table that indicates if the values per row at two other columns are within a 2d hull generated with

[R] "survey" package -- doesn't appear to match svy

2014-10-27 Thread Stephen Amrock
Hi, I'm new to R and have encountered two issues in coding using the "survey" package: (1) Code from *svytable* using "survey" package does not correspond to Stata estimates from *svy: tab*. I call svyd.nation <- svydesign(ids = ~1, probs = ~wt_national, strata = ~stratum, data=nats.sub)

Re: [R] Order of boxs in box plots

2014-10-27 Thread David Winsemius
On Oct 27, 2014, at 6:10 PM, David Doyle wrote: > Hello, > > I'm doing some box plots to look at the distributions of groundwater > results. It is plotting the well in the order of their IDs. ie. MW1B then > MW3B then MW4A. > > I would like to plot the wells in the order they are at the si

[R] Order of boxs in box plots

2014-10-27 Thread David Doyle
Hello, I'm doing some box plots to look at the distributions of groundwater results. It is plotting the well in the order of their IDs. ie. MW1B then MW3B then MW4A. I would like to plot the wells in the order they are at the site such as MW1B then WES-14-4-93 then Is there a way

[R] Loop with ggplot2 not as simple as it seems...

2014-10-27 Thread Patricia Seo
Hi everyone, I have been battling with this problem for the past month and reading all that I can about it, but I just can't seem to understand what I'm doing wrong. It seems easy and I can replicate others well-recorded attempts, but can not seem to apply this to my data. I have created a dat

Re: [R] how to define a geometric distribution for "glm"

2014-10-27 Thread Amanda Li
Hi Peter, Thank you very much for your help! However, for my dataset, it may not asymptotically work. May I ask whether you know how to define a new family? Thank you very much again! Best, Amanda 2014-10-27 18:27 GMT-04:00 peter dalgaard : > The likelihood for the geometric distribution is th

Re: [R] how to define a geometric distribution for "glm"

2014-10-27 Thread peter dalgaard
The likelihood for the geometric distribution is the same as for the binomial distribution, except for the constant term, so estimates and LRT will be the same. The properties of the estimator will be different, e.g. the estimate of p is not unbiased, but asymptotically the likelihood procedures

Re: [R] "inahull? from package alphahull not working when used with lapply

2014-10-27 Thread Camilo Mora
Yes, that works. curiously, I tried that initially but it did not work because of the "" around x. Thank you very much for your help for future readers inhull can be used with apply using: library (alphahull) DT=data.frame(x=c(0.25,0.25,0.75,0.75),y=c(0.2

[R] how to define a geometric distribution for "glm"

2014-10-27 Thread Amanda Li
Hello, I was trying to apply "glm" to a dataset that assumes geometric distribution. I cannot use "glm.nb" in MASS package (negative.binomial (1)) because it tries to estimate this "1" while I am interested in "p", the probability of success. Does anyone know how I can define a geometric distribut

Re: [R] "inahull? from package alphahull not working when used with lapply

2014-10-27 Thread David L Carlson
Why not just > library (alphahull) > DT=data.frame(x=c(0.25,0.25,0.75,0.75),y=c(0.25,0.75,0.75,0.25)) > Hull <- ahull(DT, alpha = 0.5) > TEST<- data.frame(x=c(0.25,0.5),y=c(0.5,0.5)) > apply(TEST, 1, function(x) inahull(Hull, x)) [1] FALSE TRUE - David L Carls

Re: [R] "inahull? from package alphahull not working when used with lapply

2014-10-27 Thread Bart Kastermans
On 27/10/14 19:42, Camilo Mora wrote: > Hi Bart, > > Even after putting the variables in the apply function, the results come not > right: > > library (alphahull) > DT=data.frame(x=c(0.25,0.25,0.75,0.75),y=c(0.25,0.75,0.75,0.25)) > Hull <- ahull(DT, alpha = 0.5) > > TEST<- data.frame(x=c(0.25,0

[R] "inahull? from package alphahull not working when used with lapply

2014-10-27 Thread Camilo Mora
Hi Bart, Even after putting the variables in the apply function, the results come not right: library (alphahull) DT=data.frame(x=c(0.25,0.25,0.75,0.75),y=c(0.25,0.75,0.75,0.25)) Hull <- ahull(DT, alpha = 0.5) TEST<- data.frame(x=c(0.25,0.5),y=c(0.5,0.5)) plot(Hull) points(TEST) InHul2D <- func

Re: [R] plot hclust object

2014-10-27 Thread Greg Snow
I don't know of any tools that automate this process. For small sample sizes it may be easiest to just do this by hand, for large sample sizes that plot will probably be to complicated to make sense of. There may be a range of moderate sample sizes for which automation (or partial automation) wou

Re: [R] big datasets for R

2014-10-27 Thread David Winsemius
> On Oct 27, 2014, at 5:37 AM, Qiong Cai wrote: > > Hi, > > Could anyone please tell me where I can find very big datasets for R? I'd > like to do some benchmarking on R by stressing R a lot. http://archive.ics.uci.edu/ml/datasets.html?format=&task=&att=&area=&numAtt=&numIns=&type=&sort=instD

[R] big datasets for R

2014-10-27 Thread Qiong Cai
Hi, Could anyone please tell me where I can find very big datasets for R? I'd like to do some benchmarking on R by stressing R a lot. Thanks Qiong [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/

[R] plot hclust object

2014-10-27 Thread David Feitosa
Hello! I have a code that creates an hclust object. After the object creation I plot the object as a dendrogram, similar to the left image of this link: http://www.cs.jhu.edu/~razvanm/fs-expedition/hclust-example.png I would like to create another image, but similar to the right, as a set of nes

Re: [R] dotplot with library lattice

2014-10-27 Thread Matthias Weber
Hi Jim, looks perfect to me. Thank you very much. One last question. Is there any possibility to add 3 horizontal lines in the graph. One at 25%, the other one at 50% and the last one at 75%? So I can see the process a bit better? Thank you. Best regards. Mat -Ursprüngliche Nachricht

Re: [R] kruskal test p value way too low.

2014-10-27 Thread Prof Brian Ripley
On 26/10/2014 05:37, Rolf Turner wrote: On 26/10/14 16:40, David Doyle wrote: Hello, I'm trying to run kruskal test on some data but the p values seemed way too low. So I tried it on some similar data and still got p-value = 1.611e-09. I'm sure it is a simple mistake but I can't figure it out

Re: [R] rgdal: Convert ESRI ArcGis geo database (gdb directory) to geojson, or shapefile map

2014-10-27 Thread Guido Biele
Dear Thierry, thanks for your quick response! I did try to load a local copy. But that did not work. There is actually lots of information about the data base online ( http://kart.klif.no/arcgis/rest/services/Miljostatus/Stoysoner_veg/MapServer ) but none of this seems to be helpful to load the ma

Re: [R] dotplot with library lattice

2014-10-27 Thread Jim Lemon
On Mon, 27 Oct 2014 08:53:51 AM Matthias Weber wrote: > Hi Jim, > > looks perfect to me. Thank you very much. One last question. Is there any > possibility to add 3 horizontal lines in the graph. One at 25%, the other > one at 50% and the last one at 75%? So I can see the process a bit better? >

Re: [R] rgdal: Convert ESRI ArcGis geo database (gdb directory) to geojson, or shapefile map

2014-10-27 Thread ONKELINX, Thierry
Dear Guido, Do you know how the gdb is stored? I had problems reading for a gdb on our networkdrive. Reading from a local copy worked. It turned out that the original copy on the networkdrive was indexed. Reading an unindexed gdb from the networkdrive was no problem. Best regards, ir. Thierry

Re: [R] rgdal: Convert ESRI ArcGis geo database (gdb directory) to geojson, or shapefile map

2014-10-27 Thread Guido Biele
Thanks, Now I found the driver in the current rgdal version! Unfortunately I still can't open the database, even though the OpenfileGDB driver is used. When I list the layers and then try to load one of the layers, I get the error message that no features are found: ogrListLayers("Stoy.gdb") [1]