[R] Hodges-Lehmann EXACT confidence interval for small dataset with ties

2010-02-04 Thread Carrie Li
Dear r-helpers, I have a small dataset (n<50), and I want to compute the Hodges Lehmann exact confidence interval. So far, I know that "pairwiseCI" has the function "HL.diff". The description is as follows : HL.diff calculates the Hodges-Lehmann confidence interval for the difference of locations

Re: [R] How do I use "tapply" in this case ?

2010-02-04 Thread Bert Gunter
Folks: You can make use of matrix subscripting and avoid R level loops and applys altogether. This will end up being many times faster. Here's your original code: Z=matrix(rnorm(20), nrow=4) index=replicate(4, sample(1:5, 3)) P=4 tmpr=list() for (i in 1:P) { tmp = Z[i,index[,i]] tmpr[[i]]=t

[R] Rename R package name on R-Forge

2010-02-04 Thread wenjun zheng
Hi, R Users, Can maintainer rename the package on F-Forge? Any suggestions will be appreciated. Wenjun -- Wenjun [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] How do I use "tapply" in this case ?

2010-02-04 Thread Carrie Li
The problem is that the elements to be extracted from Z are not the same, sort of random actually. So, using lapply as suggested by Richard works fine here, and I believe that this will be faster than loop. But "not making an assignment to the intermediate 'tmp"" is a good point! Thank you! On

Re: [R] How do I use "tapply" in this case ?

2010-02-04 Thread David Winsemius
On Feb 4, 2010, at 11:53 PM, Carrie Li wrote: Thank you, David Here is an example : Z=matrix(rnorm(20), nrow=4) index=replicate(4, sample(1:5, 3)) P=4 tmpr=list() for (i in 1:P) { tmp = Z[i,index[,i]] tmpr[[i]]=tmp } So, I am trying to pull out the values in Z for each row, but now I

Re: [R] How do I use "tapply" in this case ?

2010-02-04 Thread RICHARD M. HEIBERGER
lapply(1:4, function(i, x, y) {x[i,y[,1]]}, Z, index ) ## reproduces your results sapply(1:4, function(i, x, y) {x[i,y[,1]]}, Z, index ) ## collapses your list into a set of columns __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] problems with SPC charts in R

