Re: [R] Problem on glmer

2011-05-17 Thread Dennis Murphy
Hi: I believe that the problem with the glmer() call is that you are invoking the Gamma family, which appears not to be implemented at present. See http://r-project.markmail.org/search/?q=r-sig-mixed-models#query:r-sig-mixed-models%20date%3A201105%20+page:8+mid:q2b2uoupejdzmvtl+state:results Den

[R] gsub() issue...

2011-05-17 Thread Thibault Charles
Hello R helpers, I get a problem using gsub() function. I have the following text : text <- ‘’ INFILTRATION INF_BASE AIRCHANGE=1 ‘’ Then my code is : original <- "INFILTRATION INF_BASE \n AIRCHANGE=1" replace <- "INFILTRATION INF_BASE \n AIRCHANGE=3" new_texte <- gsub

[R] simprof test using jaccard distance

2011-05-17 Thread Maia.Berman
Dear All, I would like to use the simprof function (clustsig package) but the available distances do not include Jaccard distance, which is the most appropriate for pres/abs community data. Here is the core of the function: > simprof function (data, num.expected = 1000, num.simulated = 999, metho

Re: [R] Zero counts in an aggregate function

2011-05-17 Thread noellejm
On Mon, May 16, 2011 at 11:56 PM, Jorge Ivan Velez wrote: Hi Noelle, Try using count2 <- function(x) sum(x == 0) or, for all at once (untested), foo <- function(x) c( alive = sum(x == 1), dead = sum(x == 0)) with(bugs, tapply(SURVIVE, FRUIT, foo)) HTH, Jor

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread Bryony Tolhurst
Dear Bill Many thanks. I will try this. One question: why is the attach()function problematic? I have always done it that way (well in my very limited R-using capacity!) as dictated by 'Statistics, an Introduction using R' by Michael Crawley. My dataset is called Side ('Side.txt') so how do I

Re: [R] gsub() issue...

2011-05-17 Thread Sebastian Gibb
Hello Thibault Charles, > I have the following text : > text <- ‘’ INFILTRATION INF_BASE > > AIRCHANGE=1 ‘’ becomes: text <- "INFILTRATION INF_BASE\nAIRCHANGE=1" > original <- "INFILTRATION INF_BASE \n AIRCHANGE=1" There are spaces around "\n". That's why text != original Try original <- "INFI

Re: [R] Dealing with null values Aggregate function

2011-05-17 Thread Jannis
Andy, have a look at ?mean. The na.omit argument set to TRUE should solve your problem. The use in aggregate would be something like: aggregate(x = testDF, by = list(testDF$v3), FUN = function(x) mean(x,na.rm=TRUE)) HTH Jannis On 05/17/2011 04:27 AM, Andrew McFadden wrote: Hi R users

Re: [R] Linear Discriminant Analysis error: "Variables appear constant"

2011-05-17 Thread Uwe Ligges
On 16.05.2011 22:07, Songer, Katherine B - DNR wrote: Hi R experts, I'm attempting to run Linear Discriminant Analysis using the lda function in the MASS package. I've got around 50 predictor variables and one response variable. My response variable has 5 numeric categories that represent d

Re: [R] gsub() issue...

2011-05-17 Thread Thibault Charles
Hello, Thanks but it doesn't work and I cannot understand why... Thibault Charles Solamen Audencia - 8 route de la Jonelière 44300 Nantes +33 2 40 37 46 76 -Message d'origine- De : r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] De la part de Sebastian Gibb Envoyé : ma

Re: [R] pam() clustering for large data sets

2011-05-17 Thread Christian Hennig
Dear Lilia, I'm not sure whether this is particularly helpful in your situation, but sometimes it is possible to emulate the same (or approximately the same) distance measure as Euclidean distance between points that are somehow rescaled and retransformed. In this case, you can rescale and re

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread Timothy Bates
Dear Bryony: the suggestion was not to change the name of the data object, but to explicitly tell glm.nb what dataset it should look in to find the variables you mention in the formula. so the salient difference is: m1 <- glm.nb(Cells ~ Cryogel*Day, data = side) instead of attach(side) m1 <-

[R] Help fit 5 nonlinear models. - Plant growth curves

2011-05-17 Thread Alejandro Coca Castro
Hi!! Can anyone help me, i have problems to converge the following data with 5 nonlinears models that i evaluated. Firtly, i send my data (totalsinatipicos) that i just try to fit with the nonlinear models. Next, i have the following script where i called the data as totalsinatipicos. I made self

[R] Hi! Help using FitARMA package in RExcel

