Re: [R] Aggregate certain rows in a matrix

2010-09-06 Thread Kennedy
Thank you very much for the help. I decided to go with the 'plyr' package but it is nice to have options. Have a lovely day. -- View this message in context: http://r.789695.n4.nabble.com/Aggregate-certain-rows-in-a-matrix-tp2528454p2529238.html Sent from the R help mailing list archive at Nabb

Re: [R] WriteXLS problem

2010-09-06 Thread Kenneth Roy Cabrera Torres
Dears Dejian and David: Thank you for your help. Maybe dataframes2xls package have the same problem. But "xlsx" take too much time to write it down. Kenneth. El lun, 06-09-2010 a las 20:56 -0400, David Winsemius escribió: > On Sep 6, 2010, at 8:09 PM, Dejian Zhao wrote: > > > The maximum numb

Re: [R] two questions

2010-09-06 Thread Iasonas Lamprianou
By the way, ordinal regression would require huge datasets because my dependent variable has around 20 different responses... but again, one might say that with so many  ordinal responses, it is as if we have a linear/interval variable, right? I just hoped that there would be a two-way kruskal-w

Re: [R] How to run R on Emacs+ESS

2010-09-06 Thread Steve Lianoglou
On Tue, Sep 7, 2010 at 1:41 AM, Stephen Liu wrote: > Hi Johnathan, > > Tried, > Ctrl-x R Enter > > The same, no response. No, not ctrl-x r. The previous poster told you to do "Alt-x R" (where Alt might be "option" on your keyboard). In emacs-speak, this modifier key (alt/opt) is written as "M" ..

Re: [R] two questions

2010-09-06 Thread Iasonas Lamprianou
thanks for the response we are talking about 7 cities. If I run a two-way anova, I find the residuals skewed and non-normal. I'll try the rlm method and see what happens. Thanks to all of you for the support. Dr. Iasonas Lamprianou Assistant Professor (Educational Research and Evaluation)

Re: [R] How to run R on Emacs+ESS

2010-09-06 Thread Steve Lianoglou
Hi, On Tue, Sep 7, 2010 at 12:39 AM, Stephen Liu wrote: > Hi Steve, > > Thanks for your advice. > >> Actually, for that to work, the path for your R executable needs to be >> in emacs' exec-path: > http://www.emacswiki.org/emacs/ExecPath > > appending the /sw/bin directory to the exec-path and PA

Re: [R] How to run R on Emacs+ESS

2010-09-06 Thread Stephen Liu
Hi Johnathan, Tried, Ctrl-x R Enter The same, no response. B.R. Stephen L Sent from my iPhone On Sep 7, 2010, at 12:53 PM, Jonathan Christensen wrote: Hi Stephen, Just to check: when you say you type "M-x R", are you typing the letter "M"? M-x in Emacs-speech means Meta-x, i.e., Alt-x. Jo

Re: [R] row echelon form

2010-09-06 Thread Peng, C
Scott, it seems to have bug in your code: > A=matrix(c(1,-2,3,9,-1,3,0,-4,2,-5,5,17),ncol=4,byrow=T) > ref(A) [,1] [,2] [,3] [,4] [1,]1 -2.5 2.17 7.83 [2,]0 1.0 3.00 5.00 [3,]0 0.0 1.00 2.00 the row echelon is apparently incorrect. -- View this

Re: [R] likelyhood maximization problem with polr

2010-09-06 Thread Peng, C
sorry: start=rep(1,6) since there are 6 parameters in the model. -- View this message in context: http://r.789695.n4.nabble.com/likelyhood-maximization-problem-with-polr-tp2528818p2529176.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] likelyhood maximization problem with polr

