[R] Odp: For Loop

2010-08-05 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.08.2010 10:47:03: > > I have some code that is working. > > The code calculates the error from the real vale when it does a run. > > The error in metres in called > > errorxy > > > I want to do 10 runs of the code and everytime it does a run I w

Re: [R] How to extract se(coef) from cph?

2010-08-05 Thread Frank Harrell
In an upcoming release of the rms package, all fit objects can be printed using LaTeX if putting LaTeX code directly to the console (this is optimized for Sweave). You will be able to say print(fit, latex=TRUE). Frank E Harrell Jr Professor and ChairmanSchool of Medicine

[R] Confidence Intervals for logistic regression

2010-08-05 Thread Troy S
Dear UseRs, I have fitted a logistic regression using glm and want a 95% confidence interval on a response probability. Can I use predict(model, newdata, se.fit=T) Will fit +/- 1.96se give me a 95% of the logit? And then exp(fit +/- 1.96se) / (exp(fit +/- 1.96se) +1) to get the probabilities?

[R] hi!! please help me!

2010-08-05 Thread leepama
I made some anonymous function which performs some process in matlab code.. But I want to perform it in R program... Is there any method??? -- View this message in context: http://r.789695.n4.nabble.com/hi-please-help-me-tp2315919p2315919.html Sent from the R help mailing list archive at Nabble.

[R] apply family functions

2010-08-05 Thread Steven Kang
Hi all, I would like to flag each record in the data according to certain conditions as specified below. For example, If "Close_date" in *dat* is between ("Open" & "Close") or ("Open1" & "Close1") or ("Open2" & "Close2") in *oc, *flag the records as "Valid", otherwise "Invalid" I would like to

Re: [R] Multiply each depth level of an array with another vector element

2010-08-05 Thread Wu Gong
I have only achieved a half improvement. x <- array(1:2400*1, dim = c(200,300,400)) y <- 1:400*1 ptm <- proc.time() z <- x*as.vector(t(replicate(dim(x)[1]*dim(x)[2], y[1:dim(x)[3]]))) "replicate:" proc.time() - ptm x <- array(1:2400*1, dim = c(200,300,400)) y <- 1:400*1 ptm <- proc.time

[R] Re : How to extract se(coef) from cph?

2010-08-05 Thread Biau David
thanks, it works just great. David Biau. De : "Abhijit Dasgupta, PhD" Cc : r help list Envoyé le : Jeu 5 août 2010, 22h 15min 37s Objet : Re: [R] How to extract se(coef) from cph? if the cph model fit is m1, you can try sqrt(diag(m1$var)) This is coded i

Re: [R] 64-bit R on 64-bit Windows box... Still not enough memory?!

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 7:40 PM, noclue_ wrote: I have a 64-bit windows box - Intel Xeon CPU E7340 @ 2.4GHz 31.9GB of RAM I have R 2.11.1 (64bit) running on it. Dear noclue_; What does this return?: .Machine$sizeof.pointer My csv data is 3.6 GB (with about 15 million obs, 120 variables.)

[R] Stopping precision using 'optim'

2010-08-05 Thread Jeremy Beaulieu
Hi all~ I am wondering if it is possible to alter the stopping precision for parameters estimated using the 'optim'? If it helps, I am minimizing the log-likelihood of a function using constraints (i.e. L-BFG-S). -Jeremy __ R-help@r-project.org mail

[R] Tobit Modelling

2010-08-05 Thread Patrick Sessford
Dear R-users, I would like to model data where the response variable consists of many minus ones and many different positive values that seem to follow an apparently separate distribution (ie. -1, -1, 0.5, -1, 3, 3.5, 1.2, -1, -1, 0.4, etc); no values of the response can be less than minus on

[R] 64-bit R on 64-bit Windows box... Still not enough memory?!

2010-08-05 Thread noclue_
I have a 64-bit windows box - Intel Xeon CPU E7340 @ 2.4GHz 31.9GB of RAM I have R 2.11.1 (64bit) running on it. My csv data is 3.6 GB (with about 15 million obs, 120 variables.) I have successfully imported the data above into R. No problem.

Re: [R] more questions on gam/gamm(mgcv)...

2010-08-05 Thread Gavin Simpson
> Hi R-users, > > I'm using R 2.11.1, mgcv 1.6-2 to fit a generalized additive mixed model. > I'm new to this package...and just got more and more problems... > > 1. Can I include correlation and/or random effect into gam( ) also? or > only > gamm( ) could be used? Only in gamm() > 2. I want to e

Re: [R] limits of a data frame size for reading into R

