[R] object of class madata

2010-07-13 Thread shabnam k
Hi, Am using maanova package for doing anova.But am getting error like this..plz, help me regarding this.. TGR=read.madata(rmaexpr.dat,designfile=design.dat) Reading one color array. Otherwise change arrayType='twoColor' then read the data again Warning messages: 1: In

[R] Three-way Panel Data Analysis

2010-07-13 Thread danice ng
Dear R users, I have panel data on the amount of money spent by travellers from 8 origin countries in 4 destinations. I would like to carry out analysis for destinations, origins and time. However, it seems to me that the package plm can only esitmate two-way panel data (indexed by a

Re: [R] ed50

2010-07-13 Thread Rubén Roa
-Mensaje original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] En nombre de Dipa Hari Enviado el: lunes, 12 de julio de 2010 22:19 Para: r-help@r-project.org Asunto: [R] ed50 I am using semiparametric Model  library(mgcv)

[R] Equivalent of SAS's FIRST. And LAST. Variable in R?

2010-07-13 Thread Wang, Kevin (SYD)
Hi all, I'm just wondering if there is a equivalent of SAS's FIRST. and LAST. variables in R? For example, suppose this is a snapshot of the data: ClientCode CaseCode open closeImportant 1 37 28 2003-07-08 2003-09-021 2

Re: [R] Equivalent of SAS's FIRST. And LAST. Variable in R?