2010-09-06 Thread Peng, C
Since the default initial value is not good enough. You should choose one based on your experience or luck. I choose start=rep(1,5) since there are parameters in the model. > polr(Species~Sepal.Length+Sepal.Width+Petal.Length+Petal.Width,iris, > start=rep(1,6), method = "logistic") Call: polr(fo

Re: [R] How to run R on Emacs+ESS

2010-09-06 Thread Jonathan Christensen
Hi Stephen, Just to check: when you say you type "M-x R", are you typing the letter "M"? M-x in Emacs-speech means Meta-x, i.e., Alt-x. Jonathan On Mon, Sep 6, 2010 at 7:01 PM, Stephen Liu wrote: > Hi Dirk, > > Thanks for your advice. > > > Emacs and ESS already installed. > > $ apt-cache pol

Re: [R] How to run R on Emacs+ESS

2010-09-06 Thread Stephen Liu
Hi Steve, Thanks for your advice. > Actually, for that to work, the path for your R executable needs to be > in emacs' exec-path: http://www.emacswiki.org/emacs/ExecPath appending the /sw/bin directory to the exec-path and PATH variables (useful for Mac OS X users running LaTeX): (setenv "PATH"

Re: [R] How to run R on Emacs+ESS

2010-09-06 Thread Steve Lianoglou
Hi, On Mon, Sep 6, 2010 at 9:01 PM, Stephen Liu wrote: > $ apt-cache policy ess > ess: >  Installed: 5.3.8~svn3917-1 >  Candidate: 5.3.8~svn3917-1 >  Version table: >  *** 5.3.8~svn3917-1 0 >        500 http://ftp.hk.debian.org lenny/main Packages >        100 /var/lib/dpkg/status I believe th

Re: [R] Prediction and confidence intervals from predict.drc

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 7:54 PM, Brant Inman wrote: R-helpers, I am using the package "drc" to fit a 4 parameter logistic model. When I use the predict function to get prediction on a new dataset, I am not getting the requested confidence or prediction intervals. Any idea what is going on?

Re: [R] how to combine several subsets?

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 9:22 PM, tooblue wrote: I simply put, NEVER=subset(infants$bwt,ISNO1) UNTILPREGNANT=subset(infants$bwt, ISNO2) ONCENOTNOW=subset(infants$bwt, ISNO3) and I wanna combine those three. I do it like ISNO=NEVER&UNTILPREGNANT&ONCENOTNOW The "&" operator does not do concatenat

[R] how to combine several subsets?

2010-09-06 Thread tooblue
I simply put, > NEVER=subset(infants$bwt,ISNO1) > UNTILPREGNANT=subset(infants$bwt, ISNO2) > ONCENOTNOW=subset(infants$bwt, ISNO3) and I wanna combine those three. I do it like ISNO=NEVER&UNTILPREGNANT&ONCENOTNOW and R tells me 1: In NEVER & UNTILPREGNANT : longer object length is not a mu

Re: [R] Creating named.list from two matrix columns

2010-09-06 Thread Dennis Murphy
Hi: See inline. On Mon, Sep 6, 2010 at 9:29 AM, Viki S wrote: > > Hi Jim, > Thanks, > > That愀 right. But the problem is that it > introduces unnecessary quotes, perhaps due to the format of first > column data in this case : > > x<-cbind(c("row:1", "row:2", "row:3"), c("4889", "9987", "494"))

Re: [R] two questions

2010-09-06 Thread juan xiong
Maybe Friedman test On Mon, Sep 6, 2010 at 4:47 PM, David Winsemius wrote: > The usual least-squares methods are fairly robust to departures from > normality. Furthermore, it is the residuals that are assumed to be normally > distributed (not the marginal distributions that you are probably looki

[R] Need help with error number of items to replace is not a multiple of replacement length

2010-09-06 Thread monica1221
Hello, I am brand new to R and need a little help understanding what I'm doing wrong here! Please excuse me, I might have the terminology incorrect. What I've got is: A dataset ami07.data with a variable ami_fy07. There are 2929 values in this dataset, each representing a value for a unique hospi

Re: [R] Creating named.list from two matrix columns

2010-09-06 Thread jim holtman
The quotes are not unnecessary since 'row:1' is not a valid name and therefore you will need quotes to refer to the data: > x<-cbind(c("row:1", "row:2", "row:3"), c("4889", "9987", "494")) > x1<-as.list(x[,2]) > names(x1)<-x[,1] > x1 $`row:1` [1] "4889" $`row:2` [1] "9987" $`row:3` [1] "494" >

Re: [R] How to run R on Emacs+ESS

2010-09-06 Thread Stephen Liu
Hi Dirk, Thanks for your advice. Emacs and ESS already installed. $ apt-cache policy emacs emacs: Installed: 22.2+2-5 Candidate: 22.2+2-5 Version table: 23.1+1-4~bpo50+1 0 1 http://backports.org lenny-backports/main Packages *** 22.2+2-5 0 500 http://ftp.hk.debian.

Re: [R] WriteXLS problem

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 8:09 PM, Dejian Zhao wrote: The maximum number of rows in excel 2003 or below is 65535, less than your number of rows, so if you export your data into "xls" files, probably you cannot see all your data in excel. Exel 2007 can hold as many as 1048575 lines, thus "xlsx" fi

Re: [R] WriteXLS problem

2010-09-06 Thread Dejian Zhao
The maximum number of rows in excel 2003 or below is 65535, less than your number of rows, so if you export your data into "xls" files, probably you cannot see all your data in excel. Exel 2007 can hold as many as 1048575 lines, thus "xlsx" file is a better choice. On 2010-9-7 0:03, Kenneth

[R] Prediction and confidence intervals from predict.drc

2010-09-06 Thread Brant Inman
R-helpers, I am using the package "drc" to fit a 4 parameter logistic model. When I use the predict function to get prediction on a new dataset, I am not getting the requested confidence or prediction intervals. Any idea what is going on? Here is code to reproduce the problem: --- library(

[R] Way OT: Does PSA testing reduce prostate cancer mortality?

2010-09-06 Thread Bert Gunter
Hi Folks: I found the following paper to be an interesting example of how even well designed and conducted studies -- randomized trials, even -- can be rendered problematic by systematic effects beyond the control of the investigators: http://www.nature.com/nrurol/journal/v7/n9/full/nrurol.2010.1

Re: [R] nlme Output

2010-09-06 Thread Edward Patzelt
The design is a repeated measures with 3 instances. There are 3 groups: Controls, Heavy Cocaine Users, Light Cocaine Users. I reshaped the data so that there was one variable for the 3 instances called AvgTrials. Time is the indicator of each instance. Here is the model call: mod5 <- lme(AvgT

Re: [R] combining collumns for data.frames

2010-09-06 Thread jim holtman
Try this (after making sure that Col_1 in data2 matches your column names in data1 > data1 <- read.table(textConnection("Taxon stage1 stage2 stage3 stage4 + T1 0 0 1 1 + T2 0 1 1 0 + T3 0 0 0

Re: [R] Help with unexpected symbol errors

2010-09-06 Thread jim holtman
We would need to at least see 10 lines either side of the error to understand its context. Also take a look with you editor (hex editor would be handy) to see if there is some unprintable character around it. Can you isolate just that portion of the code? Try putting it inside a function to see

Re: [R] limit on read.socket?

2010-09-06 Thread Thomas Lumley
On Sat, 4 Sep 2010, raje...@cse.iitm.ac.in wrote: Hi, I have the following piece of code, repeat{ ss<-read.socket(sockfd); if(ss=="") break output<-paste(output,ss) } but somehow, output is not receiving all the data that is coming through the socket.My suspicion is on the if statement. wh

Re: [R] dataframe row names from list

2010-09-06 Thread Jim Lemon
On 09/06/2010 09:41 PM, raje...@cse.iitm.ac.in wrote: Hi, I have a list which looks like this... str(y) List of 10 $ : chr [1:4] "ABCD" "5" "0" "1" $ : chr [1:4] "DEF" "15" "1" "16" $ : chr [1:4] "AAA" "2" "17" "8" $ : chr [1:4] "SSS" "15" "25" "1" $ : chr [1:4] "III" "15" "26" "4"

[R] PostScript/PDF graphics with another font

2010-09-06 Thread Peter
I am using the standard phonetic font "Doulos SIL" in a graph (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=DoulosSILfont) This is an example: windowsFonts(IPA="TT Doulos SIL") barplot(c(1,2,3,4,5),names=c("\u{0251}","\u{0252}","\u{0253}","\u{0254}","\u{0255}"),family="IPA") Howe

Re: [R] two questions

2010-09-06 Thread David Winsemius
The usual least-squares methods are fairly robust to departures from normality. Furthermore, it is the residuals that are assumed to be normally distributed (not the marginal distributions that you are probably looking at) , so it does not sound as though you have yet examined the data prop

[R] Help with unexpected symbol errors

2010-09-06 Thread Amit Patel
Hi I have got a long script which will not run for me as i keep getting errors : > source("clusterfixV1_4.r") Error in source("clusterfixV1_4.r") : clusterfixV1_4.r: unexpected symbol at 158: eck[k,2] <- as.numeric(1) 159: #ClusterInfo[k,2] <- "Clustered I have sorted all the

[R] two questions

2010-09-06 Thread Iasonas Lamprianou
Dear friends, two questions (1) does anyone know if there are any non-parametric equivalents of the two-way ANOVA in R? I have an ordinal non-normally distributed dependent variable and two factors (gender and city of birth). Normally, one would try a two-way anova, but if R has any non-parame

[R] likelyhood maximization problem with polr

2010-09-06 Thread blackscorpio
Dear community, I am currently trying to fit an ordinal logistic regression model with the polr function. I often get the same error message : "attempt to find suitable starting values failed", for example with : require(MASS) data(iris) polr(Species~Sepal.Length+Sepal.Width+Petal.Length+Peta

Re: [R] how to change the xlab name?

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 2:07 PM, tooblue wrote: I simply put, plot(density(), main="", + xlab = "XXX"), it says that I have an unexpected "=" in it. It may be a case of a confused parser. You have an extraneous "+" in there: > = rnorm(100) > plot(density(), main="",

Re: [R] how to change the xlab name?

2010-09-06 Thread Joshua Wiley
On Mon, Sep 6, 2010 at 11:07 AM, tooblue wrote: > > I simply put,  plot(density(), main="", + xlab = "XXX"), it says that > I have an unexpected "=" in it. You just have an extra ' + ' before the xlab argument: plot(density(rnorm(100)), main = "", xlab = "XXX") ought to do it. Chee

Re: [R] Failure to aggregate

2010-09-06 Thread Gabor Grothendieck
On Mon, Sep 6, 2010 at 12:15 PM, Dimitri Shvorob wrote: > > I have a (very big - 1.5 rows) dataframe with a (POSIXt"  "POSIXlt") column h > (hour). Surprisingly, I cannot calculate a simple aggregate over the > dataframe. > >> n.h1 = sqldf("select distinct h, count(*) from x group by h") > Error i

[R] how to change the xlab name?

2010-09-06 Thread tooblue
I simply put, plot(density(), main="", + xlab = "XXX"), it says that I have an unexpected "=" in it. -- View this message in context: http://r.789695.n4.nabble.com/how-to-change-the-xlab-name-tp2528733p2528733.html Sent from the R help mailing list archive at Nabble.com. __

[R] combining collumns for data.frames

2010-09-06 Thread Martin Hughes
Hi This question is far less simple than the title suggests, please read carefully, thanks. I have 2 sets of data, both read into R >data1<-read.table ("1.txt", header=T, sep="\t") >data2<-read.table ("2.txt", header=T, sep="\t") >data1 Taxon stage1 stage2 stage3 stage4 T1 0

Re: [R] Time Series

2010-09-06 Thread Gabor Grothendieck
On Mon, Sep 6, 2010 at 11:56 AM, trb1 wrote: > > Thank you very much for your post. > Your answer has been very helpful. > Is it possible to merge >2 time series? > zz is my posted code was formed by merging two univariate and one multivariate series. -- Statistics & Software Consulting GKX Gro

Re: [R] Over lay 2 scale in same plot

2010-09-06 Thread Joshua Wiley
Hi, Looking at the picture, I think you are just talking about plotting two datasets. Here is an example I made up, that looks sort of like your picture: # make a barplot barplot(-50:50) # add points into the existing plot at the coordinates set by x and y # and use a line to connect them points

Re: [R] Failure to aggregate

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 12:15 PM, Dimitri Shvorob wrote: I have a (very big - 1.5 rows) dataframe with a (POSIXt" "POSIXlt") column h (hour). Surprisingly, I cannot calculate a simple aggregate over the dataframe. n.h1 = sqldf("select distinct h, count(*) from x group by h") Error in sqliteE

[R] ERCIM'10: Submission of abstracts

2010-09-06 Thread Uwe Ligges
Dear useRs, the deadline for submission of abstracts is approaching for ERCIM'10. Please upload your abstract until 2010-09-08 if you would like to give a presentation at our track on "Statistical Algorithms and Software" at the 3rd International Conference of the ERCIM WG on COMPUTING & STA

Re: [R] poisson distribution

2010-09-06 Thread tamas barjak
Successful! Thank you! 2010/9/6 David Winsemius > > On Sep 6, 2010, at 1:13 PM, tamas barjak wrote: > > Hello! >> >> I need some help. >> How I know it to draw the formula of the poisson distribution? >> >> expr<-expression(P(xi == k) == frac(lambda^k, factorial(k))*e^-lambda) >> ---> >> not

Re: [R] poisson distribution

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 1:13 PM, tamas barjak wrote: Hello! I need some help. How I know it to draw the formula of the poisson distribution? expr<-expression(P(xi == k) == frac(lambda^k, factorial(k))*e^- lambda) ---> not good ?plotmath (Do not see factorial as a plotmath "function" Try: ex

Re: [R] c++ equivalent switch statement?

2010-09-06 Thread romain
Le 06/09/10 19:17, rajesh j a écrit : > Is there a c++ equivalent switch statement in R? yes, with the same name. See the "R Language definition" : http://cran.r-project.org/doc/manuals/R-lang.html#switch If this is not what you want, maybe you could at least share some C++ code snippet of what

[R] sample a matrix with one element to be 1 from wishart distribution

2010-09-06 Thread mou sonia
Hi, I am not sure if this make sense at all. I'd like to sample a matrix, which follows a wishart / inverted wishart distribution. However, the (1,1) element of this matrix should always be equal to 1. How can I handle it in R? Any suggestion is greatly appreciated. Thanks a lot. Sonia [

[R] Over lay 2 scale in same plot

2010-09-06 Thread mamunbabu2001
Hi Everyone, I have two different data set in 2 different scale. I want to plot these two data in the same plot in their respective scale. So the plot will have 2 different scale. I have added an image below to show how it should look. does any bode has any idea how this can be done. 2 differen

[R] c++ equivalent switch statement?

2010-09-06 Thread rajesh j
Is there a c++ equivalent switch statement in R? -- Rajesh.J [[alternative HTML version deleted]] __ 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/posti

Re: [R] Creating named.list from two matrix columns

2010-09-06 Thread Viki S
Hi Jim, Thanks, That´s right. But the problem is that it introduces unnecessary quotes, perhaps due to the format of first column data in this case : x<-cbind(c("row:1", "row:2", "row:3"), c("4889", "9987", "494")) x1<-as.list(x[,2]) names(x1)<-x[,1] > x1 $`row:1` [1] "4889" $`row:2` [1] "9987"

[R] sample a matrix with one element to be 1 from wishart distribution

2010-09-06 Thread mou sonia
Hi, I am not sure if this make sense at all. I'd like to sample a matrix, which follows a wishart / inverted wishart distribution. However, the (1,1) element of this matrix should always be equal to 1. How can I handle it in R? Any suggestion is greatly appreciated. Thanks a lot. Sonia [

[R] Failure to aggregate

2010-09-06 Thread Dimitri Shvorob
I have a (very big - 1.5 rows) dataframe with a (POSIXt" "POSIXlt") column h (hour). Surprisingly, I cannot calculate a simple aggregate over the dataframe. > n.h1 = sqldf("select distinct h, count(*) from x group by h") Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver:

[R] poisson distribution

2010-09-06 Thread tamas barjak
Hello! I need some help. How I know it to draw the formula of the poisson distribution? expr<-expression(P(xi == k) == frac(lambda^k, factorial(k))*e^-lambda) ---> not good on the screen the " k! " not the Poisson Formula, but "factorial(k)" Thanx! [[alternative HTML version deleted]]

Re: [R] How can I fixe convergence=1 in optim

2010-09-06 Thread Ben Bolker
[forwarding back to r-help for archiving/further discussion] On 10-09-05 08:48 PM, Sally Luo wrote: > Prof. Bolker, > > Thanks for your reply and the helpful info. > > I still have a few questions. > > 1. I also tried to use different methods other than "BFGS" without > changing their def

Re: [R] WriteXLS problem

2010-09-06 Thread Kenneth Roy Cabrera Torres
I use the following sintaxis for the packages: For WriteXLS I use: writeXLS(todo2009,"todo2009.xls") And for dataframes2xls I use: dataframe2xls::write.xls(todo2009,"todo2009.xls") El lun, 06-09-2010 a las 12:34 -0400, David Winsemius escribió: > On Sep 6, 2010, at 12:25 PM, Kenneth Roy Cabre

Re: [R] WriteXLS problem

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 12:25 PM, Kenneth Roy Cabrera Torres wrote: Thank you Ivan for you answer: El lun, 06-09-2010 a las 18:11 +0200, Ivan Calandra escribió: Hi, Are you sure you used the correct syntax and object names? It might just be because of that...(reading the error messages) Im sur

Re: [R] How to run R on Emacs+ESS

2010-09-06 Thread Dirk Eddelbuettel
On 6 September 2010 at 09:18, Stephen Liu wrote: | Hi folks, | | Debian 504 64-bit Good. All you need is sudo apt-get install ess | I found following document; | http://www.biostat.wisc.edu/~kbroman/Rintro/ | | Whether it is the right document for installing Emacs+ESS and R so that R can

Re: [R] WriteXLS problem

2010-09-06 Thread Kenneth Roy Cabrera Torres
Thank you Ivan for you answer: El lun, 06-09-2010 a las 18:11 +0200, Ivan Calandra escribió: > Hi, > > Are you sure you used the correct syntax and object names? It might just > be because of that...(reading the error messages) Im sure, because it works with write.csv or write.table. > There is a

[R] How to run R on Emacs+ESS

2010-09-06 Thread Stephen Liu
Hi folks, Debian 504 64-bit I found following document; http://www.biostat.wisc.edu/~kbroman/Rintro/ Whether it is the right document for installing Emacs+ESS and R so that R can run on Emacs? TIA B.R. Stephen L __ R-help@r-project.org mailing l

Re: [R] boxplot knowing Q1, Q3, median, upper and lower whisker value

2010-09-06 Thread Joshua Wiley
Hi Dave, You can look at the function ?bxp it might work for you. Alternately, create a meaningless boxplot object, and then just edit that data, in which case I know it will work with bxp(). # Create a boxplot, the data does not matter x <- boxplot(1:10) x # view the data for the boxplot x$sta

Re: [R] path analysis

2010-09-06 Thread Sarah Goslee
There are lots of options for path analysis in R. If you go to http://www.rseek.org and type path analysis into the search box, you will get lots of information on functions/packages, and more general info as well. Beyond that, we'd need more specifics about your task. Sarah On Mon, Sep 6, 2010

Re: [R] WriteXLS problem

2010-09-06 Thread Ivan Calandra
Hi, Are you sure you used the correct syntax and object names? It might just be because of that...(reading the error messages) There is another function, xlsReadWrite::write.xls(), that I like a lot: it is really easy to use and does not require Perl or Python. HTH, Ivan Le 9/6/2010 18:03, K

[R] WriteXLS problem

2010-09-06 Thread Kenneth Roy Cabrera Torres
Hi R users: I don't know if you have had the following problem trying to export to an "xls" format file in a non windows platform. I try to use the following packages: 1. dataframes2xls (version 0.4.4) (with phyton 2.7 and 3.1) 2. WriteXLS (version 1.9.0) (with perl and testPerl working) Even "x

Re: [R] rbind() overwriting data.frame()

2010-09-06 Thread rajesh j
Also, when I create the data.frame with matrix and try to rbind, I get warnings.. Warning messages: 1: In `[<-.factor`(`*tmp*`, ri, value = "4") : invalid factor level, NAs generated 2: In `[<-.factor`(`*tmp*`, ri, value = "5") : invalid factor level, NAs generated 3: In `[<-.factor`(`*tmp*`, r

Re: [R] Time Series

2010-09-06 Thread trb1
Thank you very much for your post. Your answer has been very helpful. Is it possible to merge >2 time series? -- View this message in context: http://r.789695.n4.nabble.com/Time-Series-tp2528444p2528584.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] rbind() overwriting data.frame()

2010-09-06 Thread rajesh j
But If I do that how will I resize later? On Mon, Sep 6, 2010 at 8:54 PM, ONKELINX, Thierry wrote: > This will give a matrix with 0 rows. > > data.frame(matrix(nrow = 0, ncol = 22, dimnames = list(NULL, > LETTERS[1:22]))) > > But you should avoid growing dataframes is the final dataframe is goin

[R] boxplot knowing Q1, Q3, median, upper and lower whisker value

2010-09-06 Thread David A.
Dear list, I am using a external program that outputs Q1, Q3, median, upper and lower whisker values for various datasets simultaneously in a tab delimited format. After importing this text file into R, I would like to plot a boxplot using these given values and not the original series of data

[R] path analysis

2010-09-06 Thread Guy rotem
Hi. which package i need to install to be able to run "Path analysis" using r? many thanks, Guy -- Guy Rotem Department of Life Sciences The Spatial Ecology Lab Ben Gurion University of the Negev P.O.B. 653 Beer-Sheva 84105 ISRAEL +972-52-3354485 (mobile) +972-8-6461350 (lab) [[alte

Re: [R] Strange behavior of interval values in optimize()

2010-09-06 Thread Michael Bernsteiner
that was my first idea as well, but as the result shows, the minimized function value of the wider interval is greater. In addidtion, the problem also exists, if the minimized parameter in the case of the larger interval also already lies within the smaller interval: f<-function(delta,P,U){

Re: [R] rbind() overwriting data.frame()

2010-09-06 Thread ONKELINX, Thierry
This will give a matrix with 0 rows. data.frame(matrix(nrow = 0, ncol = 22, dimnames = list(NULL, LETTERS[1:22]))) But you should avoid growing dataframes is the final dataframe is going to be large. You are very likely to get memory problems. It is much to better to create a large enough datafr

Re: [R] Aggregate certain rows in a matrix

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 10:47 AM, Dimitris Rizopoulos wrote: one way is the following: M <- cbind(c(1,1,1,1,2,2,3,3,3,3), c(2,2,2,3,4,4,4,5,5,6), c(1,2,3,4,5,6,7,8,9,10)) ind <- do.call(paste, c(as.data.frame(M[, 1:2], sep = "\r"))) M[, 3] <- ave(M[, 3], ind, FUN = "sum") unique(M) I had been

Re: [R] rbind() overwriting data.frame()

2010-09-06 Thread Ivan Calandra
Hi again! I'm trying to follow your general goal from your questions today but it's not easy. First, declaring a data.frame of 0 rows is a bad idea. It is much faster to define the length and number of rows from the beginning and to fill it then. Second, I don't know how to do it! What I kn

Re: [R] Time Series

2010-09-06 Thread Gabor Grothendieck
On Mon, Sep 6, 2010 at 10:24 AM, trb1 wrote: > > Hi > > How would I analyse time series with > - different lengths (i.e. one has 9 entries and the other has 14 entries) > - different frequency (i.e. dates are random - no repeated length) > - multiple values for the same time entry (e.g. 2009-10-23

[R] rbind() overwriting data.frame()

2010-09-06 Thread rajesh j
Hi, first off, I wanna ask how do I declare a data.frame of 0 rows and n columns? Coming to my problem, I have a data.frame of 22 columns by dynamic rows which I insert using rbind. The total number of rows could go upto 2,00,000. The problem is that after about 800 or 900 get inserted rbind sta

Re: [R] How to get "mypkg-manual.pdf"

2010-09-06 Thread Duncan Murdoch
On 06/09/2010 9:19 AM, Juliet Ndukum wrote: I am building a package say mypkg. Five months ago, when I built the package I got the mypkg manual in pdf format. Today, after making updates, I build the same package, same name, and steps; unfortunately I do not get the manual in pdf format. Rath

[R] How R converts data between objects

2010-09-06 Thread Alaios
Hello everyone. I would kindly request your help concerning how R converts data between different structrures. In the following example please keep attention on the following two 1) I create f <- GaussRF(x=x, y=y, model=model, grid=TRUE,param=c(mean, variance, nugget, scale, alpha)) with ima

Re: [R] Aggregate certain rows in a matrix

2010-09-06 Thread Barry Rowlingson
On Mon, Sep 6, 2010 at 3:29 PM, Kennedy wrote: > I want to reduce the matrix according to the following: If the values of the > two first columns are the same in two or more rows the values in the third > column of the corresponding rows should be added and only one of the rows > should be keept.

Re: [R] Aggregate certain rows in a matrix

2010-09-06 Thread Dimitris Rizopoulos
one way is the following: M <- cbind(c(1,1,1,1,2,2,3,3,3,3), c(2,2,2,3,4,4,4,5,5,6), c(1,2,3,4,5,6,7,8,9,10)) ind <- do.call(paste, c(as.data.frame(M[, 1:2], sep = "\r"))) M[, 3] <- ave(M[, 3], ind, FUN = "sum") unique(M) I hope it helps. Best, Dimitris On 9/6/2010 4:29 PM, Kennedy wrot

[R] calculating area between plot lines

2010-09-06 Thread A. Marcia BARBOSA
Hi everyone. I have these data: probClass<-seq(0,0.9,0.1) prob1<-c(0.0070,0.0911,0.1973,0.2949,0.3936,0.5030,0.5985,0.6869,0.7820,0.8822) prob2<-c(0.0066,0.0791,0.2358,0.3478,0.3714,0.3860,0.6667,0.6400,0.7000,1.) # which I'm plotting as follows: plot(probClass,prob1,xlim=c(0,1),ylim=c(0,1),

[R] Aggregate certain rows in a matrix

2010-09-06 Thread Kennedy
Hi, I have a matrix that looks like this a <- c(1,1,1,1,2,2,3,3,3,3) b <- c(2,2,2,3,4,4,4,5,5,6) c <- c(1,2,3,4,5,6,7,8,9,10) M <- matrix(nr=10,nc=3) M[,1] <- a M[,2] <- b M[,3] <- c > M [,1] [,2] [,3] [1,]121 [2,]122 [3,]123 [4,]

Re: [R] mac: lib/gtk.pkg

2010-09-06 Thread David Winsemius
On Sep 5, 2010, at 10:32 AM, Daniele Sluijters wrote: Hello, I'm sorry to just pop-up on the mailing list like this and ask a relatively non-R related question but I had no idea whom else to contact on this matter. I'm working on a completely different port of an application to OS X whic

Re: [R] Aggregating the matrices

2010-09-06 Thread Sergey Goriatchev
Gabor, David, thank you. David, your last suggestion is what I need. Regards, Sergey On Mon, Sep 6, 2010 at 16:12, David Winsemius wrote: > > On Sep 6, 2010, at 9:56 AM, Sergey Goriatchev wrote: > >> Hello everyone. >> >> Say we have the following: >> >> a <- matrix(c(-75, 3, 5, 9, 2, 3, 5), nr

[R] Time Series

2010-09-06 Thread trb1
Hi How would I analyse time series with - different lengths (i.e. one has 9 entries and the other has 14 entries) - different frequency (i.e. dates are random - no repeated length) - multiple values for the same time entry (e.g. 2009-10-23 below) i.e. my data takes the form: 1st time series 2

Re: [R] Aggregating the matrices

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 9:56 AM, Sergey Goriatchev wrote: Hello everyone. Say we have the following: a <- matrix(c(-75, 3, 5, 9, 2, 3, 5), nrow=1, dim=list("06092010", c("ES", "PT", "Z ", "CF", "GX", "ST", "EO"))) b <- matrix(c(-5, 2, 4, 12, 5), nrow=1, dim=list("06092010", c("PT", "CF", "AT", "EM

Re: [R] Aggregating the matrices

2010-09-06 Thread Gabor Grothendieck
On Mon, Sep 6, 2010 at 9:56 AM, Sergey Goriatchev wrote: > Hello everyone. > > Say we have the following: > > a <- matrix(c(-75, 3, 5, 9, 2, 3, 5), nrow=1, dim=list("06092010", > c("ES", "PT", "Z ", "CF", "GX", "ST", "EO"))) > b <- matrix(c(-5, 2, 4, 12, 5), nrow=1, dim=list("06092010", c("PT", >

Re: [R] Finding the two most recent dates

2010-09-06 Thread Newbie19_02
Dear all, Thanks very much for the replies and for the help. This whole data set consists of about 7000 individuals who have had multiple blood pressure measures taken over time so I just used one individual as an example. I'm sorry if it looked like homework...it isn't. Jim your solution wo

[R] Aggregating the matrices

2010-09-06 Thread Sergey Goriatchev
Hello everyone. Say we have the following: a <- matrix(c(-75, 3, 5, 9, 2, 3, 5), nrow=1, dim=list("06092010", c("ES", "PT", "Z ", "CF", "GX", "ST", "EO"))) b <- matrix(c(-5, 2, 4, 12, 5), nrow=1, dim=list("06092010", c("PT", "CF", "AT", "EM", "ST"))) d <- cbind(a, b) I want to calculate sums of

Re: [R] nlme Output

2010-09-06 Thread ONKELINX, Thierry
Dear Edward, You have no degrees of freedom left to estimate those p-values. Your design does not allows for the model your implemented. We need a brief summary of your design in order to help you further. HTH, Thierry ---

Re: [R] how do I transform this to a for loop

2010-09-06 Thread Karl Brand
Hi Paul, Ivan, Hartstikke bedankt and thanks alot for sharing these thoughts. I can see 'listing up' multiple symmetrical data sets makes a lot of sense. As does using lapply() on them which i understand to be more efficient/faster than for(). Goodo- with your concensus (and helpful examples

[R] Help on write.xlsx library(xlsx)

2010-09-06 Thread Ravi S. Shankar
Hi Adrian, dat=data.frame(matrix(0,3,3)) write.xlsx(dat,"z:/dat.xlsx",sheetName="sheet1",append=F) write.xlsx(dat,"z:/dat.xlsx",sheetName="sheet2",append=F) The above code works and creates new worksheets. But if I want to append to an existing worksheet I seem to get an error. wri

[R] nlme Output

2010-09-06 Thread Edward Patzelt
Everyone - What do the NaN's mean here? Is this analysis a problem? Linear mixed-effects model fit by maximum likelihood Data: tmp.dat AIC BIClogLik 1611.251 1638.363 -797.6253 Random effects: Formula: ~1 | group_id (Intercept) Residual StdDev: 0.0003077668 9.23671

Re: [R] extracting x,y coordinates from a contour plot

2010-09-06 Thread Charles Annis, P.E.
Thank you, David: I obviously didn't look hard enough. This is exactly what I need. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org

Re: [R] Correct coefficients from treatment contrasts?

2010-09-06 Thread David Winsemius
On Sep 6, 2010, at 4:03 AM, B W wrote: ->Hello,I am trying to take the information from the summary of my best fit logisticregression model for the occurrence of a high elevation plant spp. and create the appropriate equation that will calculate probability of occurrence, given the data.

Re: [R] inserting a vector as a row in a data.frame

2010-09-06 Thread Ivan Calandra
Hi again, see ?rbind Ivan Le 9/6/2010 14:11, raje...@cse.iitm.ac.in a écrit : > Hi, > > is it possible to insert a vector as a row in a data.frame? > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat

Re: [R] max limit of list size and vector size?

2010-09-06 Thread jim holtman
It is easy to store a list of that size: > x <- list(1:1e6, 1:1e6, 1:1e6) > object.size(x) 12000112 bytes > str(x) List of 3 $ : int [1:100] 1 2 3 4 5 6 7 8 9 10 ... $ : int [1:100] 1 2 3 4 5 6 7 8 9 10 ... $ : int [1:100] 1 2 3 4 5 6 7 8 9 10 ... Now it really depends on how you a

Re: [R] dataframe row names from list

2010-09-06 Thread Ivan Calandra
Hi! I'm sure there's an easier way, but that works for me: test_list <- list(c("ABC","5","0"), c("DEF","10","1")) ##just a part of your example, think about using dput() to create a copy/pastable example test_df <- t(as.data.frame(test_list)[-1,]) rownames(test_df) <- t(as.data.frame(test_list

Re: [R] size limit of string/parse a string and convert to vector

2010-09-06 Thread jim holtman
try this: > x <- "|1,ab,2.34|2,cd,3.44|" > # split by the "|" and remove vectors of zero characters > x.sp <- strsplit(x, '|', fixed = TRUE)[[1]] > x.sp <- x.sp[nchar(x.sp) > 0] > # now split by comma > x.comma <- strsplit(x.sp, ',') > # you can now access you data > x.comma [[1]] [1] "1""ab"

[R] How to get "mypkg-manual.pdf"

2010-09-06 Thread Juliet Ndukum
I am building a package say mypkg. Five months ago, when I built the package I got the mypkg manual in pdf format. Today, after making updates, I build the same package, same name, and steps; unfortunately I do not get the manual in pdf format. Rather I get the following message: cd: can't cd

[R] anova of glm output

2010-09-06 Thread francogrex
Hi, this is more related to understanding some statistics while using R; I've see such output in a paper: out <- glm(response~Var1+Var2+Var3..,family=binomial,data=mydata) summary(out) stepAIC(out) anova(out, test='Chisq') I understand that stepAIC is used to select the model with the lowest AIC (

  1   2   >