2011-05-17 Thread Cren
Hi all :) Before posting, I used the "search" function to find a solution, but I wasn't lucky. I'm using RExcel; I've read several examples which explain how to call in RExcel an R function via =RApply(...) but I don't understand how may I include in the function several numeric arguments. Take

[R] Smooth contour of a map

2011-05-17 Thread Pierre Bruyer
I'm a French developer (so I am sorry if my english is not perfect). I have a problem to smooth the contours of a map. I have a dataset with 3 columns, x, y and z, where x and y are the coordinates of my points and z is evaluate to a qualitative elevation and his representation is a set of color

[R] Rscript hangs on exit with ubuntu 11.04

2011-05-17 Thread Mikael Högqvist
Hi, I have run into a strange issue with Rscript and plyr. When running the following Rscript: #!/usr/bin/Rscript library(plyr) d = ddply(data.frame(a=1:101,b=1:101), .(a,b), nrow) head(d) the script does not terminate. It prints out the results from head(d), but does not return to the shell. By

Re: [R] gsub() issue...

2011-05-17 Thread David Winsemius
The backslashes in the patt argument need to be doubled since "\" is a special regex character. Or it may work to set fixed =TRUE. Either: original <- "INFILTRATION INF_BASE \\n AIRCHANGE=1" replace <- "INFILTRATION INF_BASE \n AIRCHANGE=3" new_texte <- gsub(patt=original,replace,text) Or:

Re: [R] Smooth contour of a map

2011-05-17 Thread Duncan Murdoch
On 11-05-17 5:58 AM, Pierre Bruyer wrote: I'm a French developer (so I am sorry if my english is not perfect). I have a problem to smooth the contours of a map. I have a dataset with 3 columns, x, y and z, where x and y are the coordinates of my points and z is evaluate to a qualitative elevat

[R] epi.2by2

2011-05-17 Thread pcc
This is a really simple question, I'm sure,but I can't make EpiR work! I keep getting the following: > epi.2by2(47, 263483, 282, 935028, method="cohort.time", conf.level=0.95) Error in epi.2by2(47, 263483, 282, 935028, method = "cohort.time", conf.level = 0.95) : unused argument(s) (935028)

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread David Winsemius
On May 17, 2011, at 4:09 AM, Bryony Tolhurst wrote: Dear Bill Many thanks. I will try this. One question: why is the attach()function problematic? I have always done it that way (well in my very limited R-using capacity!) as dictated by 'Statistics, an Introduction using R' by Michael Cra