2010-02-04 Thread vikrant
Thanks Bart and Peter for your help and the example is working for c chart as well withut any error. But when I am plotting the R chart i am still getting the following error. Error in limits.R(center = 62614.0571428571, std.dev = NA_real_, sizes = c(1000L, : group size must be less than 51 when

Re: [R] How do I use "tapply" in this case ?

2010-02-04 Thread Carrie Li
Thank you, David Here is an example : Z=matrix(rnorm(20), nrow=4) index=replicate(4, sample(1:5, 3)) P=4 tmpr=list() for (i in 1:P) { tmp = Z[i,index[,i]] tmpr[[i]]=tmp } So, I am trying to pull out the values in Z for each row, but now I only want to pull out the values indexed by the matr

Re: [R] xyplot 3 panels 3 different Y variables

2010-02-04 Thread RICHARD M. HEIBERGER
Continuing from your JUNK example: xyplot(Creatinine + Estrogen + Ratio ~ Day, data=JUNK, type="l", outer=TRUE, layout=c(1,3), scales=list(y=list(relation="free"))) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] xyplot 3 panels 3 different Y variables

2010-02-04 Thread Deepayan Sarkar
On Thu, Feb 4, 2010 at 2:30 PM, Jacob Wegelin wrote: > > Often, when exploring a dataset, I'd like to plot several very different Y > variables against the same X variable, in panels stacked one over the other. > Is there an easy way to do this? > > I'd like to achieve an elegant look similar to t

Re: [R] lattice barchart using a time scale in x axis

2010-02-04 Thread RICHARD M. HEIBERGER
> SCript with xyplot: > xyplot(Perc~as.POSIXct(hora,format="%d-%m-%Y > %H:%M"),digrate,groups=digrate$Drate,key=leg,xlab="time of the day", > > scales=list(alternating=F,tck=c(1,0),x=list(at=seq(r[1],r[2],by="hour"),labels=format(seq(r[1],r[2],"hours"),format="%H:%M"))), >            panel=function

Re: [R] population variance and sample variance

2010-02-04 Thread Kingsford Jones
On Thu, Feb 4, 2010 at 11:07 AM, Peng Yu wrote: > I'm so surprised that even this basic definition does not have unique > name in the nomenclature, which might cause confusion in certain > context. Just some of my thought---if both definitions are OK, then > the wiki page might be revised > http:

Re: [R] population variance and sample variance

2010-02-04 Thread Kingsford Jones
On Tue, Feb 2, 2010 at 10:25 AM, Peng Yu wrote: > On Mon, Oct 19, 2009 at 12:53 PM, Kingsford Jones > wrote: >>> sum((x-mean(x))^2)/(n) >> [1] 0.4894708 >>> ((n-1)/n) * var(x) >> [1] 0.4894708 > > But this is not a built-in function in R to do so, right? No because down that path lies bloat

Re: [R] unique function works funny

2010-02-04 Thread Rolf Turner
FAQ 7.31 cheers, Rolf Turner On 5/02/2010, at 4:23 PM, Guochen Song wrote: > I have 3 nested functions, the core function goes like this: > listx<-function(x,tox) > { > xt=table(x) > wa=sort(unique(x,fromLast=FALSE)) > print(xt) > print(wa) > .. > return(kk) > > }

Re: [R] How do I use "tapply" in this case ?

2010-02-04 Thread David Winsemius
On Feb 4, 2010, at 9:51 PM, Carrie Li wrote: Dear R-helpers , I have a simple loop as follows, however, to be more efficient, I would like to use any apply functions (tapply, I suppose) But how can I do this ? I am not very clear about this. # Z is a P * Q matrix # so for each row of Z, I

Re: [R] xyplot 3 panels 3 different Y variables

2010-02-04 Thread Dennis Murphy
Hi: Here's a ggplot2 solution for your consideration: Start by melting the data using package reshape; this stacks the response variables and uses their names as factor levels in a conditioning plot: library(ggplot2) # loads plyr and reshape in the process junk <- melt(JUNK, id = "Day") dim

[R] unique function works funny

2010-02-04 Thread Guochen Song
I have 3 nested functions, the core function goes like this: listx<-function(x,tox) { xt=table(x) wa=sort(unique(x,fromLast=FALSE)) print(xt) print(wa) .. return(kk) } listx get called in functionB, and functionB get called in functionC. When I test functionB, the listx function works jus

Re: [R] Reading sas7bdat files directly

2010-02-04 Thread Frank E Harrell Jr
David Winsemius wrote: On Feb 4, 2010, at 5:31 PM, Alex Bryant wrote: Hi, I have a need to process (in real-time) a large number of .sas7bdat files from within R. The problem is I don't want to convert these files to .xpt (transport) every time. So just checking if anyone has a (viable)

[R] How do I use "tapply" in this case ?

2010-02-04 Thread Carrie Li
Dear R-helpers , I have a simple loop as follows, however, to be more efficient, I would like to use any apply functions (tapply, I suppose) But how can I do this ? I am not very clear about this. # Z is a P * Q matrix # so for each row of Z, I would like to pull out only some of the elements, an

[R] Testing Significance of Correlation Matrix using Brien's Test

2010-02-04 Thread Wiltse
Hello All, I'm looking for an R package that will run the "Brien's Test" (see Brien et al., 1984, Biometrika) on a correlation matrix. Or if anyone can help with the equations used to calculated the chi-squared statistic for the grand mean, main effects, interactions, and equal correlation that

[R] Using coxph with Gompertz-distributed survival data.

2010-02-04 Thread Alex F. Bokov
Dear list: I am attempting to use what I thought would be a pretty straightforward practical application of Cox regression. I figure users of the survival package must have come across this problem before, so I would like to ask you how you dealt with it. I have set up an illustrative example a

Re: [R] replace a for loop with lapply or relative

2010-02-04 Thread jim holtman
Have you considered using a different data structure: > # change the data structure > x <- data.frame( + type=rep(c('x1', 'x2', 'x3'), each=100), + high=c(d[,4], d[,5], d[,6]), + value=c(d[,1], d[,2], d[,3])) > head(x) type high value 1 x10 0.8936737 2 x10 -1.047298

Re: [R] open script file from command line

2010-02-04 Thread David Winsemius
On Feb 4, 2010, at 7:53 PM, Wade Wall wrote: Hi all, Is there a function to open a script file from the command line? I have several students who are Mac users and when they open up a script file it does not send commands to the console, and unfortunately I don't know how to solve this

Re: [R] open script file from command line

2010-02-04 Thread Wade Wall
Does somebody need a lollipop? By the way, I entered this whole sentence using my mouse without once touching the keyboard. Seriously, I appreciate you taking the time to answer my question. Have a great day, Wade On Thu, Feb 4, 2010 at 8:06 PM, Rolf Turner wrote: > > On 5/02/2010, at 1:53 P

Re: [R] Reading large files

2010-02-04 Thread satishv
Folks: Suppose I divide USA into 16 regions. My end goal is to run data mining / analysis on each of these 16 regions. The data for each of these regions (sales, forecast, etc.) will be in the range of 10-20 GB. At one time, I will need to load say 15 GB into R and then do analysis. Is this somet

Re: [R] Hierarchical data sets: which software to use?

2010-02-04 Thread Juliet Hannah
Check out the book Linear Mixed Models: A Practical Guide Using Statistical Software by Brady West. It sets up analyses, similar to ones you described, in SPSS, R, and others as well. In general, I think it is good to know a couple of different packages, especially if you plan on doing a lot of

[R] Reading large files

2010-02-04 Thread Vadlamani, Satish {FLNA}
Folks: I am trying to read in a large file. Definition of large is: Number of lines: 333, 250 Size: 850 MB The maching is a dual core intel, with 4 GB RAM and nothing else running on it. I read the previous threads on read.fwf and did not see any conclusive statements on how to read fast. Exampl

Re: [R] open script file from command line

2010-02-04 Thread Rolf Turner
On 5/02/2010, at 1:53 PM, Wade Wall wrote: > Hi all, > > Is there a function to open a script file from the command line? I have > several students who are Mac users and when they open up a script file it > does not send commands to the console, and unfortunately I don't know how to > solve thi

[R] open script file from command line

2010-02-04 Thread Wade Wall
Hi all, Is there a function to open a script file from the command line? I have several students who are Mac users and when they open up a script file it does not send commands to the console, and unfortunately I don't know how to solve this problem since I am not a Mac user. I have looked over

[R] splint / lint-like syntax checker for R

2010-02-04 Thread Mark Huberty
Greetings - Does CRAN or someone similar make a splint / lint-like syntax checker for R? I realize that both ESS and the debug package and similar tools have debugging and error analysis features, but those appear to require running the code through the R buffer. I'd like something that did ba

[R] lattice barchart using a time scale in x axis

2010-02-04 Thread Fran Velasco
I'm trying to produce a barchart plot with groups, in which each group is placed in a particular time scale in x-axis. If I use barchart directly it does not take the time scale. I've tried with xyplot and adding a panel.barchart, I have the bars in the right place, but not the three groups I'm

Re: [R] Reading sas7bdat files directly

2010-02-04 Thread David Winsemius
On Feb 4, 2010, at 5:31 PM, Alex Bryant wrote: Hi, I have a need to process (in real-time) a large number of .sas7bdat files from within R. The problem is I don't want to convert these files to .xpt (transport) every time. So just checking if anyone has a (viable) way to read .sas7bdat

Re: [R] Reading sas7bdat files directly

2010-02-04 Thread Duncan Murdoch
Alex Bryant wrote: Hi, I have a need to process (in real-time) a large number of .sas7bdat files from within R. The problem is I don't want to convert these files to .xpt (transport) every time. So just checking if anyone has a (viable) way to read .sas7bdat files directly into R? SAS no

Re: [R] Minimizing two non-linear functions with genoud - Trying to minimize or converge near zero

2010-02-04 Thread Ravi Varadhan
This works! f=function(x) { # x = c(0.16,80) Vcmax = x[2] gi = x[1] # First dataset f.1=(-(((Vcmax-0.89189)/gi)+164.6573+272.38*(1+21*10/165.82))+sqrtVcmax-0.89189)/gi)+164.6573+272.38*(1+21*10/165.82))^2-4*(-1/gi)*(0.89189*(164.6573+272.38*(1+21*10/165.82))-Vcmax*(164.6573-(5*21/

Re: [R] Reading sas7bdat files directly

2010-02-04 Thread Jorge Ivan Velez
Hi Alex, Perhaps the read.ssd function in the foreign package might do what you want. See [1] for details. HTH, Jorge [1] http://cran.r-project.org/web/packages/foreign/index.html On Thu, Feb 4, 2010 at 5:31 PM, Alex Bryant <> wrote:

[R] random slope models with lme --> failured to converge

2010-02-04 Thread anord
Dear all, I am working on a data set in which I have sequentially measured egg temperatures ("eggtemp") in birds incubating in different ambient temperatures ("treat", sample data set below), "id" is not replicated within treatment. id treat eggtemp 1 79 3 30.90166 2 42 3 34.9

Re: [R] legend help

2010-02-04 Thread casperyc
Yes, that is pretty much what I want. However, there was slightly a mistake. we need to use ''rate=rate[i]"" and "shape=shape[i]" because the default is == dgamma(x, shape, rate = 1, scale = 1/rate, log = FALSE) ==

Re: [R] xyplot 3 panels 3 different Y variables

2010-02-04 Thread Gabor Grothendieck
As these are time series you can use plot.ts, plot.zoo or xyplot.zoo: tt <- ts(JUNK[-1]) plot(tt) library(zoo) z <- zoo(JUNK[-1], JUNK[,1]) plot(z) library(lattice) xyplot(z) On Thu, Feb 4, 2010 at 5:30 PM, Jacob Wegelin wrote: > > Often, when exploring a dataset, I'd like to plot several ver

Re: [R] export test results to csv

2010-02-04 Thread Jim Lemon
On 02/05/2010 03:44 AM, Ivan Calandra wrote: Hi everybody! I would like to export the results of a test statistic in a *.csv file, but get an error. The code is below. The data are attached as .txt with tab as separator. I tried to get a sample dataset, but for some reason it didn't work, so ple

Re: [R] How to export the examples in help(something) to a file?

2010-02-04 Thread Peng Yu
On Thu, Feb 4, 2010 at 4:34 PM, Henrik Bengtsson wrote: > On Thu, Feb 4, 2010 at 9:18 PM, Liaw, Andy wrote: >> From: Peng Yu >>> >>> On Wed, Feb 3, 2010 at 10:01 AM, Peng Yu wrote: >>> > Some examples in the help page are too long to be copied >>> from screen. >>> > Could somebody let me know so

[R] Reading sas7bdat files directly

2010-02-04 Thread Alex Bryant
Hi, I have a need to process (in real-time) a large number of .sas7bdat files from within R. The problem is I don't want to convert these files to .xpt (transport) every time. So just checking if anyone has a (viable) way to read .sas7bdat files directly into R? Thank You. //--

Re: [R] How to export the examples in help(something) to a file?

2010-02-04 Thread Henrik Bengtsson
On Thu, Feb 4, 2010 at 9:18 PM, Liaw, Andy wrote: > From: Peng Yu >> >> On Wed, Feb 3, 2010 at 10:01 AM, Peng Yu wrote: >> > Some examples in the help page are too long to be copied >> from screen. >> > Could somebody let me know some easy way on how to extract >> the example >> > to a file so th

[R] xyplot 3 panels 3 different Y variables

2010-02-04 Thread Jacob Wegelin
Often, when exploring a dataset, I'd like to plot several very different Y variables against the same X variable, in panels stacked one over the other. Is there an easy way to do this? I'd like to achieve an elegant look similar to the look achieved by lattice in conditioned plots--for instan

Re: [R] Minimizing two non-linear functions with genoud - Trying to minimize or converge near zero

2010-02-04 Thread Guillaume Théroux Rancourt
Thank you Ravi! What I forgot to mention in my first post is that gi should be between [0,1], while Vcmax is usually between [0,150], but can be higher [0,250]. That was the Domains of the genoud function initially. Also, in this example, f.1 should equal 7.478 and f.2 = 12.731 with the same V

Re: [R] selecting a group of points from a scatterplot?

2010-02-04 Thread Greg Snow
The tkBrush function in the TeachingDemos package and functions in the iplots package also allow brushing. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto

[R] replace a for loop with lapply or relative

2010-02-04 Thread David Freedman
Dear helpers. I often need to make dichotomous variables out of continuous ones (yes, I realize the problems with throwing away much of the information), but I then like to check the min and max of each category. I have the following simple code to do this that cuts each variable (x1,x2,x3) at th

Re: [R] Zero inflated negat. binomial model

2010-02-04 Thread Achim Zeileis
On Thu, 4 Feb 2010, Luciano La Sala wrote: Dear R crew: I think I am in the right mailing list. I have a very simple dataset consisting of two variables: cestode intensity and chick size (defined as CAPI). Intensity is clearly overdispersed, with way too many zeroes. I'm interested in looking

Re: [R] population variance and sample variance

2010-02-04 Thread Bert Gunter
Well, a perverse view: ;-) If using n vs n-1 makes a difference in the results, then you have too little data (more properly, error df) to say much about the variance anyway: n vs n-1 is the least of your problems. Otherwise, choose whichever you're in the mood for. Just state which for reprodu

Re: [R] Legend symbol?

2010-02-04 Thread Chris Campbell
On Thu, Feb 4, 2010 at 14:59, Douglas M. Hultstrand wrote: > Hello, > > I am creating a plot/image using different data and a couple fit lines (see > attached image).  In the legend, I want the Default and Exponential symbol > to be a line.  I am using the pch command, I tried to use "-" to repres

Re: [R] Minimizing two non-linear functions with genoud - Trying to minimize or converge near zero

2010-02-04 Thread Ravi Varadhan
I do not understand completely what you are trying to do, but may be this works for you!? f=function(x) { # x = c(0.16,80) Vcmax = x[2] gi = x[1] # First dataset f.1=function(x){ (-(((Vcmax-0.89189)/gi)+164.6573+272.38*(1+21*10/165.82))+sqrtVcmax-0.89189)/gi)+164.6573+272.38*(1+21*10/165.8

Re: [R] Legend symbol?

2010-02-04 Thread Sarah Goslee
So your question is actually about mixing lines and symbols in the legend? What about: plot(1:10, 1:10) legend("topleft", legend=c("a", "b", "c"), lty=c(NA, -1, 1), pch=c(1, 2, NA)) Sarah > - Original Message - From: "Douglas M. Hultstrand" > > To: "R mailing list" > Sent: Thursday, F

Re: [R] Legend symbol?

2010-02-04 Thread Gabriela Cendoya
Hi: not the best solution but, what about pch=45 or pch =47 ? Gabriela - Original Message - From: "Douglas M. Hultstrand" To: "R mailing list" Sent: Thursday, February 04, 2010 4:59 PM Subject: [R] Legend symbol? Hello, I am creating a plot/image using different data and a couple

[R] Zero inflated negat. binomial model

2010-02-04 Thread Luciano La Sala
Dear R crew: I think I am in the right mailing list. I have a very simple dataset consisting of two variables: cestode intensity and chick size (defined as CAPI). Intensity is clearly overdispersed, with way too many zeroes. I'm interested in looking at the association between these two variab

[R] Filling a logical matrices with values

2010-02-04 Thread anna freni sterrantino
Hello !! I have this problem: A matrix on True/False and as many numerical vectors as columns, but of different length. What I 'd like to get is this: set.seed(12) > dat <- as.data.frame(matrix(as.logical(sample(T:F, 30, T)),5,6)) > colnames(dat) <- letters[1:6] > rownames(dat) <- paste(letters[1:

Re: [R] How to export the examples in help(something) to a file?

2010-02-04 Thread Liaw, Andy
From: Peng Yu > > On Wed, Feb 3, 2010 at 10:01 AM, Peng Yu wrote: > > Some examples in the help page are too long to be copied > from screen. > > Could somebody let me know some easy way on how to extract > the example > > to a file so that I can play with them? > > I forget to mention. I use

Re: [R] for loop with if statment problem

2010-02-04 Thread Peter Ehlers
Stephen, You probably should name your dataframe 'dat' and replace the line x <- subset(x, Creek=="fbms" & station==i) with x <- subset(dat, Creek=="fbms" & station==i) -Peter Ehlers stephen sefick wrote: Both of the approx functions work correctly individually, but they are not being

Re: [R] What are Type II or III contrast? (contrast() in contrastpackage)

2010-02-04 Thread Liaw, Andy
From: Peng Yu > > On Wed, Feb 3, 2010 at 2:12 AM, Emmanuel Charpentier > wrote: > > Le mercredi 03 février 2010 à 00:01 -0500, David Winsemius a écrit : > >> On Feb 2, 2010, at 11:38 PM, Peng Yu wrote: > >> > >> > ?contrast in the contrast package gives me the following > description. > >> > How

Re: [R] help needed using t.test with factors

2010-02-04 Thread Thomas Adams
Peter, Thank you very much! That did the trick… Regards, Tom Peter Ehlers wrote: Tom, t.test(MAE ~ type, data=data, subset=type %in% c('hpc','rfc')) -Peter Ehlers Thomas Adams wrote: Dennis, Thank you for the suggestion, but I get this error: > t.test(MAE ~ type,data=data) Error in t.te

[R] Minimizing two non-linear functions with genoud - Trying to minimize or converge near zero

2010-02-04 Thread Guillaume Théroux Rancourt
Hello R users, I am trying to minimize two functions with genoud. It is actually one function with two sets of data, each of them having two unknown variables (called Vcmax and gi) which have the same value in each of the function. They are called f.1 and f.2 in the code below. My objective to

[R] Legend symbol?

2010-02-04 Thread Douglas M. Hultstrand
Hello, I am creating a plot/image using different data and a couple fit lines (see attached image). In the legend, I want the Default and Exponential symbol to be a line. I am using the pch command, I tried to use "-" to represent a line but does not work so I currently have set as a "1".

Re: [R] help needed using t.test with factors

2010-02-04 Thread Thomas Adams
Peter, Thanks for pointing that out; the 'sleep' data looks like this: > sleep extra group 10.7 1 2 -1.6 1 3 -0.2 1 4 -1.2 1 5 -0.1 1 63.4 1 73.7 1 80.8 1 90.0 1 10 2.0 1 11 1.9 2 12 0.8 2 13 1.1 2 14 0.1

Re: [R] help needed using t.test with factors

2010-02-04 Thread Peter Ehlers
Tom, t.test(MAE ~ type, data=data, subset=type %in% c('hpc','rfc')) -Peter Ehlers Thomas Adams wrote: Dennis, Thank you for the suggestion, but I get this error: > t.test(MAE ~ type,data=data) Error in t.test.formula(MAE ~ type, data = data) : grouping factor must have exactly 2 levels

Re: [R] coefs from summary.lm of an aov object

2010-02-04 Thread Ista Zahn
Hi Martin, See ?contrasts and associated help pages ?contr.sum, ?contr.treatment etc. Also note that you can set contrasts "manually": D <- data.frame(y = rnorm(20), group <- factor(c(rep("A", 5), rep("B", 5), rep("C", 5), rep("D", 5 group.dumcodes <- matrix(c(0, 0, 0,

Re: [R] help needed using t.test with factors

2010-02-04 Thread Peter Ehlers
Somehow, in looking for those many examples, you missed the 'sleep' data example on the help page for t.test. (BTW, I wouldn't consider your sample data to be "minimal" or even close to minimal.) -Peter Ehlers Thomas Adams wrote: I am trying to use t.test on the following data: datetype

Re: [R] help needed using t.test with factors

2010-02-04 Thread Thomas Adams
Dennis, Thank you for the suggestion, but I get this error: > t.test(MAE ~ type,data=data) Error in t.test.formula(MAE ~ type, data = data) : grouping factor must have exactly 2 levels Tom Dennis Murphy wrote: Hi: On Thu, Feb 4, 2010 at 11:07 AM, Thomas Adams

Re: [R] Interactively editing point labels in a graph

2010-02-04 Thread Gavin Simpson
On Tue, 2010-02-02 at 23:57 -0800, trece por ciento wrote: > Dear experts, > I would like to be able to interactively (if possible, with mouse and > clik) edit point labels in graphs, particularly in multivariate > graphs, such as the biplots you get after a correspondence analysis > (with, for exa

[R] for loop with if statment problem

2010-02-04 Thread stephen sefick
Both of the approx functions work correctly individually, but they are not being distinguished in the for loop by the if statments. Any help would be appreciated. for loop of interest is below x <- (structure(list(Site = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

[R] help needed using t.test with factors

2010-02-04 Thread Thomas Adams
I am trying to use t.test on the following data: datetypeINTERVALnCASESMTFSDFMTOSDO nFSTMFnOBSMOMBBIASCVBIASEVMEMAE RMSECRCF 2001-06-15avnGE1.0043850.2460.3001.502 0.55613671.3734385

Re: [R] population variance and sample variance

2010-02-04 Thread Peng Yu
On Thu, Feb 4, 2010 at 11:58 AM, Greg Snow wrote: > Probably not a typo, but a different textbook used originally.  Statistics is > still a relatively young science, so we have not settled on a single set of > notation/symbols/jargon yet (look at intro textbooks, is p the population > proportio

Re: [R] coefs from summary.lm of an aov object

2010-02-04 Thread David Winsemius
On Feb 4, 2010, at 1:02 PM, Martin Ivanov wrote: Dear R users, This is probably a very stupid question, nevertheless I obviously am not qualified enough to cope with it. I do not understand what the coefficients are that are output by running summary.lm on an aov object. I thought they sho

Re: [R] population variance and sample variance

2010-02-04 Thread Gabor Grothendieck
Checking VAR_SAMP and VAR_POP in the H2 and PostgreSQL databases and VAR and VARP in Excel we find that in all three cases the sample variance uses n-1. Here is an R example using H2 and sqldf: > library(RH2) > library(sqldf) > DF <- data.frame(x = 1:3) > sqldf("select VAR_SAMP(x), VAR_POP(x) fro

Re: [R] Problem accessing help files

2010-02-04 Thread Jonathan
Duncan: I set Firefox as the default browser; didn't need to delete and reinstall. Problem solved - now help is working properly; opening the documents in Firefox. By the by, despite IE's failings, the tab preview feature, when hovering the mouse over the icon on Windows 7 taskbar, is pretty

Re: [R] population variance and sample variance

2010-02-04 Thread Ista Zahn
Ah, that makes sense. Thanks for the clarification Greg. -Ista On Thu, Feb 4, 2010 at 5:58 PM, Greg Snow wrote: > Probably not a typo, but a different textbook used originally.  Statistics is > still a relatively young science, so we have not settled on a single set of > notation/symbols/jargo

[R] coefs from summary.lm of an aov object

2010-02-04 Thread Martin Ivanov
Dear R users, This is probably a very stupid question, nevertheless I obviously am not qualified enough to cope with it. I do not understand what the coefficients are that are output by running summary.lm on an aov object. I thought they should be the differential effects for the levels of t

Re: [R] ggplot2 / time series with different scales

2010-02-04 Thread Xie Chao
you can use facet_wrap: df <- melt(df, id=c('time', 'sid')) ggplot(df, aes(time, value, colour=sid)) + geom_line(data = subset(df, variable=='sales')) + geom_point(data = subset(df, variable=='price')) + facet_wrap(~variable, ncol=1, scales='free_y') Xie Chao On Fri, Feb 5, 2010 at 12:2

Re: [R] population variance and sample variance

2010-02-04 Thread Greg Snow
Probably not a typo, but a different textbook used originally. Statistics is still a relatively young science, so we have not settled on a single set of notation/symbols/jargon yet (look at intro textbooks, is p the population proportion (with p-hat the sample) or is p the sample proportion (wi

Re: [R] no write access for help files

2010-02-04 Thread Uwe Ligges
On 04.02.2010 13:12, Albert-Jan Roskam wrote: I'm using R v2.8 under Windows*) and I'm trying to install a new package (local zip file), but I get the message below. I followed some advice athttp://cran.r-project.org/bin/windows/base/rw-FAQ.html (4.2 onwards), but to no avail. How can I tel

Re: [R] List of object properties

2010-02-04 Thread Greg Snow
Others mentioned the str function which gives the full structure of the object and lots of information. If you just want the names of the top level elements then the names function is a little quicker and less cluttered (but does not give all the detail that str does). For large and/or complex

Re: [R] no write access for help files

2010-02-04 Thread Duncan Murdoch
On 04/02/2010 7:12 AM, Albert-Jan Roskam wrote: Hi I'm using R v2.8 under Windows*) and I'm trying to install a new package (local zip file), but I get the message below. I followed some advice at http://cran.r-project.org/bin/windows/base/rw-FAQ.html (4.2 onwards), but to no avail. How can I t

Re: [R] problems with SPC charts in R

2010-02-04 Thread Bart Joosen
I'm sorry, I'm doing this in my spare time, hadn't time during the day. But I tried your example, and didn't get the error. If you get the error with your example (with the data you had sent to this list), then I think Peter is right, and it has something to do with margins you had set. Try to st

Re: [R] create zip archive in R

2010-02-04 Thread Max Kuhn
The odfWeave package would really benefit from having an R zip function to zip a directory to an archive with an .odt extension. The need for an external zip/uniz utilities has been an issue for many non-technical windows users. Max On Thu, Feb 4, 2010 at 11:14 AM, Duncan Temple Lang wrote: > >

Re: [R] problems with SPC charts in R

2010-02-04 Thread Bart Joosen
I'm sorry, I'm doing this in my spare time, hadn't time during the day. But I tried your example, and didn't get the error. If you get the error with your example (with the data you had sent to this list), then I think Peter is right, and it has something to do with margins you had set. Try to st

Re: [R] Changing an unordered factor into an ordered factor

2010-02-04 Thread Mathew, Abraham T
1. I need to make it an ordered factor in order to run ordered logit. I could keep it unordered and run a multinomial logit, but that's beyond my capacity as a new social science grad student (can't interpret it) 2. this is the sample code I tried before running it on my data. > x <- c("favor",

Re: [R] create zip archive in R

2010-02-04 Thread Duncan Temple Lang
Uwe Ligges wrote: > > > On 04.02.2010 03:31, mkna005 mkna005 wrote: >> Hello all! >> I was wondering if it is possible to create a zip archive within R and >> add files to it? > > No. Well, the Rcompression package on the Omegahat package does have some facilities for it. It doesn't do it in

Re: [R] Help....package "GPLOTS" will not install. Linux

2010-02-04 Thread Gabor Grothendieck
Several things to try: 1. install ActiveState perl. I believe that that perl distribution already contains the offending perl module so you might be able to avoid building it, or 2. just remove src/Makefile from gdata so it does not try to build that perl module. You may lose some functionality

Re: [R] export test results to csv

2010-02-04 Thread David Winsemius
On Feb 4, 2010, at 11:44 AM, Ivan Calandra wrote: Hi everybody! I would like to export the results of a test statistic in a *.csv file, but get an error. What to you plan to do with this output file? The code is below. The data are attached as .txt with tab as separator. I tried to get

Re: [R] ggplot2 / time series with different scales

2010-02-04 Thread Dieter Menne
chuckwhite wrote: > > I am trying to plot this dataset using ggplot2: > > .. self-contained example removed > > How can I plot the price (using geom_point) in a separate plot just above > the sales plot so that the xaxes match and the yaxes are different. > > To quote Hadley Wickham: http:/

Re: [R] Fonts in X11(type="Xlib"): Was: What font exactly is tkrplot looking for

2010-02-04 Thread Kevin E. Thorpe
Kevin E. Thorpe wrote: Hello. I am getting an error thrown from tkrplot. It is X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 12 could not be loaded > sessionInfo() R version 2.10.1 Patched (2009-12-29 r50852) i686-pc-linux-gnu locale: [1] LC_CTYPE=en_US LC_NU

Re: [R] export test results to csv

2010-02-04 Thread jim holtman
Is 'test' a dataframe? Provide the output of 'str(test)' and that will give an idea of what the structure is and maybe what you have to do to get it into a format for a csv file. On Thu, Feb 4, 2010 at 11:44 AM, Ivan Calandra wrote: > Hi everybody! > > I would like to export the results of a tes

[R] export test results to csv

2010-02-04 Thread Ivan Calandra
Hi everybody! I would like to export the results of a test statistic in a *.csv file, but get an error. The code is below. The data are attached as .txt with tab as separator. I tried to get a sample dataset, but for some reason it didn't work, so please excuse the length of the file. I also

[R] GLMM and false convergence (8) warnings

2010-02-04 Thread Nuria Roura-Pascual
Hi, I am doing a binomial GLMM with a random intercept using the formula below, but I always get the same warning message. > m01 <- lmer(pres~ HT + DN + dtree + DNm + cmnhi + cmxes + cplan + craan + lfphal0100 + lfov0100 + lfop0100 + (1|plot), family=binomial, data=vphal, verbose=TRUE) 0: 6

Re: [R] How to read HTML or TEXT file with tm package

2010-02-04 Thread Uwe Ligges
On 04.02.2010 06:58, Lica Oka wrote: Hi, everyone! I'm a novice at R with tm package. So I need your help!! I'd like to analyze some German texts using tm package for my papers. But somehow, I could not use it well. Now I'm using R ver.2.10.1 and tm package ver.0.5-2 on WindowsXP and also Ma

Re: [R] Changing an unordered factor into an ordered factor

2010-02-04 Thread David Winsemius
I'm guessing that the attachment did not make it to the list, since it was of a filetype that is not on the approved list and also because it was 5.4MB long. My mail-server has no such restrictions, so I do have your file of type ".POR". Unfortunately I have serious reservations about openi

[R] ggplot2 / time series with different scales

2010-02-04 Thread Chuck White
I am trying to plot this dataset using ggplot2: df <- data.frame( sid = c(rep('11',30),rep('22',30)), time = rep(ISOdate(year = 2010, month = 1, day = 1:30),2), sales = c(rnorm(30, 1000, 20),rnorm(30, 900, 10)), price = c(rnorm(30, 2, 0.5),rnorm(30, 3,0.5)) ) Plotting just the sales

Re: [R] tapply for function taking of >1 argument?

2010-02-04 Thread David Winsemius
On Feb 4, 2010, at 9:56 AM, J. R. M. Hosking wrote: sjaffe wrote: I'm sure I can put this together from the various 'apply's and split, but I wonder if anyone has a quick incantation: E.g. I can do tapply( data, groups, mean) but how can I do something like: tapply( list(data,weights), grou

Re: [R] create zip archive in R

2010-02-04 Thread Uwe Ligges
On 04.02.2010 03:31, mkna005 mkna005 wrote: Hello all! I was wondering if it is possible to create a zip archive within R and add files to it? No. I know it is possible to unzip files but is it possible the other way round? No. For (compressed) archives see ?tar For other compression f

Re: [R] Help....package "GPLOTS" will not install. Linux

2010-02-04 Thread Uwe Ligges
After some update of gdata the package needs the Compress::Raw::Zlib perl module and tries to build it but fails. Please report the issue you found to the package maintainer. Please note that you are using a really outdated version of R . Uwe Ligges On 04.02.2010 01:29, Laurence Cooke w

Re: [R] 2 dimensional interpolation from matlab to R

2010-02-04 Thread spencerg
Have you considered the "fda" package and the companion book, "Functional Data Analysis with R and Matlab" (Springer, 2009) by Ramsay, Hooker and Graves? This will NOT help you directly with bathymetry = f(long, lat), but will help with b=f(x)+e AND with translations between Matlab and R.

Re: [R] Creating a table with median for multiple variables

2010-02-04 Thread billy_no_mates
party votes1st 1 ind 335 2 ind 1614 3 fg 5468 4 lab 4272 5 ff 9343 6 ff12489 7 ff 8711 8 gp 4961 9 lab 3732 10 fg 7841 11lab NA 12 sf 2078 13 fg 4819 14 ff10679 15 sf108

Re: [R] tapply for function taking of >1 argument?

2010-02-04 Thread J. R. M. Hosking
sjaffe wrote: I'm sure I can put this together from the various 'apply's and split, but I wonder if anyone has a quick incantation: E.g. I can do tapply( data, groups, mean) but how can I do something like: tapply( list(data,weights), groups, weighted.mean ) ? (or: mapply is to sapply as ? is

  1   2   >