2010-07-13 Thread Martyn Byng
Hi, I expect there are better ways of doing this then the following, but you can probably get the same sort of thing using the split command bb = matrix(c(1,1,1,2,2,2,3,3,3,3,10,11,12,43,23,14,52,52,12,23),ncol=2,byrow =FALSE) aa = split(bb,bb[,1]) sapply(aa,function(temp) {cc =

[R] modifying vector elements

2010-07-13 Thread Lorenzo Cattarino
Hello R-users, I have a very large vector (a) containing elements consisting of numbers and letters, this is the i.e. a [1] 1.11.2a 1.11.2d 1.11.2e 1.11.2f 1.11.2x1 1.11.2x1b [7] 1.11.2x21.11.2x2a 1.11.2x2b 1.11.2x31.11.2x4 1.11.2x4a [13] 1.11.2x5

Re: [R] modifying vector elements

2010-07-13 Thread Bill.Venables
Here is one way a_clip - sub(^([0-9]+\\.[0-9]+\\.[0-9]+).*$, \\1, a) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Lorenzo Cattarino Sent: Tuesday, 13 July 2010 5:20 PM To: r-help@r-project.org Subject: [R] modifying vector

Re: [R] modifying vector elements

2010-07-13 Thread Gabor Grothendieck
On Tue, Jul 13, 2010 at 3:20 AM, Lorenzo Cattarino l.cattar...@uq.edu.au wrote: Hello R-users, I have a very large vector (a) containing elements consisting of numbers and letters, this is the  i.e. a [1] 1.11.2a     1.11.2d     1.11.2e     1.11.2f     1.11.2x1 1.11.2x1b [...] How

Re: [R] Matrix Column Names

2010-07-13 Thread Martin Maechler
DN == David Neu da...@davidneu.com on Mon, 12 Jul 2010 18:15:04 -0400 writes: DN Hi, Is there a way to create a matrix in which the DN column names are not checked to see if they are valid DN variable names? Why do you need that if you are really using a matrix, not a data

Re: [R] How to mean, min lists and numbers

2010-07-13 Thread Jim Lemon
On 07/13/2010 01:10 AM, g...@ucalgary.ca wrote: I would like to sum/mean/min a list of lists and numbers to return the related lists. -1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list. Using the suggestions of Gabor Grothendieck,

[R] Regarding R -installation

2010-07-13 Thread venkatesh bandaru
Dear R-help Team Members, I am venkatesh , Student of university of Hyderabad, while Installing R from the specified servers, I encountered the following problem. please help me regarding. i need this to do my project . Thanking you. *Problem* : Cannot access installation media

[R] Regarding accesing R- Repositories at servers

2010-07-13 Thread venkatesh bandaru
Dear R-help team , I am venkatesh, student of University of Hyderabad, India. I couldn't able to  access R-repositories at Your specified servers.It is giving error such as Couldn't able to access media. Can you please help me Regarding this. i am anticipating for your reply, thanking you.

Re: [R] How can i draw a graph with high and low data points

2010-07-13 Thread Nathaniel Saxe
I have 5 columns- Trial.Group, Mean, Standard Deviation, Upper percentile, Lower percentile. Trial.Group 41 subjects: 3 to 4 yrs-Male Mean 444 SD 25 upper 494 lower 393 and all the data is like that. and i wish to recreate this excel

Re: [R] Question about food sampling analysis

2010-07-13 Thread Richard Weeks
Hi Sarah, We regularly undertake work in the food sector and have developed many custom built solutions. To be more specific, the statistics we employ is that of sensory analysis and we regularly use the sensominer package in R. Regards, Richard Weeks Mangosolutions data analysis that delivers

[R] Barplots

2010-07-13 Thread Ravi S. Shankar
Hi R, I am examining the mean returns 10 days before and 10 days after a event. Now I have several events the corresponding pre and post event 10 day mean returns... something like this Pre_Start Pre_End Pre_MeanPre_SD Post_StartPost_End

[R] Odp: in continuation with the earlier R puzzle

2010-07-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 12.07.2010 16:09:30: When I just run a for loop it works. But if I am going to run a for loop every time for large vectors I might as well use C or any other language. The reason R is powerful is becasue it can handle large vectors without each

[R] Odp: Barplots

2010-07-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.07.2010 12:18:21: Hi R, I am examining the mean returns 10 days before and 10 days after a event. Now I have several events the corresponding pre and post event 10 day mean returns... something like this Pre_Start

Re: [R] Fast string comparison

2010-07-13 Thread Ralf B
I see. I did not get these performances since did not directly compare arrays but run seemingly expensive for-loops to do it iteratively... :( R. On Tue, Jul 13, 2010 at 1:42 AM, Hadley Wickham had...@rice.edu wrote: strings - replicate(1e5, paste(sample(letters, 100, rep = T), collapse

[R] Modify the plotting parameters for Vennerable obj.

2010-07-13 Thread Fabian Grammes
Dear List, I would like to modify the settings for plotting a Vennerable object, but I don't know how...so if anyone has an idea I would be really graetfull. best, Fabian some R code to illustrate my problem: library(Vennerable) ven - compute.Venn(Venn(SetNames=c(A, B),

Re: [R] in continuation with the earlier R puzzle

2010-07-13 Thread Petr PIKAL
Hi I do not use any of mentioned libraries so I can not directly answer it. I would try to use debug(expr.frame) to see at what time the error is thrown. I have no idea why did you obtain error. Try to evaluate code in peaces e.g. what is result of list(MAf=quote(SMA(Last, 20)),

[R] Zoo - bug ???

2010-07-13 Thread sayan dasgupta
Hi folks, I am confused whether the following is a bug or it is fine Here is the explanation a - zoo(c(NA,1:9),1:10) Now If I do rollapply(a,FUN=mean,width=3,align=right) I get rollapply(a,FUN=mean,width=3,align=right) 3 4 5 6 7 8 9 10 NA NA NA NA NA NA NA NA But I shouldn't be

Re: [R] in continuation with the earlier R puzzle

2010-07-13 Thread Raghu
Many many thanks to all of you. The beer cleared the air of doubts! Pls look at the following lines of code. This is taken from the example of tradesys documentation. When I run the given example using the data.frame spx it works just very fine but while I use some other data.frame (here nifty) it

[R] Three-way Panel Data Analysis

2010-07-13 Thread Millo Giovanni
Dear Danice, as far as I know, three-way panels are not considered in the econometrics literature (two dimensions make things complicated enough already). They are also not implemented in plm. You might find support for more elaborate nesting structures in the nlme and lme4 packages. Yet, as the

[R] StartsWith over vector of Strings?

2010-07-13 Thread Ralf B
Given vectors of strings of arbitrary length content - c(abc, def) searchset - c(a, abc, abcdef, d, def, defghi) Is it possible to determine the content String set that matches the searchset in the sense of 'startswith' ? This would be a vector of all strings in content that start with the

Re: [R] Regarding R -installation

2010-07-13 Thread Gavin Simpson
On Tue, 2010-07-13 at 13:39 +0530, venkatesh bandaru wrote: Dear R-help Team Members, I am venkatesh , Student of university of Hyderabad, while Installing R from the specified servers, I encountered the following problem. please help me regarding. i need this to do my project . Thanking

Re: [R] Zoo - bug ???

2010-07-13 Thread Gavin Simpson
On Tue, 2010-07-13 at 17:13 +0530, sayan dasgupta wrote: Hi folks, I am confused whether the following is a bug or it is fine Here is the explanation a - zoo(c(NA,1:9),1:10) Now If I do rollapply(a,FUN=mean,width=3,align=right) mean() has argument na.rm which defaults to FALSE. As

Re: [R] print.trellis draw.in - plaintext (gmail mishap)

2010-07-13 Thread Mark Connolly
That helped. I continued to have issues with draw.in=vplayout(2,2)$name (I guess I still don't understand it use), but the following positions the plot on the grid where I want it. grid.newpage() pushViewport(viewport(layout=grid.layout(2,2))) vp - vplayout(2,2) pushViewport(vp)

Re: [R] Zoo - bug ???

2010-07-13 Thread sayan dasgupta
On Tue, Jul 13, 2010 at 5:27 PM, Gavin Simpson gavin.simp...@ucl.ac.ukwrote: On Tue, 2010-07-13 at 17:13 +0530, sayan dasgupta wrote: Hi folks, I am confused whether the following is a bug or it is fine Here is the explanation a - zoo(c(NA,1:9),1:10) Now If I do

[R] Define package-wide character constants

2010-07-13 Thread Daniel Nüst
Dear list! I develop a package for R and wonder how I can best define package-wide constants (both character strings or named vectors of strings) which are used throughout different classes and methods. I'm new to R and wonder if there is some kind of “best practice” that I just haven't read of

[R] Substring function?

2010-07-13 Thread Ralf B
Hi all, I would like to detect all strings in the vector 'content' that contain the strings from the vector 'search'. Here a code example: content - data.frame(urls=c(

Re: [R] Define package-wide character constants

2010-07-13 Thread Duncan Murdoch
On 13/07/2010 8:20 AM, Daniel Nüst wrote: Dear list! I develop a package for R and wonder how I can best define package-wide constants (both character strings or named vectors of strings) which are used throughout different classes and methods. I'm new to R and wonder if there is some kind of

Re: [R] Zoo - bug ???

2010-07-13 Thread Gavin Simpson
On Tue, 2010-07-13 at 17:41 +0530, sayan dasgupta wrote: On Tue, Jul 13, 2010 at 5:27 PM, Gavin Simpson gavin.simp...@ucl.ac.uk wrote: On Tue, 2010-07-13 at 17:13 +0530, sayan dasgupta wrote: Hi folks, I am confused whether the following is a bug or it

Re: [R] Zoo - bug ???

2010-07-13 Thread Gabor Grothendieck
On Tue, Jul 13, 2010 at 7:43 AM, sayan dasgupta kitt...@gmail.com wrote: Hi folks, I am confused whether the following is a bug or it is fine Here is the explanation a - zoo(c(NA,1:9),1:10) Now If I do rollapply(a,FUN=mean,width=3,align=right) I get

Re: [R] Continuing on with a loop when there's a failure

2010-07-13 Thread David Winsemius
On Jul 13, 2010, at 8:47 AM, Josh B wrote: Thanks again, David. ...but, alas, I still can't get it work! Here's what I'm trying now: for (i in 1:2) { mod.poly3 - try(lrm(x[,i] ~ pol(x1, 3) + pol(x2, 3), data=x)) results[1,i] - anova(mod.poly3)[1,3] } You need to do some

Re: [R] Continuing on with a loop when there's a failure

2010-07-13 Thread David Winsemius
On Jul 13, 2010, at 9:04 AM, David Winsemius wrote: On Jul 13, 2010, at 8:47 AM, Josh B wrote: Thanks again, David. ...but, alas, I still can't get it work! (BTW, it did work.) Here's what I'm trying now: for (i in 1:2) { mod.poly3 - try(lrm(x[,i] ~ pol(x1, 3) + pol(x2, 3),

[R] Generate groups with random size but given total sample size

2010-07-13 Thread Arne Schulz
Dear list, I am currently doing some simulation studies where I want to compare different scenarios. In particular, two scenarios should be compared: 10.000 cases in 100 groups with 100 cases per group and 10.000 cases in 100 groups with random group size (ranging from 5 to 500). The first

Re: [R] Custom nonlinear self starting function w/ 2 covariates

2010-07-13 Thread Sebastien Guyader
Dear all I finally found the way to do it. Nlme accepts simpler functions than selfStart: # Defining my function Myfun -function(x1,x2,Tmax,Topt,B,E) { (((Tmax-x1)/(Tmax-Topt))*(x1/Topt)^(Topt/(Tmax-Topt)))*exp(-exp(B*(log(x2)-log(abs(E) } # Calling nlme nlmefit3 - nlme( y ~

Re: [R] Fast string comparison

2010-07-13 Thread Matt Shotwell
On Tue, 2010-07-13 at 01:42 -0400, Hadley Wickham wrote: strings - replicate(1e5, paste(sample(letters, 100, rep = T), collapse = )) system.time(strings[-1] == strings[-1e5]) # user system elapsed # 0.016 0.000 0.017 So it takes ~1/100 of a second to do ~100,000 string

Re: [R] Substring function?

2010-07-13 Thread Nikhil Kaza
well %in% is really checking if the element is in the set and is not a substring operator. To get the result you want, try content[grepl(search$signatures, content$urls),] For multiple operations you could try sapply(search$signatures, grepl, x=content$urls) Nikhil Kaza Asst. Professor,

[R] RODBC and Excel 2010 xlsx

2010-07-13 Thread Rodrigo Aluizio
Hi List, just to know if the issue is only a problem of mine or if it is a general issue due to the new MS Office pack. I'm using R 2.11.1 32 bits in a Windows 7 x64 with the MS office 2010 x64 installed. I can import .xls files normally (the same way I did with my Excel 2007 32 bits). But the

Re: [R] SAS Proc summary/means as a R function

2010-07-13 Thread Roger Deangelis
Thanks Richard and Erik, I hate to buy the book and not find the solution to the following: proc.means - function() { deparse(match.call()[-1]) } proc.means(this is a sentence) unexpected symbol in proc means(this is) One possible solution would be to 'peek' into the memory buffer

[R] Regarding installation from ROracle

2010-07-13 Thread vikrant
I am using windows Xp OS and R 2.10. I treid to install ROracle package and I got following error:- This application has failed to start because orasql9.dll was not found. Re-installing the application may fix this problem I have already installed the dependecy package DBI Please help

Re: [R] Accessing files on password-protected FTP sites

2010-07-13 Thread Cliff Clive
Thanks for the tip. From the link you posted: | You can embed the user id and password into the URL. For example: | | http://userid:passw...@www.anywhere.com/ | ftp://userid:passw...@ftp.anywhere.com/ I'm still having issues, though. I am trying to fetch some csv files from a storage site

[R] SARIMA model

2010-07-13 Thread FMH
Dear All, Could someone please advice me the appropriate package for fitting the SARIMA model? Thanks Fir __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Continuing on with a loop when there's a failure

2010-07-13 Thread Josh B
Thanks again, David. ...but, alas, I still can't get it work! Here's what I'm trying now: for (i in 1:2) { mod.poly3 - try(lrm(x[,i] ~ pol(x1, 3) + pol(x2, 3), data=x)) results[1,i] - anova(mod.poly3)[1,3] } Here's what happens (from the console): Error in fitter(X, Y, penalty.matrix

Re: [R] Continuing on with a loop when there's a failure

2010-07-13 Thread Josh B
In my opinion the try and tryCatch commands are written and documented rather poorly. Thus I am not sure what to program exactly. For instance, I could query mod.poly3 and use an if/then statement to proceed, but querying mod.poly3 is weird. For instance, here's the output when it fails:

Re: [R] RODBC and Excel 2010 xlsx

2010-07-13 Thread Gabor Grothendieck
On Tue, Jul 13, 2010 at 9:31 AM, Rodrigo Aluizio r.alui...@gmail.com wrote: Hi List, just to know if the issue is only a problem of mine or if it is a general issue due to the new MS Office pack. I'm using R 2.11.1 32 bits in a Windows 7 x64 with the MS office 2010 x64 installed. I can import

Re: [R] interpretation of svm models with the e1071 package

2010-07-13 Thread Steve Lianoglou
Hi, On Sat, Jul 10, 2010 at 12:35 AM, Noah Silverman n...@smartmediacorp.com wrote: Steve, Couldn't he also just use the decision.value property to see the equivilent of t(x) %*% b for each row? I don't follow what you're saying. What is this the equivalent of? What's b here? The

Re: [R] Fast string comparison

2010-07-13 Thread Romain Francois
Hi Matt, I think there are some confusing factors in your results. system.time(strcmp(strings[-1], strings[-1e5])) would also include the time required to perform both subscripting (strings[-1] and strings[-1e5] ) which actually takes some time. Also, you do have a bit of overhead due to

[R] Extract Clusters from Biclust Object - writeBiclusterResults

2010-07-13 Thread delfin13
Update: Solution ## Dear all, just in case someone has the same question: I found the method writeBiclusterResults. It prints the results of all modules together in one file, containing the gene names and array/experiment names. It does not

[R] Dicretizing a normal distribution to predefined bands

2010-07-13 Thread stefano.m
Dear useRs, I am facing the following problem in R and hope you can help me. I want to discretize a normal distribution to 4 predefined bands. The bands are 1,2,10 and 20. In order to maintain the symmetric shape and the mean of the density I need to cut off all negative values and the

Re: [R] interpretation of svm models with the e1071 package

2010-07-13 Thread Steve Lianoglou
Hi, On Mon, Jul 12, 2010 at 4:55 AM, manuel.martin manuel.mar...@orleans.inra.fr wrote: On 07/10/2010 04:11 AM, Steve Lianoglou wrote: On Fri, Jul 9, 2010 at 12:15 PM, manuel.martin manuel.mar...@orleans.inra.fr  wrote: snip Dear all, after having calibrated a svm model through the svm()

[R] Batch file export

2010-07-13 Thread Michael Haenlein
Dear all, I have a code that generates data vectors within R. For example assume: z - rlnorm(1000, meanlog = 0, sdlog = 1) Every time a vector has been generated I would like to export it into a csv file. So my idea is something as follows: for (i in 1:100) { z - rlnorm(1000, meanlog = 0, sdlog

Re: [R] SAS Proc summary/means as a R function

2010-07-13 Thread Duncan Murdoch
On 13/07/2010 8:39 AM, Roger Deangelis wrote: Thanks Richard and Erik, I hate to buy the book and not find the solution to the following: proc.means - function() { deparse(match.call()[-1]) } proc.means(this is a sentence) unexpected symbol in proc means(this is) One possible

Re: [R] Batch file export

2010-07-13 Thread Nikhil Kaza
write.csv(z, paste(c:/z_,i,.csvsep='')) You will have to modify this to prepend 0s. Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Jul 13, 2010, at 10:03 AM, Michael Haenlein wrote: Dear all, I have a code that generates data

Re: [R] RODBC and Excel 2010 xlsx

2010-07-13 Thread Prof Brian Ripley
On Tue, 13 Jul 2010, Rodrigo Aluizio wrote: Hi List, just to know if the issue is only a problem of mine or if it is a general issue due to the new MS Office pack. I'm using R 2.11.1 32 bits in a It's a Microsoft muddle, covered in the RODBC manual for the next release. Note that R-sig-db

Re: [R] How to select the column header with \Sexpr{}

2010-07-13 Thread Ista Zahn
Hi Felipe, The problem has nothing to do with Sweave or \Sexpr. The problem is that by the time you call \Sexpr report is a matrix, and you cannot access the column names of a matrix with names(). You need to use colnames() or convert the matrix to a data.frame. Perhaps a true useR can write R

Re: [R] Continuing on with a loop when there's a failure

2010-07-13 Thread David Winsemius
On Jul 13, 2010, at 9:24 AM, Josh B wrote: In my opinion the try and tryCatch commands are written and documented rather poorly. Thus I am not sure what to program exactly. Didn't you see the silent parameter? Its seems to be documented fairly clearly to me. The testing of try at the

Re: [R] Continuing on with a loop when there's a failure

2010-07-13 Thread David Winsemius
On Jul 13, 2010, at 10:26 AM, David Winsemius wrote: On Jul 13, 2010, at 9:24 AM, Josh B wrote: In my opinion the try and tryCatch commands are written and documented rather poorly. Thus I am not sure what to program exactly. Didn't you see the silent parameter? Its seems to be

[R] how to extract information from anova results

2010-07-13 Thread Luis Borda de Agua
Hi, I have used the instruction aov in the following manner: res - aov(qwe ~ asd) when I typed res I get: _ Call: aov(formula = qwe ~ asd) Terms: asd Residuals Sum of Squares 0.0708704 0.5255957 Deg. of Freedom 1 8 Residual standard error:

Re: [R] how to extract information from anova results

2010-07-13 Thread David Winsemius
On Jul 13, 2010, at 10:35 AM, Luis Borda de Agua wrote: Hi, I have used the instruction aov in the following manner: res - aov(qwe ~ asd) when I typed res I get: _ Call: aov(formula = qwe ~ asd) Terms: asd Residuals Sum of Squares 0.0708704 0.5255957 Deg. of

Re: [R] How to select the column header with \Sexpr{}

2010-07-13 Thread Felipe Carrillo
Thanks Izta: I see your point, then I should extract the column names when the dataset is first read because is a dataframe:  report - structure(list(Date = c(3/12/2010, 3/13/2010, 3/14/2010,  3/15/2010), Run1 = c(33 (119 ? 119), n (0 ? 0), 893 (110 ? 146),  140 (111 ? 150)), Run2 = c(33 (71 ?

Re: [R] Substring function?

2010-07-13 Thread Erik Iverson
The high-level concept you need is called Regular Expressions. R supports these through several functions, see ?regex . Ralf B wrote: Hi all, I would like to detect all strings in the vector 'content' that contain the strings from the vector 'search'. Here a code example: content -

Re: [R] how to extract information from anova results

2010-07-13 Thread Joshua Wiley
I think the easiest way is from calling anova() on your aov class object. For instance y - 1:10 x - runif(10) my.aov - aov(y ~ x) anova(my.aov)[Residuals, Sum Sq] anova(my.aov)[x, Pr(F)] You can also extract these values from a call to summary(my.aov), but that output is a list (even for an

[R] MplusAutomation

2010-07-13 Thread Gushta, Matthew
R list- i have begun using the MplusAutomation while piloting a large-scale simulation (~200,000 replications). since the package takes advantage of the DOS batch mode available in Mplus, each replication starts and activates a new instance of a command prompt window. this effectively locks me

Re: [R] Regarding R -installation

2010-07-13 Thread venkatesh bandaru
Dear nuncio my internet is connected properly, i am running yast as a superuser , i am getting the following error *Problem* : Cannot access installation media http://download.opensuse.org/repositories/devel:languages:R:patched/openSUSE_11.2 (Medium 1). Check whether the server is

Re: [R] isdst warning when rounding a range of time data: fix or suppress?

2010-07-13 Thread philippgrueber
Dear Clay, dear list, I face the same problem when rounding POSIXct objects. Have you (or has anybody) found an explanation meanwhile, or a way to work around this issue? Example: opt-options(digits.secs=3) ts1-as.POSIXct(c(2006-11-01 09:00:00.03, 2006-11-01 09:00:01, 2006-11-01

Re: [R] Robust regression error: Too many singular resamples

2010-07-13 Thread Alexandra Denby
You could try rlm in the MASS package; it doesn't use he resampling step. That seems to do the trick. Thank you! -- View this message in context: http://r.789695.n4.nabble.com/Robust-regression-error-Too-many-singular-resamples-tp2286585p2287468.html Sent from the R help mailing list archive

Re: [R] distributing a value for a given month across the number of weeks in that month

2010-07-13 Thread Dimitri Liakhovitski
Actually, I realized that my task was a bit more complicated as I have different (let's call them) Markets and the dates repeat themselves across markets. And the original code from Gabor gives an error - because dates repeate themselves and apparently zoo cannot handle it. So, I had to do program

Re: [R] Accessing files on password-protected FTP sites

2010-07-13 Thread Erik Iverson
Is it possible to download data from password-protected ftp sites? I saw another thread with instructions for uploading files using RCurl, but I could not find information for downloading them in the RCurl documentation. Did you try the ?getURL function in RCurl? See the `Test the

Re: [R] What is the degrees of freedom in an nlme model

2010-07-13 Thread Greg Snow
If the curves are sufficiently close to sine (cosine) curves and you know the period, then this can be restructured as a linear model and you can avoid all the complexities that come with non-linear models. Further, from your description, it does not sound like you really gain much from using

Re: [R] Fast string comparison

2010-07-13 Thread Matt Shotwell
Good idea Romain, there is quite a bit of type testing in the function versions of STRING_ELT and CHAR, not to mention the function call overhead. Since the types are checked explicitly, I believe this function is safe. All together now... system.time(strings[-1] == strings[-1e5]) user

Re: [R] How to select the column header with \Sexpr{}

2010-07-13 Thread Ista Zahn
Hi Felipe, See in line below. On Tue, Jul 13, 2010 at 11:04 AM, Felipe Carrillo mazatlanmex...@yahoo.com wrote: Thanks Izta: I see your point, then I should extract the column names when the dataset is first read because is a dataframe: That might work, but it's definitely not how I would do

Re: [R] How can i draw a graph with high and low data points

2010-07-13 Thread Greg Snow
There are several functions in several packages for plotting intervals that will give you plots much better than the excel one. The RSiteSearch function or the sos package may help you find those. But it is also easy to create such plots using just a few lines of R code and base graphics.

Re: [R] StartsWith over vector of Strings?

2010-07-13 Thread Greg Snow
content[na.omit(pmatch(searchset, content,,TRUE))] -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Ralf B

Re: [R] What is the degrees of freedom in an nlme model

2010-07-13 Thread Bert Gunter
... Aug;235(2):E97-102). The paper is freely available. The idea is to fit the curves individually and obtain the residual sum of squares and then fit the curves altogether somehow constraining some parameters and then you have another residual sum of squares. Then you can do a F-test.

Re: [R] Generate groups with random size but given total sample size

2010-07-13 Thread Greg Snow
For one definition of random: ss - rexp(100) ss - ss/sum(ss) ss - 5 + round( ss*9500 ) cnt - 0 while( ( d - sum(ss) - 1 ) != 0 ) { tmpid - sample.int(100,1) ss[tmpid] - ss[tmpid] - d ss[ ss 500 ] - 500 ss[ ss 5 ] - 5 cnt - cnt + 1

Re: [R] MplusAutomation

2010-07-13 Thread Jeff Newmiller
Create a shortcut that targets your batch file and edit its properties to open minimized, and call the shortcut from R rather than the calling the batch file directly. Gushta, Matthew mgus...@air.org wrote: R list- i have begun using the MplusAutomation while piloting a large-scale simulation

Re: [R] distributing a value for a given month across the number of weeks in that month

2010-07-13 Thread Gabor Grothendieck
On Tue, Jul 13, 2010 at 11:19 AM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Actually, I realized that my task was a bit more complicated as I have different (let's call them) Markets and the dates repeat themselves across markets. And the original code from Gabor gives an

[R] Time Variable and Historical Interest Rates

2010-07-13 Thread Aaditya Nanduri
Guys, I wrote to the finance mailing list earlier with my questions but was directed here. Sorry for the repeat. --- library(quantmod) now - Sys.time() midnight - strptime()# I want to make this a static variable that will be equal to 12:00:00 am but I dont know

Re: [R] Calculate confidence interval of the mean based on ANOVA

2010-07-13 Thread Paul
Paul wrote: I am trying to recreate an analysis that has been done by another group (in SAS I believe). I'm stuck on one part, I think because my stats knowledge is lacking, and while it's OT, I'm hoping someone here can help. Given this dataframe; snip Well, that will teach me to read the

[R] hclust information in a table

2010-07-13 Thread Ralph Modjesch
i try to show the result of the cluster-analysis (hclust, method=ward) in a table with following information first column: height second column: number of clusters third column: clustering information 0,041 | 20 | (3)-(5) 0,111 | 19 | (6)-(11) 0,211 | 18 |

Re: [R] distributing a value for a given month across the number of weeks in that month

2010-07-13 Thread Dimitri Liakhovitski
Thank you very much, Gabor! Dimitri On Tue, Jul 13, 2010 at 12:25 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Tue, Jul 13, 2010 at 11:19 AM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Actually, I realized that my task was a bit more complicated as I have different

Re: [R] SAS Proc summary/means as a R function

2010-07-13 Thread schuster
Hello, are you trying to pase SAS code (or lightly modified SAS code) and run it in R? Then you are right: the hard part is parsing the code. I don't believe that's possible without a custom parser, and even then it's really hard to parse all the SAS sub languages right: data step, macro

[R] Wrap column headers caption

2010-07-13 Thread Felipe Carrillo
Hi: Using this dataframe with quite long column headers, how can I wrap the text so that the columns are narrower. I was trying to use strwrap without success. Thanks reportDF - structure(list(IDDate = c(3/12/2010, 3/13/2010, 3/14/2010, 3/15/2010), FirstRunoftheYear = c(33 (119 ? 119), n (0 ?

Re: [R] Calculate confidence interval of the mean based on ANOVA

2010-07-13 Thread Joshua Wiley
N_runs -1 seems a bit of an odd df to choose to calculate the CI for a mean. To answer your question, I think that t.test() is the easiest way to get a CI in R. That said, you can use the MS_residuals from ANOVA to take advantage of variance calculated on groups and pooled. Something like: foo

Re: [R] SAS Proc summary/means as a R function

2010-07-13 Thread Frank E Harrell Jr
What is the original intent? The bandwidth:productivity ratio is not looking encouraging for this problem. Frank On 07/13/2010 12:38 PM, schuster wrote: Hello, are you trying to pase SAS code (or lightly modified SAS code) and run it in R? Then you are right: the hard part is parsing the

Re: [R] Wrap column headers caption

2010-07-13 Thread Henrique Dallazuanna
You can't try this: sapply(names(reportDF), toString, width = 10) abbreviate(names(reportDF)) On Tue, Jul 13, 2010 at 2:43 PM, Felipe Carrillo mazatlanmex...@yahoo.comwrote: Hi: Using this dataframe with quite long column headers, how can I wrap the text so that the columns are narrower. I

Re: [R] [R-pkgs] New package list for analyzing list surveyexperiments

2010-07-13 Thread Raubertas, Richard
I agree that 'list' is a terrible package name, but only secondarily because it is a data type. The primary problem is that it is so generic as to be almost totally uninformative about what the package does. For some reason package writers seem to prefer maximally uninformative names for

Re: [R] Wrap column headers caption

2010-07-13 Thread Erik Iverson
Using this dataframe with quite long column headers, how can I wrap the text so that the columns are narrower. I was trying to use strwrap without success. Thanks reportDF - structure(list(IDDate = c(3/12/2010, 3/13/2010, 3/14/2010, 3/15/2010), FirstRunoftheYear = c(33 (119 ? 119), n (0 ?

Re: [R] StartsWith over vector of Strings?

2010-07-13 Thread Ralf B
When running the combined code with your suggested line: content - data.frame(urls=c( http://www.google.com/search?source=ighl=enrlz==q=stuffaq=faqi=g10aql=oq=gs_rfai=CrrIS3VU8TJqcMJHuzASm9qyBBgAAAKoEBU_QsmVh;,

Re: [R] StartsWith over vector of Strings?

2010-07-13 Thread Greg Snow
My solution was based on using vectors (which were your original example), now you are using data frames. The actual result is NA, then you just print content again (which my code never modified) so you are going to see the full content data frame. Try:

[R] RJSONIO install problem

2010-07-13 Thread christiaan pauw
Hi everybody I am trying to install RJSONIO from source in on Mac OS X 10.5.8. I used the Package Installer. The message and sessionInfo is attached below Can someone help me to understand the error message and maybe give hint towards solving the problem thanks in advance Christiaan Message:

[R] Boxplot: Scale outliers

2010-07-13 Thread Robert Peter
Hello! I am trying to scale the outliers in a boxplot. I am passing pars = list(boxwex=0.1, staplewex=0.1, outwex=0.1) to the boxplot command. The boxes are scaled correctly, but the circles (outliers) are not scaled at all, and thus pretty big compared to the boxes scaled with 0.1. Am I

Re: [R] Time Variable and Historical Interest Rates

2010-07-13 Thread Joshua Wiley
On Tue, Jul 13, 2010 at 9:54 AM, Aaditya Nanduri aaditya.nand...@gmail.com wrote: Guys, I wrote to the finance mailing list earlier with my questions but was directed here. Sorry for the repeat. --- library(quantmod) now - Sys.time() midnight - strptime()        #

[R] working out main effect variance when different parameterization is used and interaction term exists

2010-07-13 Thread Adaikalavan Ramasamy
Dear all, Apologies if this question is bit theoretical and for the longish email. I am meta-analyzing the coefficients and standard errors from multiple studies where the raw data is not available. Each study analyst runs a model that includes an interaction term for, say, between sex and

Re: [R] [R-pkgs] New package list for analyzing list surveyexperiments

2010-07-13 Thread Erik Iverson
Raubertas, Richard wrote: I agree that 'list' is a terrible package name, but only secondarily because it is a data type. The primary problem is that it is so generic as to be almost totally uninformative about what the package does. For some reason package writers seem to prefer

[R] Need help on index for time series object

2010-07-13 Thread Megh Dal
Dear all, Please forgive me if there is a duplicate post; my previous mail perhaps didnt reach the list... Let say I have following time series library(zoo) dat1 - zooreg(rnorm(10), start=as.Date(2010-01-01), frequency=1) dat1[c(3, 7,8)] = NA dat1 2010-01-01 2010-01-02 2010-01-03

Re: [R] Need help on index for time series object

2010-07-13 Thread Jonathan Christensen
Megh, I don't know whether this is the best way, but it works: seq(1,length(dat1))[!is.na(dat1)] [1] 1 2 4 5 6 9 10 Jonathan On Tue, Jul 13, 2010 at 1:58 PM, Megh Dal megh700...@yahoo.com wrote: Dear all, Please forgive me if there is a duplicate post; my previous mail perhaps

[R] export tables to excel files on multiple sheets with titles for each table

2010-07-13 Thread eugen pircalabelu
Hello R-users, Checking the archives, I recently came across this topic: export tables to Excel files (http://r.789695.n4.nabble.com/export-tables-to-Excel-files-td1565679.html#a1565679), and the following interesting references have been proposed:

  1   2   >