[R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Vikas Garud
Hi, I am a consultant in Quality Management. I am exploring the use of R with any GUI - R commander/Rkward for doing analytical work. Have installed R, R Commander and Rkward. I hope to learn by doing various exercises that I use for teaching analytical techniques to my clients. I would be pos

Re: [R] Rscript hangs on exit with ubuntu 11.04

2011-05-17 Thread Dirk Eddelbuettel
On 17 May 2011 at 12:18, Mikael Högqvist wrote: | Hi, | | I have run into a strange issue with Rscript and plyr. When running | the following Rscript: | | #!/usr/bin/Rscript | library(plyr) | d = ddply(data.frame(a=1:101,b=1:101), .(a,b), nrow) | head(d) | | the script does not terminate. It pr

Re: [R] Dealing with null values Aggregate function

2011-05-17 Thread Jonathan Daily
Furthermore, aggregate passes extra arguments to FUN, so explicit declaration of na.rm = T can be done in the call to aggregate directly: aggregate(cbind(v1, v2) ~ v3, data = testDF, FUN = mean, na.rm = T) HTH, Jon On Tue, May 17, 2011 at 5:22 AM, Jannis wrote: > Andy, > > > have a look at ?mea

Re: [R] epi.2by2

2011-05-17 Thread peter dalgaard
On May 17, 2011, at 12:57 , pcc wrote: > This is a really simple question, I'm sure,but I can't make EpiR work! > I keep getting the following: > >> epi.2by2(47, 263483, 282, 935028, method="cohort.time", conf.level=0.95) > Error in epi.2by2(47, 263483, 282, 935028, method = "cohort.time", > c

Re: [R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Timothy Bates
something like this will get you going, assuming your data are in a dataframe called “qual” # qual <- read.table(pipe("pbpaste"), header=T, sep='\t') boxplot(formula=Time~Distance+Season, data=qual) Followup question from me: i can’t see why boxplot(formula=Time, data=qual) should return the

Re: [R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Jannis
--- Vikas Garud schrieb am Di, 17.5.2011: > Von: Vikas Garud > Betreff: [R] Box Plot under GUI (R Commander/RKward) > An: r-help@r-project.org > Datum: Dienstag, 17. Mai, 2011 11:31 Uhr > Hi, > > I tried to search the mailing list on box plot, but could > not find > anything relevant.  I have

Re: [R] changes in coxph in "survival" from older version?

2011-05-17 Thread Frank Harrell
The problem is the use of variable selection without simultaneous shrinkage. It will result in an entirely unreliable model and essentially will choose a random sample of the predictors. See http://www.childrensmercy.org/stats/faq/faq12.asp Frank Shi, Tao wrote: > > Hi Frank, > > I know it's k

[R] extract value from mer object ?

2011-05-17 Thread Maas James Dr (MED)
What is the easiest way to extract a value from a 'mer' object from glmer? The first I need is the trtpair Std.Dev. which in this case is 0.17542? I've managed to get the fixed effects numbers from summary(fednmaout)@coeffs but no luck with the Random effects stuff. TIA Jim > fednmaout

Re: [R] Subsetting depth profiles based on maximum depth by group with plyr

2011-05-17 Thread Peter Ehlers
On 2011-05-16 17:14, Sam Albers wrote: Hello, Apologies for a similar earlier post. I didn't include enough details in that one. I am having a little trouble subsetting some data based on a grouping variable. I am using an instrument that does depth profiles of a water column. The instrument re

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread Peter Ehlers
On 2011-05-17 02:22, Timothy Bates wrote: Dear Bryony: the suggestion was not to change the name of the data object, but to explicitly tell glm.nb what dataset it should look in to find the variables you mention in the formula. so the salient difference is: m1<- glm.nb(Cells ~ Cryogel*Day, da

Re: [R] Smooth contour of a map

2011-05-17 Thread Duncan Murdoch
On 17/05/2011 8:24 AM, Pierre Bruyer wrote: Thank you for your answer, but the function spline() (and a lot of other function in R) can't take in its parameters the original contour which are define by a vector, i.e. : If you post some reproducible code to generate the contours, someone wi

Re: [R] changes in coxph in "survival" from older version?

2011-05-17 Thread Terry Therneau
-- begin included message --- I did realize that there are way more predictors in the model. My initial thinking was use that as an initial model for stepwise model selection. Now I wonder if the model selection result is still valid if the initial model didn't even converge? --- end inclusion -

Re: [R] Smooth contour of a map

2011-05-17 Thread Duncan Murdoch
I don't think filled.contour gives you access to the contour lines. If you use contourLines() to compute them, then you can draw them using code like this: contours <- contourLines(V2b,levels=paliers) for (i in seq_along(contours)) { x <- contours[[i]]$x y <- contours[[i]]$y lines(

[R] Minimum value by ID

2011-05-17 Thread Downey, Patrick
Hello, I have a longitudinal dataset where each individual has a different number of entries. Thus, it is of the following structure: x <- runif(12) id.var <- factor(c(rep("D1",4),rep("D2",2),rep("D3",3),rep("D4",3))) dat <- as.data.frame(x) dat$id.var <- id.var dat > dat x id

Re: [R] Linear Discriminant Analysis error: "Variables appear constant"

2011-05-17 Thread Songer, Katherine B - DNR
Uwe, Thank you very much for looking at this. I'm attaching the data, in case you have any wisdom on why variables 10, 38, and 42 would appear constant. Meanwhile, I'll remove colinear variables and read up a little more... Thanks, Katie -Original Message- From: Uwe Ligges [mailto:lig.

[R] scales argument in bwplot (lattice)

2011-05-17 Thread Doran, Harold
Suppose I have data such as the following set.seed(12345) tmp <- data.frame(var1 = rnorm(100), var2 = rnorm(100), var3=rnorm(100, 10, 30)) tmp1 <- data.frame(vars = with(tmp, c(var1, var2, var3)), type = gl(3, 100)) var3 is on a different scale, but I create the following plot, which looks terr

Re: [R] Minimum value by ID

2011-05-17 Thread Dimitris Rizopoulos
have a look at help file of function tapply(), and try this: with(dat, tapply(x, id.var, min)) I hope it helps. Best, Dimitris On 5/17/2011 3:44 PM, Downey, Patrick wrote: Hello, I have a longitudinal dataset where each individual has a different number of entries. Thus, it is of the follo

Re: [R] Inverse autocorrelation fonction

2011-05-17 Thread Jean-Baptiste Lepetit
In fact, my previous post is not correct: you have to replace : acfth <- ARMAacf(ar=numeric(0),ma=artest$ar) by : acfth <- ARMAacf(ar=numeric(0),ma=-artest$ar) Then it coincides exactly the same correlations as SAS The error comes from the equation estimated by the ar() function : "For defini

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread Bert Gunter
Folks: > Only if the user hasn't yet been introduced to the with() function, > which is linked to on the ?attach page. > > Note also this sentence from the ?attach page: >  " attach can lead to confusion." > > I can't remember the last time I needed attach(). > > Peter Ehlers Yes. But perhaps

[R] pdf (probability distribution function) and cdf

2011-05-17 Thread Alaios
Dear all, I would like for a given vector to calculate the pdf and the cdf and then plot these two graphs. Is there in R any toolkit that can help me do that fast? Regards Alex __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

Re: [R] Minimum value by ID

2011-05-17 Thread Downey, Patrick
Perfect. Thank you. -Mitch -Original Message- From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] Sent: Tuesday, May 17, 2011 9:51 AM To: Downey, Patrick Cc: r-help@r-project.org Subject: Re: [R] Minimum value by ID have a look at help file of function tapply(), and try this:

Re: [R] Minimum value by ID

2011-05-17 Thread John Kane
A bit convolulted but it works library(reshape2) yy <- melt(dat) zz <- cast(yy, id.var ~ variable, min) zz[,2] --- On Tue, 5/17/11, Downey, Patrick wrote: > From: Downey, Patrick > Subject: [R] Minimum value by ID > To: r-help@r-project.org > Received: Tuesday, May 17, 2011, 9:44 AM > Hello, >

Re: [R] Problem on glmer

2011-05-17 Thread Zhang,Yanwei
Hi Dennis, Thanks for your input. I am quite shocked that the Gamma model is not implemented in glmer yet, but do you happen to know if there is other packages in R that could fit Gamma hierarchical models besides MASS? The glmmPQL results are a bit off compared to what have been published. T

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Jonathan Daily
Do you have a reproducible example? As posed I have no idea what this vector contains. Are you assuming a specific distribution type and using these vectors to parameterize it? On Tue, May 17, 2011 at 10:08 AM, Alaios wrote: > Dear all, > I would like for a given vector to calculate the pdf and

Re: [R] Minimum value by ID

2011-05-17 Thread Ivan Calandra
Two other options (which I prefer): aggregate(x~id.var, data=dat, FUN=min) or library(doBy) summaryBy(x~id.var, data=dat, FUN=min) HTH, Ivan Le 5/17/2011 16:09, John Kane a écrit : A bit convolulted but it works library(reshape2) yy<- melt(dat) zz<- cast(yy, id.var ~ variable, min) zz[,2] --

[R] Display data.frame as tree?

2011-05-17 Thread Fredrik Karlsson
Dear list, I have a data.frame with aggregated frequencies of occurrence of two-way (and in one case three-way) features in my observations. Like this: location condition transient fricationmrallvoiced correctstop vpresent frequency 1 STNPOSTON TRUE FALSE FALSE

[R] Problem with MLE

2011-05-17 Thread Bazman76
Hi there, I am trying to run the following code: > dcOU<-function(x,t,x0,theta,log=FALSE){ + Ex<-theta[1]/theta[2]+(x0-theta[1]/theta[2])*exp(-theta[2]*t) + Vx<-theta[3]^2*(1-exp(-2*theta[2]*t))/(2*theta[2]) + dnorm(x,mean=Ex,sd=sqrt(Vx),log=log) + } > OU.lik<-function(theta1,theta2,theta3){ + n<

Re: [R] Rscript hangs on exit with ubuntu 11.04

2011-05-17 Thread Mikael Högqvist
Hi Dirk, for me the following still hangs: R --vanilla -e 'library(plyr); ddply(data.frame(a=1:101,b=1:101), .(a,b), nrow)' but... when running the script via littler with "r -p bug.R" it returns. Thanks, Mikael On 17 May 2011 13:50, Dirk Eddelbuettel wrote: > > On 17 May 2011 at 12:18, Mikae

Re: [R] Smooth contour of a map

2011-05-17 Thread Pierre Bruyer
Thank you for your answer, but the function spline() (and a lot of other function in R) can't take in its parameters the original contour which are define by a vector, i.e. : ##creation of breaks for colors i<-1 paliers <- c(-1.0E300) while(i<=length(level[,1

Re: [R] Smooth contour of a map

2011-05-17 Thread Pierre Bruyer
I work with large datasets (1 points) so I can't post them , but my function is : create_map <- function(grd, level ,map_output, format = c("jpeg"), width_map = 150, height_map = 150,...) { ##sp <- spline(x = grd[,1], y = grd[,2]) grd2 <- matrix(grd[,

Re: [R] epi.2by2

2011-05-17 Thread pcc
Thank you! I'm a bit of a newby but this has really helped. thank you -- View this message in context: http://r.789695.n4.nabble.com/epi-2by2-tp3528814p3529025.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] Smooth contour of a map

2011-05-17 Thread Pierre Bruyer
The result is good, thanks a lot, but how can I with this method fill my raster to color? Le 17 mai 2011 à 15:43, Duncan Murdoch a écrit : > I don't think filled.contour gives you access to the contour lines. If you > use contourLines() to compute them, then you can draw them using code like

Re: [R] Linear Discriminant Analysis error: "Variables appear constant"

2011-05-17 Thread Uwe Ligges
- Reduce the model to a reasonable size with far less variables than observations. - Code factors as factors rather than numerics - don't use variables with perfect correlation to other nor any duplicates Best, Uwe Ligges On 17.05.2011 15:46, Songer, Katherine B - DNR wrote: Uwe, Thank you

Re: [R] scales argument in bwplot (lattice)

2011-05-17 Thread Peter Ehlers
On 2011-05-17 06:50, Doran, Harold wrote: Suppose I have data such as the following set.seed(12345) tmp<- data.frame(var1 = rnorm(100), var2 = rnorm(100), var3=rnorm(100, 10, 30)) tmp1<- data.frame(vars = with(tmp, c(var1, var2, var3)), type = gl(3, 100)) var3 is on a different scale, but I cr

Re: [R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Liviu Andronic
On Tue, May 17, 2011 at 2:15 PM, Jannis wrote: >  Otherwise I would stick to SPSS/Excel/Sigmaplot or browse for some R GUIs > with some basics beeing implemented on a "click basis" like RStudio, Rkward > or TinnR. All R GUI implementations are however limited to basic > plotting/analysis routin

Re: [R] Problem with MLE

2011-05-17 Thread Bazman76
sorry I solved it, was a typo on my part!! -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-MLE-tp3529445p3529597.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Downey, Patrick
I like the function Ecdf in the Hmisc package. For the pdf, you can also use plot(density(x)), which is in the stats package. ??Ecdf -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios Sent: Tuesday, May 17, 2011 10:09 AM To: R

Re: [R] extract value from mer object ?

2011-05-17 Thread Ben Bolker
Maas James Dr (MED uea.ac.uk> writes: > > > What is the easiest way to extract a value from a 'mer' > object from glmer? The first I need is the > trtpair Std.Dev. which in this case is 0.17542? > > I've managed to get the fixed effects numbers from > summary(fednmaout)@coeffs You sho

[R] Help with PLSR with jack knife

2011-05-17 Thread Amit Patel
Hi I am analysing a dataset of 40 samples each with 90,000 intensity measures for various peptides. I am trying to identify the Biomarkers (i.e. most significant peptides). I beleive that PLS with jack knifing, or alternativeley CMV(cross-model-validation) are multivariateThe 40 samples belong

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Alaios
I am assuming a Gaussian distribution with specific mean and standard deviation --- On Tue, 5/17/11, Jonathan Daily wrote: > From: Jonathan Daily > Subject: Re: [R] pdf (probability distribution function) and cdf > To: "Alaios" > Cc: R-help@r-project.org > Date: Tuesday, May 17, 2011, 3:18 PM

[R] submit R package

2011-05-17 Thread Yan Jiao
Dear all, I'm just wondering how to submit a package to cran? I followed the instruction, using anonymous as username and my email address as password, but it didn't connect. Any hints? Yan [[alternative HTML version deleted]] __ R-help@r-pr

Re: [R] submit R package

2011-05-17 Thread stephen sefick
I followed the directions and all was well. Sorry I have no insight. On Tue, May 17, 2011 at 11:51 AM, Yan Jiao wrote: > Dear all, > > I'm just wondering how to submit a package to cran? > I followed the instruction, using anonymous as username and my email address > as password, but it didn't

Re: [R] submit R package

2011-05-17 Thread Sebastian Gibb
Hello Yan, please use an empty password and write an e-mail to c...@r-project.org afterwards. Bye, Sebastian > Dear all, > > I'm just wondering how to submit a package to cran? > I followed the instruction, using anonymous as username and my email > address as password, but it didn't connect.

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Downey, Patrick
?dnorm -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios Sent: Tuesday, May 17, 2011 12:50 PM To: Jonathan Daily Cc: R-help@r-project.org Subject: Re: [R] pdf (probability distribution function) and cdf I am assuming a Gaussian

[R] help with PLSR Loadings

2011-05-17 Thread Amit Patel
Hi When I call for the loadings of my plsr using the command, x <- loadings(BHPLS1) my loadings contain variable names rather than numbers. >str(x) loadings [1:94727, 1:10] -0.00113 -0.03001 -0.00059 -0.00734 -0.02969 ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:94727] "PCIList1" "PCIL

[R] Summarize by two or more attributes

2011-05-17 Thread LCOG1
Okay everyone heres a likely softball for someone. Consider the following data frame: #Create data x<-rep(c(1,15),10) y<-rnorm(20) z<-c(rep("auto",10),rep("bus",10)) a<-rep(c(1,1,2,2,3,3,4,4,5,5),2) #Create Data frame Df<-data.frame(Source=x,Rate=y,Bin=a,Type=z) I want to create a new column th

[R] adding up elements within a list

2011-05-17 Thread Martin Hughes
Dear R users I have a list, as follows: intvl.period.myrs $Devonian [1] 4.8 4.2 9.5 5.7 $Ordovician [1] 7.2 5.1 10.2 1.9 $Silurian [1] 4.7 3.0 7.8 2.0 3.3 1.6 2.6 2.7 I want to write a loop that will sum up the values in each part, and give me a vector containing the (in this case 3)

[R] reshaping issue

2011-05-17 Thread Stijn Van Daele
Dear R users, I have a problem with reshaping data. I know such questions have been asked before, but I can't get it right, neither with the reshape function nor with the melt function. My dataset has about 407 variables and about 48000 cases. Each case looks as follows: V1 v2 v3v4

Re: [R] adding up elements within a list

2011-05-17 Thread Henrique Dallazuanna
Try this: sapply(intvl.period.myrs, sum) On Tue, May 17, 2011 at 1:13 PM, Martin Hughes wrote: > > > Dear R users > > I have a list, as follows: > >> intvl.period.myrs > > $Devonian > [1] 4.8 4.2 9.5 5.7 > > $Ordovician > [1]  7.2  5.1 10.2  1.9 > > $Silurian > [1] 4.7 3.0 7.8 2.0 3.3 1.6 2.6 2.

Re: [R] Problem on glmer

2011-05-17 Thread Dennis Murphy
Hi: This might be helpful: http://glmm.wikidot.com/faq It has some commentary and potential workarounds re gamma GLMMs toward the bottom of the page. I might also suggest that r-sig-mixed-models might be a better forum for these types of questions; you can subscribe by going to http://www.r-pro

Re: [R] changes in coxph in "survival" from older version?

2011-05-17 Thread Frank Harrell
It's worse if the model does converge because then you don't have a warning about the result being nonsense. Frank Terry Therneau-2 wrote: > > -- begin included message --- > I did realize that there are way more predictors in the model. My > initial thinking was use that as an initial model fo

Re: [R] Problem on glmer

2011-05-17 Thread Zhang,Yanwei
Hglm does the work! Thanks! Also, I find that the developing version of lme4, called lme4a, has the capability to fit Gamma models. And both lme4a and hglm produce results consistent with the published ones. Problems solved! Wayne (Yanwei) Zhang Statistical Research >CNA -Original Me

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Abhijit Dasgupta
One possibility is: library(doBy) summaryBy(Rate~Source+Bin, data=Df, FUN=sum) On 5/17/2011 12:48 PM, LCOG1 wrote: > Okay everyone heres a likely softball for someone. > > Consider the following data frame: > > #Create data > x<-rep(c(1,15),10) > y<-rnorm(20) > z<-c(rep("auto",10),rep("bus",10))

Re: [R] reshaping issue

2011-05-17 Thread Scott Chamberlain
Can you provide a brief reproducible example for us to play with? Scott On Tuesday, May 17, 2011 at 12:31 PM, Stijn Van Daele wrote: > Dear R users, > > I have a problem with reshaping data. I know such questions have been asked > before, but I can't get it right, neither with the reshape funct

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Felipe Carrillo
Like This? x<-rep(c(1,15),10) y<-rnorm(20) z<-c(rep("auto",10),rep("bus",10)) a<-rep(c(1,1,2,2,3,3,4,4,5,5),2) #Create Data frame Df<-data.frame(Source=x,Rate=y,Bin=a,Type=z) Df ddply(Df,c('Type','Bin'),summarise,Summed=sum(Rate))  # Adding a column to Df ddply(Df,c('Type','Bin'),mutate,Summed=s

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Marc Schwartz
On May 17, 2011, at 11:48 AM, LCOG1 wrote: > Okay everyone heres a likely softball for someone. > > Consider the following data frame: > > #Create data > x<-rep(c(1,15),10) > y<-rnorm(20) > z<-c(rep("auto",10),rep("bus",10)) > a<-rep(c(1,1,2,2,3,3,4,4,5,5),2) > #Create Data frame > Df<-data.fram

Re: [R] graphs and arrays

2011-05-17 Thread Bogdan Tanasa
Dear all, it might not be a R-related question, however, I would appreciate if anyone could suggest a mathematical/statistical framework that integrates graphs and arrays, and potentially has a R implementation. to give an example : given a graph of interactions (gene1 --- gene2, gene3 --- gene5,

Re: [R] Summarize by two or more attributes

2011-05-17 Thread LCOG1
I will hit my own ball on this one tapply(Df$Rate,list(Df$Bin,Df$Type),sum) -- View this message in context: http://r.789695.n4.nabble.com/Summarize-by-two-or-more-attributes-tp3529825p3530034.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] adding up elements within a list

2011-05-17 Thread Martin Hughes
Brilliant! Thanks Martin Quoting Henrique Dallazuanna : Try this: sapply(intvl.period.myrs, sum) On Tue, May 17, 2011 at 1:13 PM, Martin Hughes wrote: Dear R users I have a list, as follows: intvl.period.myrs $Devonian [1] 4.8 4.2 9.5 5.7 $Ordovician [1]  7.2  5.1 10.2  1.9 $Silu

Re: [R] issue with odfWeave running on Windows XP; question about installing packages under Linux

2011-05-17 Thread rmailbox
I also have a problem using odfWeave on Windows XP with R > R2.11.1. odfWeave fails, giving mysterious error messages. (Not quite the same as yours, but similar. I sent the info to Max Kuhn privately, but did not get a response after two tries.) My odfWeave reporting system worked fine prior to

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Marc Schwartz
On May 17, 2011, at 12:53 PM, LCOG1 wrote: > I will hit my own ball on this one > > > tapply(Df$Rate,list(Df$Bin,Df$Type),sum) > Ahayou had mentioned creating a new column in your initial post, presumably added to 'Df', as opposed to creating a new independent matrix of the results. You

Re: [R] submit R package

2011-05-17 Thread Uwe Ligges
On 17.05.2011 19:17, Sebastian Gibb wrote: Hello Yan, please use an empty password and write an e-mail to c...@r-project.org afterwards. Bye, Sebastian Dear all, I'm just wondering how to submit a package to cran? I followed the instruction, using anonymous as username and my email addr

Re: [R] Summarize by two or more attributes

2011-05-17 Thread ROLL Josh F
Marc, How could I also apply the spline function to each of the 'columns' found in the result from tapply(Df$Rate,list(Df$Bin,Df$Type),sum) ?? -Original Message- From: Marc Schwartz [mailto:marc_schwa...@me.com] Sent: Tuesday, May 17, 2011 12:42 PM To: ROLL Josh F Cc: r-help@r

[R] can not use plot.Predict {rms} reproduce figure 7.8 from Regression Modeling Strategies (http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf)

2011-05-17 Thread John Smith
Dear R-users, I am using R 2.13.0 and rms 3.3-0 , but can not reproduce figure 7.8 of the handouts *Regression Modeling Strategies* ( http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf) by the following code. Could any one help me figure out how to solve this? setwd('C:/Rharrell') re

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Marc Schwartz
On May 17, 2011, at 2:55 PM, ROLL Josh F wrote: > Marc, > How could I also apply the spline function to each of the 'columns' found in > the result from > > tapply(Df$Rate,list(Df$Bin,Df$Type),sum) > > ?? Something along the lines of the following: apply(tapply(Df$Rate,list(Df$Bin,Df$

Re: [R] Using a sting in variable names

2011-05-17 Thread Ken
olafgy gmail.com> writes: > > Hi there, > > I am trying to import 100 files with the names of "vpn 1 .dat" to "vpn 100 > .dat" > into a respective table calld vpn1 to vpn100. > > I therfore have created a variable X<-1:100 > > I not want to use X as a subtitute for the number in my filename,

Re: [R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Dennis Murphy
Hi: I'm assuming this is a snippet of a much larger data set, because one certainly would not use box plots on singleton observations. You have four grouping variables in your example, so the best you could likely do on one graphics page would be to, for example, plot time vs. distance, 'dodged' b

Re: [R] can not use plot.Predict {rms} reproduce figure 7.8 from Regression Modeling Strategies (http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf)

2011-05-17 Thread John Smith
Also I can not reproduce figure 7.11 by f <- Newlabels(f, list(turnout='voter turnout (%)')) windows() nomogram(f, interact=list(income=incomes), turnout=seq(30,100,by=10), lplabel='estimated % voting Democratic', cex.var=.8, cex.axis=.75) On Tue, May 17, 2011 at 4:04 PM, John Smith w

[R] subsetting a list of dataframes

2011-05-17 Thread Lara Poplarski
Hello All, I have a list of dataframes, and I need to subset it by keeping only those dataframes in the list that meet a certain criterion. Specifically, I need to generate a second list which only includes those dataframes whose number of rows is > 1. Could someone suggest how to do this? I have

Re: [R] subsetting a list of dataframes

2011-05-17 Thread Jorge Ivan Velez
Hi Lara, You might try the following (untested): yourlistofdataframes[sapply(yourlistofdataframes, function(d) nrow(d) > 1)] HTH, Jorge On Tue, May 17, 2011 at 4:24 PM, Lara Poplarski <> wrote: > Hello All, > > I have a list of dataframes, and I need to subset it by keeping only those > dataf

Re: [R] subsetting a list of dataframes

2011-05-17 Thread William Dunlap
shouldKeep <- sapply(listOfDataFrames, function(df)nrow(df)>1) listOfDataFrames[shouldKeep] or, compressed to get rid of the intermediate variable listOfDataFrames[sapply(listOfDataFrames, function(df)nrow(df)>1)] If you are writing production code and there is any chance that listOfDataFra

Re: [R] subsetting a list of dataframes

2011-05-17 Thread Rolf Turner
On 18/05/11 08:24, Lara Poplarski wrote: Hello All, I have a list of dataframes, and I need to subset it by keeping only those dataframes in the list that meet a certain criterion. Specifically, I need to generate a second list which only includes those dataframes whose number of rows is> 1. C

Re: [R] subsetting a list of dataframes

2011-05-17 Thread Jannis
Have a look at lapply(). Something like: entries.with.nrows=lapply(data,function(x)dim(x)[1]>1) should give you a vector with the elements of the list that you seek marked with TRUE. This vector can then be used to extract a subset from your list by: data.reduced=data[entries.with.nrows] Or s

[R] Email out of R (code)

2011-05-17 Thread Daniel Malter
Hi all, I thought I would post code to send an email out of R. The code uses Grothendieck and Bellosta's interface package rJython for executing Python from R. The code itself provides basic email functionality for email servers requiring authentication. It should be easy to extend it (e.g., for

Re: [R] Summarize by two or more attributes

2011-05-17 Thread ROLL Josh F
I will take a look. In my real data I need to interpolate the 16 points into 64 points for each of the categories. Thanks Marc JR -Original Message- From: Marc Schwartz [mailto:marc_schwa...@me.com] Sent: Tuesday, May 17, 2011 1:09 PM To: ROLL Josh F Cc: r-help@r-project.org Subjec

Re: [R] Aware of MaxDiff in R?

2011-05-17 Thread VikR
Bumping this thread in order to see if there's any new info on this. :) I'm interested in doing MaxDiff Scaling. Will Maximum Likelihood Difference Scaling give me the same results as MaxDiff Scaling? I found a paper, Discrete-Choice Logit Models with R, by Philip A. Viton. It discusses using

Re: [R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-17 Thread Benjamin Caldwell
Rolf, Taking out the scalar multiples did it. Thanks for that. *Ben Caldwell* PhD Candidate University of California, Berkeley On Sun, May 15, 2011 at 10:30 PM, Rolf Turner wrote: > > In your example it appears that you are plotting a histogram (on the > frequency > scale) and then superim

Re: [R] reshaping issue

2011-05-17 Thread Dennis Murphy
Hi: Here's one way, using an abbreviated example: du <- data.frame(v1 = factor(rep(1:10, each = 4)), v2 = factor(rep(rep(1:2, each = 2), 10)), v3 = factor(rep(1:2, 20)), x1 = rnorm(40), y1 = rnorm(40), x2 = rnorm

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Alaios
and what about the cdf of function? Regards Alex --- On Tue, 5/17/11, Downey, Patrick wrote: > From: Downey, Patrick > Subject: RE: [R] pdf (probability distribution function) and cdf > To: "Alaios" , "Jonathan Daily" > Cc: R-help@r-project.org > Date: Tuesday, May 17, 2011, 6:17 PM > ?dnorm

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread David Winsemius
On May 17, 2011, at 6:00 PM, Alaios wrote: and what about the cdf of function? Did you read the help page for dnorm? -- David. Regards Alex --- On Tue, 5/17/11, Downey, Patrick wrote: From: Downey, Patrick Subject: RE: [R] pdf (probability distribution function) and cdf To: "Alaios"

Re: [R] gsub() issue...

2011-05-17 Thread Andrew Robinson
Hi Charles, It's not clear to me what you mean by "doesn't work". > test <- "Interesting 1\nPoint\n" > cat(test) Interesting 1 Point > test1 <- gsub("ing 1\nP","ing 3\nP", test) > cat(test1) Interesting 3 Point > Cheers Andrew On Tue, May 17, 2011 at 10:45:31AM +0200, Thibault Charles wrote:

  1   2   >