2010-08-05 Thread Matthew Keller
I sometimes have to work with vectors/matrices with > 2^31 - 1 elements. I have found the bigmemory package to be of great help. My lab is also going to learn sqldf package for getting bits of big data into/out of R. Learning both of those packages should help you work with large datasets in R. Th

Re: [R] try-error within for loop

2010-08-05 Thread Wu Gong
Assigning the value directly to result[i] would give a null to result. Like that: result[[i]]<-taxondiveO(abd,taxa) result[[i]]<-as.data.frame(result[[i]])[1,] In fact your code's result should have null elements in it. You lost your nulls through do.call process. I can't find a way to assign t

Re: [R] Plotting range of values in barplot()

2010-08-05 Thread yankeetilidie
Works perfectly. Thank you! -- View this message in context: http://r.789695.n4.nabble.com/Plotting-range-of-values-in-barplot-tp2315414p2315725.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:/

Re: [R] Exporting nlme summary

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 6:22 PM, Jun Shen wrote: I believe this has been discussed many times in the archives. Here is one way to do it. Yes, you are so right. Use function "sink" to direct the output to a file you specify sink( file='your file.txt') after you execute this command, all the ou

Re: [R] Exporting nlme summary

2010-08-05 Thread Jun Shen
I believe this has been discussed many times in the archives. Here is one way to do it. Use function "sink" to direct the output to a file you specify >sink(file='your file.txt') after you execute this command, all the output will be saved to your file and you won't see it on the screen. Say >sum

Re: [R] eval-parse and lme in a loop

