Re: [R] p-values < 2.2e-16 not reported

2010-05-19 Thread Shi, Tao
Will, I'm wondering if you have any insights after looking at the cor.test source code. It seems to be fine to me, as the p value is either calculated by "your first method" or a .C code. ...Tao - Original Message > From: Will Eagle > To: r-help@r-project.org > Sent: Wed, May 19

[R] Re : Re : Nomogram with multiple interactions (package rms)

2010-05-19 Thread Marc Carpentier
Thank you for your responses, but I don't think you're right about the doc... I carefully looked at it before posting and ran the examples, looked in Vanderbilt Biostat doc, and just looked again example(nomogram) : 1st example : categorical*continous : two axes for each sex f <- lrm(y ~ lsp(age,5

[R] Indexing with sparse matrices (SparseM)

2010-05-19 Thread Robin Jeffries
Hello, I'm working with a very large, very sparse X matrix. Let csr.X <- * as.matrix.csr*(X) as described by the SparseM package. The documentation says that "Indexing work just like they do on dense matrices". To me this says that I should be able to perform operations on the rows of csr.X

[R] se from lme

2010-05-19 Thread Meissner, Tony (DWLBC)
Is there a R package that calculates the standard errors of prediction/fit from lme/nlme models? Tschüß Tony Meissner Principal Scientist (Monitoring) Resources Monitoring Group Science, Monitoring and Information Division Department of Water, Land & Biodiversity Conservation "Imagine" © *(ph) (0

Re: [R] Re : Adding column sum to new row in data frame

2010-05-19 Thread Mohan L
On Thu, May 20, 2010 at 10:31 AM, Joshua Wiley wrote: > Dear Mohan, > > First, I would like to modify my code slightly to: > > data <- rbind(data,data.frame(State="Total",t(apply(data[,-1], 2, sum, > na.rm=TRUE > > This actually will add a 7th level to your factor automatically. The > reason

Re: [R] Mixed Effects Model on Within-Subjects Design

2010-05-19 Thread David Atkins
Dave-- Given that you want all comparisons among all means in your design, you won't get that directly in a call to lme (or lmer in lme4 package). Take a look at multcomp package and its vignettes, where I think you'll find what you're looking for. cheers, Dave -- Dave Atkins, PhD Research

Re: [R] x y plot with z coordinate scaling to a color value

2010-05-19 Thread Daisy Englert Duursma
Sorry, that should be qplot(x,y,data=yourdataset, colour= z) On Thu, May 20, 2010 at 3:07 PM, Daisy Englert Duursma wrote: > the package ggplot2 makes it really really easy! > > qplot(x,y,data=yourdataset, colour= color) > -- Daisy Englert Duursma Room E8C156 Dept. Biological Sciences Macqua

Re: [R] x y plot with z coordinate scaling to a color value

2010-05-19 Thread Daisy Englert Duursma
the package ggplot2 makes it really really easy! qplot(x,y,data=yourdataset, colour= color) __ 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 an

Re: [R] Re : Adding column sum to new row in data frame

2010-05-19 Thread Joshua Wiley
Dear Mohan, First, I would like to modify my code slightly to: data <- rbind(data,data.frame(State="Total",t(apply(data[,-1], 2, sum, na.rm=TRUE This actually will add a 7th level to your factor automatically. The reason I wanted to change from using c() to data.frame() is that if one uses

Re: [R] multiple 2 by 2 crosstabulations?

2010-05-19 Thread David Winsemius
On May 19, 2010, at 9:10 PM, Biau David wrote: Hello, I have a dataframe (var_1, var_2, ..., var_n) and I would like to export summary statistics to Latex in the form of a table. I want specific summary statistics by crossing numerous variables 2x2 AT ONCE. In each cell I would like some

[R] moving the x-axis in ggplot

2010-05-19 Thread Liam Blanckenberg
Dear all, I was wondering if there is an easy way to set the position of the x-axis in ggplot with respect to where it intercepts the y-axis? The default is for the x-axis to be positioned at the bottom of the chart, but I would like to force it to intercept at y = 0 (I have both positive and nega

Re: [R] Re : Adding column sum to new row in data frame

2010-05-19 Thread David Winsemius
On May 19, 2010, at 11:19 PM, Mohan L wrote: How to safely avoid this warning massage? Now I have instead of "Total" in last row State column. How to I replace it as "Total"? Dear All, The below link provides a very good explanation of "Creating factor variables" and way to avoid the war

Re: [R] sample and rearrange

2010-05-19 Thread Wu Gong
Thank David and Jim. I got it. - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/sample-and-rearrange-tp747p2223872.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] colored venn diagram

2010-05-19 Thread Peter Ehlers
Tao, You might also have a look at the venneuler package. -Peter Ehlers On 2010-05-19 21:37, David Winsemius wrote: On May 19, 2010, at 7:15 PM, Shi, Tao wrote: Hi list, This is probably too much to ask, but I'm wondering if there is a ready-to-use function somewhere that allows me to col

[R] About the breakpoint when making heatmap with lots of variables

2010-05-19 Thread Meng Wu
HI,All I am trying to create a heatmap with 24 samples with 15672 varibles, I read in the table in R, and then made it as a matrix, then try to create the heatmap using heatmap(x,...) However, I received the error message as: > heatmap(t(x)) Error: cannot allocate vector of size 936.8 Mb R(2925,0

Re: [R] Re : Adding column sum to new row in data frame

2010-05-19 Thread Wu Gong
To remove NA instead of Total: rbind(data,cbind(State="Total", t(apply(data[,-1],2,sum - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Re-Adding-column-sum-to-new-row-in-data-frame-tp2223277p2223855.html Sent from the R help mailing list archive at Nabb

[R] multiple 2 by 2 crosstabulations?

2010-05-19 Thread Biau David
Hello, I have a dataframe (var_1, var_2, ..., var_n) and I would like to export summary statistics to Latex in the form of a table. I want specific summary statistics by crossing numerous variables 2x2 AT ONCE. In each cell I would like sometimes to have the median (Q1 - Q3), or frequency and p

Re: [R] Res: Using the zero-inflated binomial in experimental designs

2010-05-19 Thread Ivan Allaman
Hi Ben! Following his recommendations I did the following: 1st step: I compared the best model for binomial and binomial inflates. 1.1 Best model for Binomial. dg$resp.mumi <- cbind(dg$MUMI,dg$NT - dg$MUMI) dg names(dg) mod.mumi.binomial <- glm(resp.mumi ~ factor(PARTO)*REG, family=binomial, da

Re: [R] colored venn diagram

2010-05-19 Thread David Winsemius
On May 19, 2010, at 7:15 PM, Shi, Tao wrote: Hi list, This is probably too much to ask, but I'm wondering if there is a ready-to-use function somewhere that allows me to color one area of a venn diagram (e.g. the intersection of two sets)? There is an intersectDiagrapm in plotrix that

Re: [R] Re : Adding column sum to new row in data frame

2010-05-19 Thread Mohan L
> > > How to safely avoid this warning massage? > Now I have instead of "Total" in last row State column. How to I > replace it as "Total"? > > Dear All, The below link provides a very good explanation of "Creating factor variables" and way to avoid the warning message http://www.ats.ucla.edu/st

[R] Mixed Effects Model on Within-Subjects Design

2010-05-19 Thread Dave Deriso
Dear R Experts, I am attempting to run a mixed effects model on a within-subjects repeated measures design, but I am unsure if I am doing it properly. I was hoping that someone would be able to offer some guidance. There are 5 independent variables (subject, condition, difficulty, repetition) and

Re: [R] x y plot with z coordinate scaling to a color value

2010-05-19 Thread Felix Andrews
And made slightly easier with panel.levelplot.points from latticeExtra: http://latticeextra.r-forge.r-project.org/#panel.levelplot.points On 19 May 2010 22:24, baptiste auguie wrote: > Hi, > > See also ?lattice::xyplot and ?ggplot2::geom_point , either one can do > it automatically. > > HTH, > >

Re: [R] Re : Adding column sum to new row in data frame

2010-05-19 Thread Mohan L
Hi Joshua, > > > > rbind(data, c("Total",apply(data[,-1], 2, sum, na.rm=TRUE))) > Yes. This what exactly I want. Thanks for your time. > > If your State column is a factor, it will return a warning that NAs > were introduced (but the totals will still be at the bottom). > Yes. > is.factor(data

Re: [R] regex help: splitting strings with no separator

2010-05-19 Thread Gabor Grothendieck
One way is to use strapply in the gsubfn package. It is like apply in that the first argument is the object (in both cases), the second is the modifier (the margin in the case of apply and the regular expression in the case of strapply) and a function (in both cases). The parenthesized expressions

Re: [R] sample and rearrange

2010-05-19 Thread jim holtman
you just need the function name; the parameter is being supplied by the lapply: t(apply(x, 1, rearrange)) On Wed, May 19, 2010 at 7:47 PM, Wu Gong wrote: > > I tried to use a separate function to make the code more understandable. But > I failed. I don't know what's wrong with the code. > > x <

Re: [R] sample and rearrange

2010-05-19 Thread David Winsemius
On May 19, 2010, at 7:47 PM, Wu Gong wrote: I tried to use a separate function to make the code more understandable. But I failed. I don't know what's wrong with the code. x <- as.matrix(x) rearrange <- function(.row){ z <- do.call(rbind, strsplit(.row[-1], '')) z.col <- t

Re: [R] sample and rearrange

2010-05-19 Thread Wu Gong
I tried to use a separate function to make the code more understandable. But I failed. I don't know what's wrong with the code. x <- as.matrix(x) rearrange <- function(.row){ z <- do.call(rbind, strsplit(.row[-1], '')) z.col <- t(apply(z, 2, paste, collapse='')) cbind(.ro

Re: [R] regex help: splitting strings with no separator

2010-05-19 Thread Henrique Dallazuanna
Try this: read.table(textConnection(gsub("([[:alpha:]])(\\d.*)", "\\1;\\2", x)), sep = ";") or do.call(rbind, strsplit(gsub("([[:alpha:]])(\\d.*)", "\\1;\\2", x), ";")) On Wed, May 19, 2010 at 9:15 PM, Krishna Tateneni wrote: > Greetings, > > I have a vector of values that are a word followed

Re: [R] regex help: splitting strings with no separator

2010-05-19 Thread Jorge Ivan Velez
Hi Krishna, Here is a suggestion: > x <- c("Apple12","HP42","Dell91") > foo <- function(x) data.frame(brand = gsub("[0-9]", "", x), number = gsub("[^0-9]", "", x)) > foo(x) # brand number # 1 Apple 12 # 2HP 42 # 3 Dell 91 HTH, Jorge On Wed, May 19, 2010 at 8:15 PM, Krishna Tat

[R] regex help: splitting strings with no separator

2010-05-19 Thread Krishna Tateneni
Greetings, I have a vector of values that are a word followed by a number, e.g., x = c("Apple12","HP42","Dell91"). The goal is to split this vector into two vectors such that the first vector contains just the words and the second contains just the numbers. I cannot use strsplit (or at least I d

[R] Multiclass SVM

2010-05-19 Thread Xiyan Lon
I am learning classification using SVM for research (survey). The data that I have had some class. I know that the library (e1071) can only handle multiclass with one-against-one-method. I want to know are there any other functions or library which can handle multiclass methods like: - multiclass S

Re: [R] Error in untar2(tarfile, files, list , exdir) : unsupported entry type ‘x’

2010-05-19 Thread Christopher Bare
Hi, I'm starting to think this is a Mac OS X Snow Leopard specific issue. The GNU docs on the tar format say the type flag 'x' means this: #define XHDTYPE 'x'/* Extended header referring to the next file in the archive */ Maybe, OSX is putting some

[R] colored venn diagram

2010-05-19 Thread Shi, Tao
Hi list, This is probably too much to ask, but I'm wondering if there is a ready-to-use function somewhere that allows me to color one area of a venn diagram (e.g. the intersection of two sets)? Thanks! ...Tao __ R-help@r-project.org mailing list ht

Re: [R] Re : Nomogram with multiple interactions (package rms)

2010-05-19 Thread Frank E Harrell Jr
On 05/19/2010 04:36 PM, Marc Carpentier wrote: I'm sorry. I don't understand the "omit" solution, and maybe I mislead you with my explanation. With the data from the "f" exemple of nomogram() : Let's declare : f2<- cph(Surv(d.time,death) ~ sex*(age+blood.pressure)) I guess the best (and maybe t

[R] Reading in and writing out one line at a time

2010-05-19 Thread sedm1000
I hope that somebody can help me with this - I think very simple - issue...? I am running a package that only accepts one line at a time, but I would like to run this package on a dataframe of >500 lines. Dataframe "d" is a single column: APPLES PEARS AUBERGINES KUMQUATS I would like to read

Re: [R] p-values < 2.2e-16 not reported

2010-05-19 Thread Will Eagle
Dear all, thanks for your feedback so far. With the help of a colleague I think I found the solution to my problem: > pt(10,100,lower=FALSE) [1] 4.950844e-17 IS *NOT* EQUAL TO > 1-pt(10,100,lower=TRUE) [1] 0 This means that R is capable of providing p-values < 2.2e-16, however, if the valu

Re: [R] printing a dataframe by categories

2010-05-19 Thread Henrique Dallazuanna
Try this: by(x, x$Form, function(.x)rbind(.x[-3], sum(.x[2]))) On Wed, May 19, 2010 at 6:49 PM, Gerrit Draisma wrote: > I am looking for the following simple question. > I have a data frame with names and numbers, divided in categories. > I would like to produce a text file with page breaks, > l

Re: [R] sample and rearrange

2010-05-19 Thread David Winsemius
On May 19, 2010, at 5:01 PM, Wu Gong wrote: It took me a day to make the sense of Jim's code :( Hope my comments will help. ## Transform data to matrix x <- as.matrix(x) ## Apply function to each row ## Create a function to rearrange bases result <- apply(x, 1, function(eachrow){ ## Split

[R] Using svychisq inside user-defined function

2010-05-19 Thread Sabatier, Jennifer F. (CDC/OID/NCHHSTP)
Hi R-help, Yes, this is my second request for assistance in a single day I am attempting to use svychisq() inside a function I made. The goal of this function is to produce a table of summary statistics that I can later output to EXCEL (simple frequencies and sample sizes from regular cross

[R] printing a dataframe by categories

2010-05-19 Thread Gerrit Draisma
I am looking for the following simple question. I have a data frame with names and numbers, divided in categories. I would like to produce a text file with page breaks, listing the names and numbers by category, and totalling the numbers. Example: Name<-LETTERS[1:6] Score<-rep(5:8,length.out

Re: [R] Generating all possible models from full model

2010-05-19 Thread Tim Clark
Thanks to everyone for the replies and functions.  For some reason my emails are not going to the thread.  I just switched to the newer mail version for my yahoo account, so hopefully this one will get posted. Aloha, Tim  Tim Clark Department of Zoology University of Hawaii - Original

Re: [R] sample and rearrange

2010-05-19 Thread Wu Gong
It took me a day to make the sense of Jim's code :( Hope my comments will help. ## Transform data to matrix x <- as.matrix(x) ## Apply function to each row ## Create a function to rearrange bases result <- apply(x, 1, function(eachrow){ ## Split each gene to bases ## Exclude the fist column wh

Re: [R] Strange case of partial matching in .[ - possible bug / wrong documentation?

2010-05-19 Thread Hilmar Berger
Duncan Murdoch schrieb: On 19/05/2010 12:14 PM, Hilmar Berger wrote: Hi all, This occurred in R-2.11.0 (WinXP). The R-help page of .[ says that: "Character indices can in some circumstances be partially matched (see pmatch) to the names or dimnames of the object being subsetted (but never

[R] Looping input and multiple outputs

2010-05-19 Thread danob321
I'm quite new to this - and would appreciate some help getting started... I am looking to feed data from dataframe A, one line at a time into an input frame to the program, and then save the output into a different dataframe. input frame - one column: ABCDEFTATF AHFUTJRAUUFS TITIAJFSUDFJA TIDUS

[R] Re : Nomogram with multiple interactions (package rms)

2010-05-19 Thread Marc Carpentier
I'm sorry. I don't understand the "omit" solution, and maybe I mislead you with my explanation. With the data from the "f" exemple of nomogram() : Let's declare : f2 <- cph(Surv(d.time,death) ~ sex*(age+blood.pressure)) I guess the best (and maybe the only) way to represent it with a nomogram is

Re: [R] Multiple language output - Correct in RGui, wrong in .txt after sink()

2010-05-19 Thread Prof Brian Ripley
You haven't given us the 'at a minimum' information asked for in the the posting guide (but we can guess you are using Windows), nor do we know the intended encoding of this email (I see no encoding in the header as it reached me, but it seems sensible viewed as UTF-8). And the absence of basic

Re: [R] export dataframe's column classes to a list

2010-05-19 Thread Alexander Shenkin
It does indeed! thank you very much, and thanks to mark leeds as well, who emailed me off list with a similar solution. On 5/19/2010 3:49 PM, Peter Alspach wrote: > Tena koe Allie > > Does > > sapply(myframe, class) > > do what you want? > > Peter Alspach > > >> -Original Message- >> F

Re: [R] export dataframe's column classes to a list

2010-05-19 Thread Peter Alspach
Tena koe Allie Does sapply(myframe, class) do what you want? Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Alexander Shenkin > Sent: Thursday, 20 May 2010 8:19 a.m. > To: r-help@r-project.org > Subject: [R]

Re: [R] offset in gam and spatial scale of variables

2010-05-19 Thread Joris Meys
On Wed, May 19, 2010 at 4:51 PM, Lucia Rueda wrote: > > Hi Joris, > > We're using mgcv. > > We have data on abundance of groupers on line transects that have the same > length. I only now realized groupers are actually fish :-). Should work on my english skills... > My coworker has selected a

Re: [R] Generating all possible models from full model

2010-05-19 Thread Daniel Malter
Hi, one approach is document below. The function should work with any regression function that follows the syntax of lm (others will need adjustments). Note that you would have to create the interactions terms by hand (which is no big deal if there are just few). Note also that this approach can b

Re: [R] Nomogram with multiple interactions (package rms)

2010-05-19 Thread Frank E Harrell Jr
On 05/19/2010 03:17 PM, Marc Carpentier wrote: Dear list, I'm facing the following problem : A cox model with my sex variable interacting with several continuous variables : cph(S~sex*(x1+x2+x3)) And I'd like to make a nomogram. I know it's a bit tricky and one mights argue that nomogram is not a

Re: [R] col allocation is not right

2010-05-19 Thread Changbin Du
Thanks, Phil! Does that mean only eight colors can be used in R plot? THe following codes works for me, but, if I use the number, it does not work. plot(svm.auc, col=2, main="ROC curves comparing classification performance\n of six machine learning models") legend(0.5, 0.6, c(ns, nb, nr, nt, nl,n

Re: [R] save in for loop

2010-05-19 Thread Peter Ehlers
On 2010-05-19 12:05, Shi, Tao wrote: Ivan, Try this: eval(parse(text=paste("save(file", i, ", file=\"file", i, ".RData\")", sep=""))) ...Tao Or just use 'list=' like this: for (i in 1:4) { temp <- data.frame(a=(i+1):(i+10), b=LETTERS[(i+1):(i+10)]) filename <- paste("file", i, sep="")

[R] export dataframe's column classes to a list

2010-05-19 Thread Alexander Shenkin
Hi Folks, I want to export a dataframe's column classes to a list so that I can reinstantiate the dataframe from a CSV file in the future. (I know about save(), which I'm using in addition to this). what I want to do is the following: write.csv(myframe); col_classes = get_col_classes(myf

[R] Nomogram with multiple interactions (package rms)

2010-05-19 Thread Marc Carpentier
Dear list, I'm facing the following problem : A cox model with my sex variable interacting with several continuous variables : cph(S~sex*(x1+x2+x3)) And I'd like to make a nomogram. I know it's a bit tricky and one mights argue that nomogram is not a good a choice... I could use the parameter int

[R] Error in untar2(tarfile, files, list , exdir) : unsupported entry type ‘x’

2010-05-19 Thread Christopher Bare
Hi R gurus, I'm getting the following error when trying to build and install an R package: Error in untar2(tarfile, files, list, exdir) : unsupported entry type ‘x’ I build the package like so: R --no-init-file CMD build mypackage Then try to install it: sudo R --no-init-file CMD INSTALL mypack

Re: [R] Strange case of partial matching in .[ - possible bug / wrong documentation?

2010-05-19 Thread David Winsemius
On May 19, 2010, at 12:14 PM, Hilmar Berger wrote: Hi all, This occurred in R-2.11.0 (WinXP). The R-help page of .[ says that: "Character indices can in some circumstances be partially matched (see pmatch) to the names or dimnames of the object being subsetted (but never for subassignment

Re: [R] Strange case of partial matching in .[ - possible bug / wrong documentation?

2010-05-19 Thread Duncan Murdoch
On 19/05/2010 12:14 PM, Hilmar Berger wrote: Hi all, This occurred in R-2.11.0 (WinXP). The R-help page of .[ says that: "Character indices can in some circumstances be partially matched (see pmatch) to the names or dimnames of the object being subsetted (but never for subassignment). Unlike S

Re: [R] Regarding the 'R' Load Command

2010-05-19 Thread Gavin Simpson
On Wed, 2010-05-19 at 14:59 -0400, Godavarthi, Murali wrote: > Hi Gavin, Steve > > Sorry, please use the below dput for mytestdata. Thanks!! No need. The issue I think issue is due to the number of levels in the factor. IIRC correctly, I've been bitten by this before where the newdata object cont

Re: [R] Generating all possible models from full model

2010-05-19 Thread Frank E Harrell Jr
On 05/19/2010 01:39 PM, Ben Bolker wrote: Frank E Harrell Jr Vanderbilt.Edu> writes: Please read the large number of notes in the e-mail archive about the invalidity of such modeling procedures. Frank I'm curious: do you have an objection to multi-model averaging a la Burnham, Anderso

Re: [R] Object of type 'closure' not subsettable in GROFIT

2010-05-19 Thread Duncan Murdoch
On 19/05/2010 10:34 AM, trubilar wrote: Hello Everyone, I am quite new in R software. I am doing a grofit to study growth. I have a matrix of time with 10 weeks and 26 individuals ie 10 columns x 26 rows and I have a data.frame with 3 columns: 1 for Individual Id (which repeats it self, since I h

Re: [R] offset in gam and spatial scale of variables

2010-05-19 Thread Joris Meys
Thank you for the correction. I was thinking about the difference of using a variable with a smoother, and comparing that to a model with that variable without smoother. I should specify that I mostly use thin plate regression splines. If the spline itself is not deviating from linearity, you get

Re: [R] Generating all possible models from full model

2010-05-19 Thread Xiaogang Su
A couple of years ago, I wrote a function for doing this. It can be found in the following file: http://pegasus.cc.ucf.edu/~xsu/CLASS/STA4164/mt4-2009.doc I also pasted a copy below. Hope you find it useful. -XG # # ALL POSSIBLE REGRESSIONS # # Th

Re: [R] Displaying smooth bases - mgcv package

2010-05-19 Thread Joris Meys
Dear Simon, Thank you very much! A colleague of mine directed me towards the extract.lmeDesign function of the RLRsim package, but that only gets me the basis functions in function of the model I specified. Your solution is what I was looking for. Kind regards Joris Just for completeness : This

Re: [R] Regarding the 'R' Load Command

2010-05-19 Thread Godavarthi, Murali
Hi Gavin, Steve Sorry, please use the below dput for mytestdata. Thanks!! structure(list(imurder = 0, itheft = 0, irobbery = 0, iassault = 1, idrug = 0, iburglary = 0, igun = 0, psych = 0, Freq = 0, priors = 58, firstage = 19, intage = 19, sex = structure(1, .Label = "1", class = "factor"), r

Re: [R] Generating all possible models from full model

2010-05-19 Thread Tal Galili
Hi Tim, Here is a rather clumsy way of going about your task: # -- example code - func.getY.getX.return.lm <- function(Y, X.matrix , lm.id.vec) { # gets a Y, a vec of T/F and a X.matrix # performs lm # and returns output potential.X.size <- length(lm.id.vec) + 1 lm.data <- data

[R] Categorical variables in estimating propensity score

2010-05-19 Thread Qian Zhang
Hello, I am looking to generate propensity score in R using ps() command. My question comes from how to include categorical variables in the equation to generate propensity score. How should I include reference category in the estimation? Should I drop the reference group manually before running t

Re: [R] Regarding the 'R' Load Command

2010-05-19 Thread Godavarthi, Murali
Hi Steve, Thanks so much for your inputs! I was actually trying to implement your suggestions, I get the below error (please see the results of predict command below). What we are trying to do is to feed in values for about 23 characteristics of an individual, and use the randomForest() function

Re: [R] Regarding the 'R' Load Command

2010-05-19 Thread Godavarthi, Murali
Hi Steve, Gavin This is being really helpful. I've pasted the working data, and my test data below after running the str command on both of those variables. The working sample actually contains about 300 records, hence I am not able to paste the whole data here. However my sample test data which I

Re: [R] contrasts for lmer model

2010-05-19 Thread Max Kuhn
Basically, I haven't gotten around to adding a contrast.lmer methods yet. It's only my list, but in the short term, you are welcome to contribute code to the package. There have also been discussions on this list about the appropriateness of such contrats with nonlinear models, but I need to imple

[R] Strange case of partial matching in .[ - possible bug / wrong documentation?

2010-05-19 Thread Hilmar Berger
Hi all, This occurred in R-2.11.0 (WinXP). The R-help page of .[ says that: "Character indices can in some circumstances be partially matched (see pmatch) to the names or dimnames of the object being subsetted (but never for subassignment). Unlike S (Becker et al p. 358)), R has never used parti

[R] Object of type 'closure' not subsettable in GROFIT

2010-05-19 Thread trubilar
Hello Everyone, I am quite new in R software. I am doing a grofit to study growth. I have a matrix of time with 10 weeks and 26 individuals ie 10 columns x 26 rows and I have a data.frame with 3 columns: 1 for Individual Id (which repeats it self, since I have 10 values for each individual correpo

Re: [R] offset in gam and spatial scale of variables

2010-05-19 Thread Lucia Rueda
Hi Joris, We're using mgcv. We have data on abundance of groupers on line transects that have the same legth. My coworker has selected a bunch of variables and he has calculated them in terms of total area in different sizes of buffers around the centroid of the transect. He has run gam models

[R] Help Preparing Data for Heatmap creation

2010-05-19 Thread Derek Dees
All - Below are samples of the data, a description of my approach and the work I've done so far. My goal is two-fold, first learn more about R and the creation of heatmaps; second, to create a heat map where the vertical access is a series of days and the horizontal is the hour of a day with the c

Re: [R] Joining two (or more) frequency tables

2010-05-19 Thread Wu Gong
> ## Create a sample data. > data <- data.frame(father.id = letters[1:5], + diagnosis = sample(c(100,200,300,340),5,replace=TRUE), + diagnosis1 = sample(c(100,200,300,340),5,replace=TRUE), + diagnosis2 = sample(c(100,200,300,340),5,replace=TRUE)) > data father.id diagnosis diagnosis1 diagnosis2

Re: [R] Displaying smooth bases - mgcv package

2010-05-19 Thread Simon Wood
On Wednesday 19 May 2010 15:08, Joris Meys wrote: > Dear all, > > for demonstration purposes I want to display the basis functions used by a > thin plate regression spline in a gamm model. I've been searching the help > files, but I can't really figure out how to get the plots of the basis > func

Re: [R] Generating all possible models from full model

2010-05-19 Thread Ben Bolker
Frank E Harrell Jr Vanderbilt.Edu> writes: > > Please read the large number of notes in the e-mail archive about the > invalidity of such modeling procedures. > > Frank > I'm curious: do you have an objection to multi-model averaging a la Burnham, Anderson, and White (as implemented in the

Re: [R] save in for loop

2010-05-19 Thread Jorge Ivan Velez
Hi Ivan, How about this? i <- 1:4 sapply(i, function(i){ x <- data.frame(a=(i+1):(i+10), b=LETTERS[(i+1):(i+10)]) save(x, file = paste("file", i, ".rda", sep="")) } ) HTH, Jorge On Wed, May 19, 2010 at 10:56 AM, Ivan Calandra <> wrote: > Dear users, > > My problem concerns save() within a f

Re: [R] offset in gam and spatial scale of variables

2010-05-19 Thread Simon Wood
> We are analizing the relationship between the abundance of groupers in line > transects and some variables. We are using the quasipoisson distribution. > Do we need to include the length of the transects as an offset if they all > have the same length?? --- not just for fitting, I suppose: altho

Re: [R] col allocation is not right

2010-05-19 Thread Phil Spector
Changbin - Please take a look at the help file for the function "palette", which is how R maps col= numbers to colors. Also look at the default output of that function: palette() [1] "black" "red" "green3" "blue""cyan""magenta" "yellow" [8] "gray" You might get better result

Re: [R] offset in gam and spatial scale of variables

2010-05-19 Thread Simon Wood
On Wednesday 19 May 2010 15:29, Joris Meys wrote: > Could you specify the package you use? If it is mgcv, this one centers your > variables before applying the smooths. That's something to take into > account when comparing different models. --- er, actually it only centres variables in this way fo

[R] col allocation is not right

2010-05-19 Thread Changbin Du
plot(svm.auc, col=2, main="ROC curves comparing classification performance\n of six machine learning models") legend(0.5, 0.6, c(ns, nb, nr, nt, nl,ne), 2:6, 9) # Draw a legend. plot(bo.auc, col=3, add=T) # add=TRUE draws on the existing chart plot(rf.auc, col=4, add=T) plot(tree.auc, col=5, add=T

Re: [R] Re : Adding column sum to new row in data frame

2010-05-19 Thread Joshua Wiley
Dear Mohan, Is this what you want? rbind(data, c("Total",apply(data[,-1], 2, sum, na.rm=TRUE))) If your State column is a factor, it will return a warning that NAs were introduced (but the totals will still be at the bottom). If State is class character, then that row will have a name "Total" a

Re: [R] Blanking out specific cells in a data frame

2010-05-19 Thread Stefan Grosse
Am 19.05.2010 20:08, schrieb Sabatier, Jennifer F. (CDC/OID/NCHHSTP): I do know that you can't actually have unequal column lengths. The reality is I am creating a pretty table to export to EXCEL and it Now that I have Stefan's solution, which turns all the un-needed info into NAs I can use NAT

Re: [R] Blanking out specific cells in a data frame

2010-05-19 Thread Sabatier, Jennifer F. (CDC/OID/NCHHSTP)
Hi Ista, Thanks a lot for your response. It looks like the solution Stefan suggested is the same as you are and it works great. I do know that you can't actually have unequal column lengths. The reality is I am creating a pretty table to export to EXCEL and it contains some summary statistics

Re: [R] save in for loop

2010-05-19 Thread Shi, Tao
Ivan, Try this: eval(parse(text=paste("save(file", i, ", file=\"file", i, ".RData\")", sep=""))) ...Tao - Original Message > From: Ivan Calandra > To: r-help@r-project.org > Sent: Wed, May 19, 2010 7:56:44 AM > Subject: [R] save in for loop > > Dear users, My problem concerns sav

Re: [R] Blanking out specific cells in a data frame

2010-05-19 Thread Sabatier, Jennifer F. (CDC/OID/NCHHSTP)
SWEET! That's EXACTLY what I need. Thanks! I can now just use NAToUnknown to turn the NA into blanks. Thanks a lot! Jen -Original Message- From: Stefan Grosse [mailto:singularit...@gmx.net] Sent: Wednesday, May 19, 2010 1:53 PM To: r-help@r-project.org; Sabatier, Jennifer F. (CDC/OI

Re: [R] Blanking out specific cells in a data frame

2010-05-19 Thread Ista Zahn
Hi Jen, You cannot have a dataframe with unequal column lengths, so you have two options (well maybe more, but two that come to mind): set the values to missing instead of deleting them, or store your data in a list instead of a data frame. For option 1 (recommended) all you need is mydf[-1, 6]

Re: [R] Blanking out specific cells in a data frame

2010-05-19 Thread Stefan Grosse
Am 19.05.2010 19:36, schrieb Sabatier, Jennifer F. (CDC/OID/NCHHSTP): mydf<-data.frame(matrix(rnorm(102), ncol=6) you mean something like: mydf[2:length(mydf[,1]),6]<-NA hth Stefan __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] Re : Adding column sum to new row in data frame

2010-05-19 Thread Mohan L
Dear All, I have data some thing like this: State Jan Feb Mar Apr May Jun AAA 1 1 0 2 2 0 BBB 1298 1195 1212 1244 1158 845 CCC 0 0 0 1 2 1 DDD 5 11 17 15 10 9 EEE 18 28 27 23 23 16 FFF 68 152 184 135 111 86 I want to sum all the column(Jan, Feb, Mar ...) and have to merge the total at

[R] Blanking out specific cells in a data frame

2010-05-19 Thread Sabatier, Jennifer F. (CDC/OID/NCHHSTP)
Hi R-Help, I am a new R user. I have used SAS for many years (just FYI on what I am used to and possible obstacles it presents). I have a data frame: mydf <-data.frame(matrix(rnorm(102), ncol=6) I would like to be able to delete ALL the information in column 6 for rows 2 through r, where r=#ro

Re: [R] lattice: How to specify strip text in an xyplot?

2010-05-19 Thread Peter Ehlers
On 2010-05-19 9:02, Marius Hofert wrote: Hi, How can I specify the strip text in the xyplot below? I also tried to work with strip.names=c("TRUE","TRUE"), but that did not work. Cheers, Marius library(lattice) x<- 1:10 y<- cbind(1:10,-(1:10)) xyplot(y[,1]+y[,2]~x,outer=TRUE,strip=function(va

Re: [R] Regarding the 'R' Load Command

2010-05-19 Thread Gavin Simpson
I think the answer is clear from the error: R thinks the type of data in the components of 'testmurali' do not match those of the data used to fit the original randomForest. The OP should go back to his model fitting code and do str(obj) where 'obj' is the name of his original data object used t

Re: [R] automate curve drawing on nls() object

2010-05-19 Thread array chip
I do know it, but wanted to spend a little more effort to make generalized function for this type of plot. Thanks --- On Tue, 5/18/10, Shi, Tao wrote: > From: Shi, Tao > Subject: Re: [R] automate curve drawing on nls() object > To: "array chip" , r-help@r-project.org > Date: Tuesday, May 18,

[R] useR!, regular registration deadline today

2010-05-19 Thread Katharine Mullen
This is a reminder that the regular registration deadline for the useR! 2010 conference, July 21-23 (http://www.R-project.org/useR-2010) is today. After today, late registration will be possible until June 20th. The link to submit registration information is: http://www.R-project.org/useR-2010/reg

Re: [R] Calling R-tists

2010-05-19 Thread Tal Galili
Hi Katharine, Very cool idea! I republished your call on my blog: http://www.r-statistics.com/2010/05/user-2010-is-looking-for-a-t-shirt-design/ And encourage people who will create such a design to link to it (for example by posting about it here on the list), and also to tag it (if they put it o

[R] Multiple language output - Correct in RGui, wrong in .txt after sink()

2010-05-19 Thread mark . redshaw
I have the following problem with outputting multilingual data to a file. I get (except for Korean) what I expect as result in the RGui, but when I use sink() to output to a text file loose the characters in the foreign languages. I post a small example below. Since I am not sure how well my ema

Re: [R] How to plot the sample size on top of the bars of a barchart plot?

2010-05-19 Thread Greg Snow
Yes, and many of us also know why doing so is a bad idea. This has been discussed before, if you search the archives you can find the full discussion showing how, why not, and better approaches. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.o

Re: [R] Regarding the 'R' Load Command

2010-05-19 Thread Steve Lianoglou
Hi Murali, I'm sorry, but you're making this too difficult to provide any help. Describing what your data structures are and contain is too tedious to follow, and end up being rather ambiguous anyway. My first guess: by your error message, perhaps the columns of the data to predict on are differe

Re: [R] Where is the construction of a dist object from raw data described?

2010-05-19 Thread Gavin Simpson
On Wed, 2010-05-19 at 10:10 -0400, Steven Lembark wrote: > Any reference to the appropriate documentation would > be most appreciated. > > I am using the TSP module for clustering of HIV > genetic sequences. The distances have already been > computed and available as either upper-triangular > or s

  1   2   >