2010-08-05 Thread Eik Vettorazzi
Hi Colm, the replaced code below works (its probably not the most elegant way, but rather the result of hours trial and error with eval, paste, bquote and Co). But if you want to keep all of your model results you should read the help for 'assign' and insert something like assign(paste("lme.",mean

Re: [R] Download xls file from internet

2010-08-05 Thread Eik Vettorazzi
hi pete, try download.file("http://ir.eia.gov/wpsr/psw09.xls","C:\\Temp\\psw09.xls",mode="wb";) since xls are binary files. cheers Am 05.08.2010 23:25, schrieb Pete B: > > I am trying to download an Excel file from the the internet with the > following R command > > download.file("http://ir.eia

[R] Download xls file from internet

2010-08-05 Thread Pete B
I am trying to download an Excel file from the the internet with the following R command download.file("http://ir.eia.gov/wpsr/psw09.xls","C:\\Temp\\psw09.xls";) The file is downloaded but when I try and open it I get a message from Excel telling me that the file is corrupt and it cannot be open

Re: [R] Reducing a list of functions by composition fails

2010-08-05 Thread Mog
Thanks very much! Works fine now. I'll read up on R's evaluation model. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented,

[R] eval-parse and lme in a loop

2010-08-05 Thread Connolly, Colm
Hi everybody, I'm having trouble getting an eval-parse combination to work with lme in a for loop. Consider the code below. The call to lme outside the loop works. The call to aov inside the loop works, but the call to to lme inside the loop does not. The latter fails with Error in model.fram

Re: [R] Reducing a list of functions by composition fails

2010-08-05 Thread David Reiner
OK: > comp <- function(x) Reduce(Funcall, list(plus2,plus3,plus4), init=x, > right=TRUE) > comp(3) [1] 12 but of course, Gabor's answer is more insightful and cleaner. -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mog

Re: [R] regression analysis with interactions

2010-08-05 Thread Erik Iverson
Jennifer Hou wrote: Thank you very much for your kind reply, I have found that the error was in the stdCoeff function and not in the linear model. summary() works pretty well on my model, I will simply use another function to compute my coefficients. Best regards, Jennifer See ?coef , summar

Re: [R] regression analysis with interactions

2010-08-05 Thread Jennifer Hou
Thank you very much for your kind reply, I have found that the error was in the stdCoeff function and not in the linear model. summary() works pretty well on my model, I will simply use another function to compute my coefficients. Best regards, Jennifer > Date: Wed, 4 Aug 2010 15:27:40 -0500 >

Re: [R] Reducing a list of functions by composition fails

2010-08-05 Thread Gabor Grothendieck
On Thu, Aug 5, 2010 at 4:31 PM, Mog wrote: > Hi All, > > I'd like to be able to specify the ordered composition of several > functions. So I defined compose: > > compose <- function(f,g){ >  function(x){f(g(x))} > } > > and some simple test functions: > > plus2 <- function(x){x+2} > plus3 <- funct

Re: [R] Reducing a list of functions by composition fails

2010-08-05 Thread Mog
I realize that the Funcall example with an init parameter will work, but I'd like to be able to get a one-argument function/closure out of that reduction, if at all possible. Sorry, I under-specified in my question. Thanks! __ R-help@r-project.org maili

Re: [R] [SPAM] - Reducing a list of functions by composition fails - Bayesian Filter detected spam

2010-08-05 Thread David Reiner
> Funcall <- function(f, ...) f(...) > Reduce(Funcall,list(plus2,plus3,plus4),init=3,right=TRUE) [1] 12 Basically from the examples from ?Reduce. HTH, David L. Reiner XR Trading LLC -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of M

Re: [R] an issue about missing data

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 3:59 PM, karena wrote: library(GenABEL) gs.b <- gs > library(GenABEL) Loading required package: MASS GenABEL v. 1.6-0 (June 21, 2010) loaded > gs.b <- gs Error: object 'gs' not found You are not making this easy. I asked what str(gs) returned. Instead you gave us code b

[R] Reducing a list of functions by composition fails

2010-08-05 Thread Mog
Hi All, I'd like to be able to specify the ordered composition of several functions. So I defined compose: compose <- function(f,g){ function(x){f(g(x))} } and some simple test functions: plus2 <- function(x){x+2} plus3 <- function(x){x+3} plus4 <- function(x){x+4} > (compose(plus2,compose(

Re: [R] PageUp/Down in gnome-terminal

2010-08-05 Thread Olga Lyashevska
On Thu, 2010-08-05 at 10:59 +0100, Liviu Andronic wrote: > On Thu, 05 Aug 2010 11:13:00 +0200 > Olga Lyashevska wrote: > > I do not have any desktop environment (running R on a server), can I > > still try xfce? > > > I am not very sure. If you are running gnome-terminal, I assume that > you hav

[R] Re : How to extract se(coef) from cph?

2010-08-05 Thread Biau David
Excellent! Yes, FH has a function to get LateX tables, but I not malleable enough. Thanks, David Biau. De : David Winsemius Cc : r help list Envoyé le : Jeu 5 août 2010, 22h 11min 20s Objet : Re: [R] How to extract se(coef) from cph? On Aug 5, 2010, at

Re: [R] How to extract se(coef) from cph?

2010-08-05 Thread Abhijit Dasgupta, PhD
if the cph model fit is m1, you can try sqrt(diag(m1$var)) This is coded in print.cph.fit (library(rms)) On 08/05/2010 04:03 PM, Biau David wrote: Hello, I am modeling some survival data wih cph (Design). I have modeled a predictor which showed non linear effect with restricted cubic splines.

Re: [R] an issue about missing data

2010-08-05 Thread karena
library(GenABEL) gs.b <- gs ok <- complete.cases(g...@phdata[,c('sex','age','b.dbp','b.bmi')]) gs.b <- gs.b[ok] g...@phdata <- g...@phdata[,c('id','sex','age','b.dbp','b.bmi')] index=1:g...@gtdata@nsnps ran.snp=sample(index,261,replace=F) gs.b.gkin=ibs(gs.b[,ran.snp], weight="freq") attach(g...@p

Re: [R] How to extract se(coef) from cph?

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 4:03 PM, Biau David wrote: Hello, I am modeling some survival data wih cph (Design). I have modeled a predictor which showed non linear effect with restricted cubic splines. I would like to retrieve the se(coef) for other, linear, predictors. The cph object has a "var

[R] try-error within for loop

2010-08-05 Thread Olga Lyashevska
Dear all, I run a loop wrapped in try(), and for each of the rows where "try-error" is true I want to fill that row with NA (at the moment it is omitted). So I would expect to get a dataframe with 1000 rows some of which would be empty, but instead I get a dataframe with 995 rows. In this case mi

[R] How to extract se(coef) from cph?

2010-08-05 Thread Biau David
Hello, I am modeling some survival data wih cph (Design). I have modeled a predictor which showed non linear effect with restricted cubic splines. I would like to retrieve the se(coef) for other, linear, predictors. This is just to make nice LateX tables automatically. I have the coefficients w

Re: [R] Plotting range of values in barplot()

2010-08-05 Thread Marc Schwartz
On Aug 5, 2010, at 1:22 PM, yankeetilidie wrote: > > Hello, > > I am attempting to create a bar plot that contains a range of possible > response values on the x-axis of 1 to 5 and contains barplots for the number > of responses even in the event that there are 0 responses. For example, I > hav

[R] Multiply each depth level of an array with another vector element

2010-08-05 Thread Maurits Aben
Suppose x <- array(c(1,1,1,1,2,2,2,2), dim = c(2,2,2)) y <- c(5, 10) Now I would like to multiply x[, , 1] with y[1] and x[, , 2] with y[2]. Possible solution is a for-loop: for (i in 1:2) { x[, , i] * y[i] } Another possible solution is this construction: as.vector(t(replicate(nrow(

Re: [R] an issue about missing data

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 3:44 PM, karena wrote: thank you, but even after I tried 'complete.cases' function, How did you try? I still get the same error messages. What does str(gs) tell you? help. Plaintive cries for help are considerably less useful than details about the

Re: [R] an issue about missing data

2010-08-05 Thread karena
thank you, but even after I tried 'complete.cases' function, I still get the same error messages. help. -- View this message in context: http://r.789695.n4.nabble.com/an-issue-about-missing-data-tp2315094p2315519.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Finding the right url for RCurl

2010-08-05 Thread AndrewPage
Thanks for the help so far-- one interesting thing about this particular page is that the data displayed on the website actually differs from the data you can access with the "download" link. The XML package command works, but the table it produces in R has the following column names: > x1 = >

Re: [R] difficulties with read.table applied to files from URL

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 3:05 PM, David Winsemius wrote: On Aug 5, 2010, at 2:48 PM, Archana Dayalu wrote: Hello, I am using read.table to read files directly from a public ftp site. I have a general list of files that may or may not exist in the ftp directory, but my hope was that R would rea

Re: [R] Sciviews-K -- object 'httpdPort' not found

2010-08-05 Thread Albert-Jan Roskam
Hi, Thank you, you're right. I should have read the website more carefully: "Download and install R (installers for Linux, Mac OS X universal, Windows, ...; use at least R 2.10.1)." http://www.sciviews.org/SciViews-K/index.html In Windows, I use that version but I didn't think about it when tryi

[R] Exporting nlme summary

2010-08-05 Thread Ronald Wendt
I'm trying to export the results of my summary data for the object horton.nlme, but failing miserably. Running summary(horton.nlme) works fine, but both write.table and write.csv return the error "cannot coerce class 'c("summary.lme", "nlme", "lme")' into a data.frame". I know I can copy and past

Re: [R] difficulties with read.table applied to files from URL

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 2:48 PM, Archana Dayalu wrote: Hello, I am using read.table to read files directly from a public ftp site. I have a general list of files that may or may not exist in the ftp directory, but my hope was that R would read the file if it existed and ignored it if it didn't

[R] difficulties with read.table applied to files from URL

2010-08-05 Thread Archana Dayalu
Hello, I am using read.table to read files directly from a public ftp site. I have a general list of files that may or may not exist in the ftp directory, but my hope was that R would read the file if it existed and ignored it if it didn't exist and move on to the next one. However, when R arrives

[R] Plotting range of values in barplot()

2010-08-05 Thread yankeetilidie
Hello, I am attempting to create a bar plot that contains a range of possible response values on the x-axis of 1 to 5 and contains barplots for the number of responses even in the event that there are 0 responses. For example, I have a data set that contains values of 2, 3, 4, and 5 but I would

Re: [R] offlist comment Re: KS Test question (2)

2010-08-05 Thread Ralf B
Hi David, I would like to apologize for what I wrote earlier. It was late and I was frustrated. Please give me time to adapt to the formal structures of the forum. Best, Ralf On Thu, Aug 5, 2010 at 7:32 AM, David Winsemius wrote: > > On Aug 5, 2010, at 4:10 AM, Ralf B wrote: > >> This is unbeli

Re: [R] Finding the right url for RCurl

2010-08-05 Thread Henrique Dallazuanna
Try this: library(XML) readHTMLTable(' http://www.invescopowershares.com/products/holdings.aspx?ticker=PGX', which = 13, header = TRUE) On Wed, Aug 4, 2010 at 6:07 PM, AndrewPage wrote: > > Hi all, > > I am using RCurl to try and download data from a website, but I'm having > trouble finding ou

Re: [R] Help installation lme4a,

2010-08-05 Thread Uwe Ligges
On 05.08.2010 19:48, rod84 wrote: Thank you for your prompt response. I am not used to the process of building a package. And I am using Windows as an OS.Do you have some steps I should follow to be able to build the package.Thank you for your time and recommendations. See the manual R

Re: [R] Help installation lme4a,

2010-08-05 Thread rod84
Thank you for your prompt response. I am not used to the process of building a package. And I am using Windows as an OS.Do you have some steps I should follow to be able to build the package.Thank you for your time and recommendations. Date: Thu, 5 Aug 2010 09:19:18 -0700 From: ml-node+2315087

Re: [R] Help installation lme4a, Error Message: lme4a is not a valid installed library

2010-08-05 Thread Rodrigue NGUEYEP
Thank you for your prompt response,I am using Windows. > Date: Thu, 5 Aug 2010 12:32:19 -0500 > Subject: Re: [R] Help installation lme4a, Error Message: lme4a is not a valid > installed library > From: ba...@stat.wisc.edu > To: ngueye...@hotmail.com > CC: r-help@r-project.org > > On Thu

Re: [R] Sciviews-K -- object 'httpdPort' not found

2010-08-05 Thread Romain Francois
Hi, httpdPort arrived with R 2.10.0, apparently Sciviews-K relies on this, so you need to upgrade R to a newer version. Romain Le 05/08/10 19:16, Albert-Jan Roskam a écrit : Hi, I'm trying to install Sciviews-K on Linux Ubuntu 9.10 (karmic) but I'm not able to establish the connection bet

Re: [R] Help installation lme4a, Error Message: lme4a is not a valid installed library

2010-08-05 Thread Douglas Bates
On Thu, Aug 5, 2010 at 9:31 AM, rod84 wrote: > Dear R users, > I recently downloaded the library lme4a by > svn checkout svn://svn.r-forge.r-project.org/svnroot/lme4. > I tried to install the library lme4a by copying the downloaded document in > the location where all the R libraries are saved.

Re: [R] Finding the right url for RCurl

2010-08-05 Thread Brian Diggs
On 8/4/2010 2:07 PM, AndrewPage wrote: Hi all, I am using RCurl to try and download data from a website, but I'm having trouble finding out what URL to use. Here is the site: http://www.invescopowershares.com/products/holdings.aspx?ticker=PGX See how in the upper right, above the displayed s

Re: [R] Metafor

2010-08-05 Thread Viechtbauer Wolfgang (STAT)
Correct. -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and StatisticsTel: +31 (0)43 388-2277 School for Public Health and Primary Care Office Location: Maastricht University, P.O. Box 616 Room B2.01 (second floor) 6200 MD Maastricht,

[R] Sciviews-K -- object 'httpdPort' not found

2010-08-05 Thread Albert-Jan Roskam
Hi, I'm trying to install Sciviews-K on Linux Ubuntu 9.10 (karmic) but I'm not able to establish the connection between Komodo and R. Here;s the error I get, plus some diagnostic info: R version 2.9.2 (2009-08-24) R is SciViews ready! Error in get(name, envir = asNamespace(pkg), inherits = FALS

Re: [R] metafor and meta-analysis at arm-level

2010-08-05 Thread Viechtbauer Wolfgang (STAT)
Dear Angelo, rma(yi=o, sei=se, mods=~s+t-1, method="REML") is *a* way to run the arm-based pairwise meta-analysis. Whether it is the *correct* way is a question I cannot answer. lme(o~s+t-1, random=~t-1 | s, weights=(~ se^2)) is a different model. First of all, it adds a random effect only to

Re: [R] Kolmogorov-Smirnov test, which one to use?

2010-08-05 Thread Greg Snow
It is not clear what question you are trying to answer. Perhaps if you can give us an explanation of your overall goal then we can be more helpful. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- >

Re: [R] KS Test question (2)

2010-08-05 Thread Greg Snow
The warning (with an error you would not see any results) means that there are ties in your data, the theory behind the ks test says that the probability of seeing ties is 0, so your data and the theory do not match, therefore the p-value is suspect (though an ok approximation for some uses). T

[R] compare gam fits

2010-08-05 Thread Mike Lawrence
Hi folks, I originally tried R-SIG-Mixed-Models for this one (https://stat.ethz.ch/pipermail/r-sig-mixed-models/2010q3/004170.html), but I think that the final steps to a solution aren't mixed-model specific, so I thought I'd ask my final questions here. I used gamm4 to fit a generalized additive

Re: [R] an issue about missing data

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 12:23 PM, karena wrote: Hi, I am using a function 'polygenic' in the package called 'GenABEL'. h2.gs <- polygenic(b.dbp~age+age2+age3+sex+b.bmi, kin=gs.gkin, data=gs) Have you considered us

[R] using grib files in R

2010-08-05 Thread Janet Nye
I am not new to R, but I am new to .grib files. I am downloading some climate data and I would like to analyze it in R. R has a nice netcdf package, but I don’t see any package available to deal specifically with grib files. I see a few posts from other people using grib files in R. However, I

[R] Help installation lme4a, Error Message: lme4a is not a valid installed library

2010-08-05 Thread rod84
Dear R users, I recently downloaded the library lme4a by svn checkout svn://svn.r-forge.r-project.org/svnroot/lme4. I tried to install the library lme4a by copying the downloaded document in the location where all the R libraries are saved. When I try to load the library, I obtain the message

Re: [R] colour of label points on a boxplot

2010-08-05 Thread Jean V Adams
Alison, Check out the options for the function bxp(), they include control over the colors of all parts of the boxplot, e.g., whiskcol for whisker color. Jean `·.,, ><(((º> `·.,, ><(((º> `·.,, ><(((º> Jean V. Adams Statistician U.S. Geological Survey Great Lakes Science Center 223 East

[R] interpretation of summary.lm() for ANOVA and ANCOVA when dealing with 2 or more factors

2010-08-05 Thread Birte Reichstein
Hi, I am having a hard time getting what the summary.lm-output for an ANOVA / ANCOVA means. Examples I find always seem to deal with simpler cases than what I meet in my data. My main problem is understanding the output when getting significant INTERACTION TERMS (what never occurs in examples

[R] an issue about missing data

2010-08-05 Thread karena
Hi, I am using a function 'polygenic' in the package called 'GenABEL'. > h2.gs <- polygenic(b.dbp~age+age2+age3+sex+b.bmi, kin=gs.gkin, data=gs) --

Re: [R] Help installation lme4a,

2010-08-05 Thread Kevin E. Thorpe
rod84 wrote: Dear R users, I recently downloaded the library lme4a by svn checkout svn://svn.r-forge.r-project.org/svnroot/lme4. I tried to install the library lme4a by copying the downloaded document in the location where all the R libraries are saved. When I try to load the library, I obtain

Re: [R] A %nin% operator?

2010-08-05 Thread Jeremy Miles
A related hint, Google doesn't let you search for %nin%, because it ignores % symbols (and most other punctuation), but cuil does allow you to search: http://cuil.com/search?q=%25nin%25+R On 5 August 2010 08:53, David Winsemius wrote: > The examples in the help page for "%in%" (shared by "match")

[R] Help installation lme4a,

2010-08-05 Thread rod84
Dear R users, I recently downloaded the library lme4a by svn checkout svn://svn.r-forge.r-project.org/svnroot/lme4. I tried to install the library lme4a by copying the downloaded document in the location where all the R libraries are saved. When I try to load the library, I obtain the message

Re: [R] A %nin% operator?

2010-08-05 Thread Ken Williams
Yeah, and %w/o% seems to have reinvented setdiff(). =) -Ken On 8/5/10 10:53 AM, "David Winsemius" wrote: > The examples in the help page for "%in%" (shared by "match") has the > definition of a "%w/o%" binary operator. > > "%w/o%" <- function(x,y) x[!x %in% y] #-- x without y > since: > "%

Re: [R] A %nin% operator?

2010-08-05 Thread David Winsemius
The examples in the help page for "%in%" (shared by "match") has the definition of a "%w/o%" binary operator. "%w/o%" <- function(x,y) x[!x %in% y] #-- x without y since: "%in%" <- function(x, table) match(x, table, nomatch = 0) > 0 It appears that you have just re-invented the without-wheel.

Re: [R] A %nin% operator?

2010-08-05 Thread baptiste Auguié
For curiosity's sake, and perhaps closer in keystrokes to R home, here's another version, `%ni%` <- Negate(`%in%`) baptiste On Aug 5, 2010, at 5:30 PM, Ken Williams wrote: > Ha! Thanks. I should have a closer look at Hmisc in general. > > -Ken > > > On 8/5/10 10:25 AM, "David Huffer" wr

[R] several figures from one Sweave chunk?

2010-08-05 Thread Liviu Andronic
Dear all It seems that it is not possible [1] to generate several graphs in a loop within an Sweave document. For example, <> for (i in 1:4) plot(rnorm(100)+i) @ will not work. Since this limitation dates from old times (at least 2005), I was curious whether workarounds other than "\includegr

Re: [R] A %nin% operator?

2010-08-05 Thread Ken Williams
Ha! Thanks. I should have a closer look at Hmisc in general. -Ken On 8/5/10 10:25 AM, "David Huffer" wrote: > See Harrell's Hmisc package > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Ken Williams > Sent: Thursday,

Re: [R] A %nin% operator?

2010-08-05 Thread Erik Iverson
Just FYI, the Hmisc package has had an implementation of %nin% for some time now. Ken Williams wrote: Sometimes I write code like this: qf.a <- subset(qf, pubid %in% c(104, 106, 107, 108)) qf.b <- subset(qf, !pubid %in% c(104, 106, 107, 108)) and I get a little worried that maybe I've remem

Re: [R] A %nin% operator?

2010-08-05 Thread David Huffer
See Harrell's Hmisc package -- David Huffer, Ph.D. Deputy Director CSOSA/ORE Washington, DC -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ken Williams Sent: Thursday, August 05, 2010 11:20 AM To: r-help@r-project.org Subject:

[R] A %nin% operator?

2010-08-05 Thread Ken Williams
Sometimes I write code like this: > qf.a <- subset(qf, pubid %in% c(104, 106, 107, 108)) > qf.b <- subset(qf, !pubid %in% c(104, 106, 107, 108)) and I get a little worried that maybe I've remembered the precedence rules wrong, so I change it to > qf.a <- subset(qf, pubid %in% c(104, 106, 107, 10

Re: [R] REmove level with zero observations

2010-08-05 Thread Allan Engelhardt
On 03/08/10 21:50, GL wrote: If I have a column with 2 levels, but one level has no remaining observations. Can I remove the level? Like this? d <- data.frame(a = factor(rep("A", 3), levels = c("A", "B"))) levels(d$a) # [1] "A" "B" d$a <- d$a[,drop=TRUE] levels(d$a) # [1] "A" Hope this h

[R] plot points using vis.gam

2010-08-05 Thread mra
Hello, I'm trying to illustrate the relationships between various trait and environment data gathered from a number of sites. I've created a GAM to do this: gam1=gam(trait~s(env1)+s(env2)+te(env1,env2)) and I know how to create a 3D plot using vis.gam. I want to be able to show points on the 3D p

Re: [R] Reshape? I need it?

2010-08-05 Thread Stefan Grosse
Am 05.08.2010 12:57, schrieb spigo: > I don't know how to do it. I need to use reshape? how? > thanks for your reply. example(reshape) Stefan __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] a question about 'read.table' with or without 'read.table'.(urgent)

2010-08-05 Thread John Kane
I believe Wu Gong has given you a solution. As a note you were probably reading in the first two columns as either factors or characters and the last one as numeric. You might want to try it again and then do a str() on the resulting data.frame to see what was happening. It can be confusing

[R] build.pl in building library with Rtools211

2010-08-05 Thread Hintzen, Niels
Dear all, As I couldn't find any thread on the internet I hope the help-list might help me out. I've tried to update Rtools from R210 used in combination with R2.9.1 to R211 in combination with R2.11.1. However, I do not succeed. I have R2.11.1 running, as well as Inno Setup 5, HTML help and M

Re: [R] Reshape? I need it?

2010-08-05 Thread Henrique Dallazuanna
Try this: unstack(DF, Avariato ~ TIPO) On Thu, Aug 5, 2010 at 7:57 AM, spigo wrote: > > Dear all, > I'm new here, I'm starting to learn R (oh my God!!). So, now I'm in panic > because I have this situation: > > TIPO Avariato > A 0.05 > B 0.09 > A 9 > B 8 > A 9 >

Re: [R] Reshape? I need it?

2010-08-05 Thread Michael Bedward
Hello, For that simple case you could just do... newdf <- data.frame(A=df[df$TIPO == "A",2], B=df[df$TIPO == "B",2]) where df is the name of your existing data.frame Michael On 5 August 2010 20:57, spigo wrote: > > Dear all, > I'm new here, I'm starting to learn R (oh my God!!). So, now I'm

Re: [R] linear model with similar response predictor

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 6:50 AM, Giuseppe Amatulli wrote: Hi, can somebody tell me why R is not able to calculate a linear model written in this way? lm (seq(1:100)~seq(1:100)) Call: lm(formula = seq(1:100) ~ seq(1:100)) Coefficients: (Intercept) 50.5 Warning messages: 1: In model.matrix

Re: [R] linear model with similar response predictor

2010-08-05 Thread Erik Iverson
On 08/05/2010 05:50 AM, Giuseppe Amatulli wrote: Hi, can somebody tell me why R is not able to calculate a linear model written in this way? lm (seq(1:100)~seq(1:100)) Call: lm(formula = seq(1:100) ~ seq(1:100)) Coefficients: (Intercept) 50.5 Warning messages: 1: In model.matrix.def

Re: [R] colour of label points on a boxplot

2010-08-05 Thread John Kane
It would really help if you could reduce the information below to a small reproducible example, that is, some small bit of code that a reader can paste into R and poke around at. For sending a small sample dataset have a look at ?dput I believe that this problem has been discussed on the R-he

Re: [R] For Loop

2010-08-05 Thread Erik Iverson
Hello, Please read the posting guide found at the bottom of every post to this list. We need to be able to see a small, reproducible example of code that illustrates your question. It sounds like you might be looking for ?replicate. On 08/05/2010 03:47 AM, Turn & Fall wrote: I have some code

Re: [R] offlist comment Re: KS Test question (2)

2010-08-05 Thread Stuart Luppescu
On 木, 2010-08-05 at 07:32 -0400, David Winsemius wrote: > I do no > see where that is "posting cheeky R code". I saw it as trying to be > constructive. Using it would only be part of the recommended actions > to take before posting Ralf B., Dr. Wisemius is one of the most prolific, unselfis

[R] Reshape? I need it?

2010-08-05 Thread spigo
Dear all, I'm new here, I'm starting to learn R (oh my God!!). So, now I'm in panic because I have this situation: TIPO Avariato A 0.05 B 0.09 A 9 B 8 A 9 B 3 and this is what I would like to do: AvariatoA B Avariato0.050.09 Avari

[R] For Loop

2010-08-05 Thread Turn & Fall
I have some code that is working. The code calculates the error from the real vale when it does a run. The error in metres in called errorxy I want to do 10 runs of the code and everytime it does a run I want to an output of the errorxy, so that it can form an array. I am guessing I should u

[R] linear model with similar response predictor

2010-08-05 Thread Giuseppe Amatulli
Hi, can somebody tell me why R is not able to calculate a linear model written in this way? > lm (seq(1:100)~seq(1:100)) Call: lm(formula = seq(1:100) ~ seq(1:100)) Coefficients: (Intercept) 50.5 Warning messages: 1: In model.matrix.default(mt, mf, contrasts) : the response appeared on

[R] colour of label points on a boxplot

2010-08-05 Thread alison waller
Hi all, I have 6 datasets(dataframes Assem_ContigsLen7 through all_ContigsLen12) containing 3 columns (contig_id, contig_length, read_count). Each dataset is composed of 3 types of contigs (assemblies of genomic fragments), 1- all Bacterial fragments, 2 - all Viral fragments, 3 - mixed fragments.

Re: [R] Extracting future and past workday dates

2010-08-05 Thread Henrique Dallazuanna
Try this: n <- 3 w <- as.numeric(format(Sys.Date(), '%w')) fut <- c(Sys.Date() - 0:(n + ifelse(w - n > 6, (w - n) - 6, 0)), Sys.Date() + 1:(n + 1 + ifelse(w + n > 6, (w + n) - 6, 0))) sort(fut[!format(fut, '%w') %in% c(6, 0)]) On Thu, Aug 5, 2010 at 9:09 AM, Sergey Goriatchev wrote:

Re: [R] Extracting future and past workday dates

2010-08-05 Thread Sergey Goriatchev
Thank you David, will check it out, as I use chron and zoo! Regards, Sergey On Thu, Aug 5, 2010 at 14:29, David Winsemius wrote: > > On Aug 5, 2010, at 8:09 AM, Sergey Goriatchev wrote: > >> Hi, Henrique >> >> Thank you for trying, but that is not what I want. You get WEEKdays, I >> need WORKday

Re: [R] Extracting future and past workday dates

2010-08-05 Thread David Winsemius
On Aug 5, 2010, at 8:09 AM, Sergey Goriatchev wrote: Hi, Henrique Thank you for trying, but that is not what I want. You get WEEKdays, I need WORKdays, and preferably sorted in order from future to the past. Perhaps you would be pleased to know that there is an is.holiday function in chron

Re: [R] Extracting future and past workday dates

2010-08-05 Thread Sergey Goriatchev
Hi, Henrique Thank you for trying, but that is not what I want. You get WEEKdays, I need WORKdays, and preferably sorted in order from future to the past. Best, Sergey On Thu, Aug 5, 2010 at 14:06, Henrique Dallazuanna wrote: > Try this: > > c(Sys.Date() + 0:3, Sys.Date() - 0:3) > > or > > 0:3

[R] multiple comparisons after glm

2010-08-05 Thread ZAUGG Isabelle
Dear list members, I have a question concerning multiple comparisons after using glm. My response variable is days until emergence of an insect species. The explanatory variables are sex (two levels), parasitoids added (two levels) and populations (34 levels). I would like to know now which po

  1   2   >