Re: [R] Problems with PDF/Latex when building a package

2010-04-02 Thread Prof Brian Ripley
One thing I noticed is the '2007' in there. Fedora also is stuck at TexLive 2007 but that is getting old and some CRAN packages do not work with it (and conversely some do despite errors in vignettes that are uncoverd in TeXlive 2009). So this may not apply to Erin, but developers are advised

[R] smoothing with sapa package and decibel function

2010-04-02 Thread mj
Hello, I'm new to R. In Sapa package there's an example for function SDF like data <- as.numeric(sunspots) methods <- c("direct","wosa","multitaper","lag window") S <- lapply(methods, function(x, data) SDF(data, method=x), data) x <- attr(S[[1]], "frequency")[-1] y <- lapply(S,function(x) decibel(

[R] McDonald's omega calculation. How to???

2010-04-02 Thread spats
hi people, I am a newbie to R and I would appreciate it very much if someone can help me. I am used to use SPSS so I don’t have experience with writing a script. I have a questionnaire (questions 1-12) and I would like to use the omega reliability. Question 1-8 is factor 1 and question 9-12 factor

Re: [R] "moving product", by rows, of a dataframe?

2010-04-02 Thread Gabor Grothendieck
Try this: > library(zoo) > t(rollapply(zoo(t(mydata)), 3, na.pad = TRUE, align = "right", FUN = prod)) 1 2 3 4 5 6 x.1 NA NA 861 52521 202581 499041 x.2 NA NA 1848 57288 213528 518568 x.3 NA NA 2967 62307 224847 538587 x.4 NA NA 4224 67584 236544 559104 x.5

Re: [R] panel data

2010-04-02 Thread Gabor Grothendieck
Try this: > as.data.frame.table(tapply(DF[,3], DF[2:1], c), responseName = names(DF)[3]) YEAR ID HEIGHT 1 2007 Harry 62 2 2008 Harry 62 3 2007 Jack 70 4 2008 Jack NA 5 2007 James 68 6 2008 James NA 7 2007 Jordan NA 8 2008 Jordan 72 9 2007 M

[R] Writing summary.aov results to a file which can be opened in Excel

2010-04-02 Thread Julia_2010
Hi everyone, I'm fairly new to R (and this forum!), so first of all apologies if this question has already been answered (I've tried searching the forum but haven't come across anything which has solved the problem I'm having). I have a data frame containing an "independent variable" and a serie

[R] "moving product", by rows, of a dataframe?

2010-04-02 Thread Anna Stevenson
What is a "good" way to calculate the "moving product", for each row of a dataframe, where I wish to be able to specify the length of the moving product? Depending on my needs, I'd like to be able to specify the "length" over which to calculate the moving average (in this example, length=3). Fo

Re: [R] compare multiple values with vector and return vector

2010-04-02 Thread Joris Meys
This was actually the one I was looking for, thx. It's actually essentially a wrapper for %in%, can't imagine I missed that one. I tried it out but I put the vectors in the wrong order (giving a vector of length 3). Guess it's too late to think clearly. Cheers On Sat, Apr 3, 2010 at 12:55 AM, wr

Re: [R] can't read excel file with read.xls()

2010-04-02 Thread array chip
Thanks for the link, very useful. A simple fix to the code using normalizePath(), or full path name. read.xls(normalizePath("ttt.xls")) --- On Fri, 4/2/10, Gabor Grothendieck wrote: > From: Gabor Grothendieck > Subject: Re: [R] can't read excel file with read.xls() > To: "array chip" > Cc:

Re: [R] Problems with PDF/Latex when building a package

2010-04-02 Thread Barry Rowlingson
On Fri, Apr 2, 2010 at 11:43 PM, Erin Hodgess wrote: > Dear R People: > > I'm building a packages on an Ubuntu Karmic Koala 9.10 system and am > getting the following errors: > > > * checking PDF version of manual ... WARNING > LaTeX errors when creating PDF version. > This typically indicates Rd

Re: [R] can't read excel file with read.xls()

2010-04-02 Thread Gabor Grothendieck
Read about the bugs and workarounds on this page: http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows&s=excel On Fri, Apr 2, 2010 at 6:56 PM, array chip wrote: > Hi, I encountered a problem of not being able to read in an excel spreadsheet > using read.xls() in the xlsReadWrite package

[R] Nonparametric Canonical Correlation

2010-04-02 Thread Ryan Cooper
Has anyone authored a Nonparametric approach to Canonical Correlation? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, m

[R] can't read excel file with read.xls()

2010-04-02 Thread array chip
Hi, I encountered a problem of not being able to read in an excel spreadsheet using read.xls() in the xlsReadWrite package. can anyone help? Here is an example code write.xls(matrix(1:9,nrow=3),"ttt.xls") read.xls("ttt.xls") Error in read.xls("ttt.xls") : Unexpected error. Message: Can't fin

Re: [R] compare multiple values with vector and return vector

2010-04-02 Thread mohamed . lajnef
Hi Joris Try Is.element function: is.element (x,y) Regards mohamed Joris Meys a écrit : Dear all, I have a vector, and for each element I want to check whether it is equal to any element from another vector. I want a vector of logical values with the length of the first one as return. In R

[R] Problems with PDF/Latex when building a package

2010-04-02 Thread Erin Hodgess
Dear R People: I'm building a packages on an Ubuntu Karmic Koala 9.10 system and am getting the following errors: * checking PDF version of manual ... WARNING LaTeX errors when creating PDF version. This typically indicates Rd problems. LaTeX errors found: ! Font T1/ptm/m/n/10=ptmr8t at 10.0pt n

Re: [R] compare multiple values with vector and return vector

2010-04-02 Thread Rolf Turner
On 3/04/2010, at 11:35 AM, Joris Meys wrote: > Dear all, > > I have a vector, and for each element I want to check whether it is equal to > any element from another vector. I want a vector of logical values with the > length of the first one as return. In R this would be : > >> x <- 1:10 >> sap

[R] compare multiple values with vector and return vector

2010-04-02 Thread Joris Meys
Dear all, I have a vector, and for each element I want to check whether it is equal to any element from another vector. I want a vector of logical values with the length of the first one as return. In R this would be : > x <- 1:10 > sapply(x,function(y){any(y==c("2","3","4"))}) [1] FALSE TRUE T

[R] tetrachoric correlations

2010-04-02 Thread HAKAN DEMIRTAS
Hi, Is there any R library/package that calculates tetrachoric correlations from given marginals and Pearson correlations among ordinal variables? Inputs to polychor function in polycor package are either contingency tables or ordinal data themselves. I am looking for something that takes marg

Re: [R] Extracting 'SOME' values from a linear model.

2010-04-02 Thread HouseBandit
David Winsemius wrote: > > > On Apr 2, 2010, at 5:32 PM, HouseBandit wrote: > >> >> my goal is to return the selected fitted values ... > > Which were never really "selected". > >> ... and then perform a sum of >> squares calcuation with them. I have looked at 'list' etc but cant >> retur

[R] Arellano -- how to generate data for y given t

2010-04-02 Thread forgotmystatslol
See topic -- View this message in context: http://n4.nabble.com/Arellano-how-to-generate-data-for-y-given-t-tp1749656p1749656.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

Re: [R] lineplot.CI in "sciplot": option "ci.fun" can't be changed?

2010-04-02 Thread Tao Shi
Thanks, Manuel! > Subject: Re: lineplot.CI in "sciplot": option "ci.fun" can't be changed? > From: manuel.a.mora...@williams.edu > To: shi...@hotmail.com > CC: r-help@r-project.org; mmora...@williams.edu > Date: Fri, 2 Apr 2010 14:22:33 -0400 > > For now,

Re: [R] Extracting 'SOME' values from a linear model.

2010-04-02 Thread David Winsemius
On Apr 2, 2010, at 5:32 PM, HouseBandit wrote: my goal is to return the selected fitted values ... Which were never really "selected". ... and then perform a sum of squares calcuation with them. I have looked at 'list' etc but cant return anything. Its either all of the fitted values or

Re: [R] Cross-validation for parameter selection (glm/logit)

2010-04-02 Thread Bert Gunter
Inline below: Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steve Lianoglou Sent: Friday, April 02, 2010 2:34 PM To: Jay Cc: r-help@r-project.org Subject: Re: [R] Cross-validation for

[R] vector length help using prcomp

2010-04-02 Thread JRsalvelinus
Hi I am doing PCA using prcomp and when I try to get predicted values for the different PC's the number of data points is always one less than in my original data set. This is a problem because it prevents me from doing any post-hoc analysis due to the fact that my dependent variables are one en

Re: [R] Cross-validation for parameter selection (glm/logit)

2010-04-02 Thread Steve Lianoglou
Hi, On Fri, Apr 2, 2010 at 9:14 AM, Jay wrote: > If my aim is to select a good subset of parameters for my final logit > model built using glm(). What is the best way to cross-validate the > results so that they are reliable? > > Let's say that I have a large dataset of 1000's of observations. I

Re: [R] Extracting 'SOME' values from a linear model.

2010-04-02 Thread HouseBandit
my goal is to return the selected fitted values and then perform a sum of squares calcuation with them. I have looked at 'list' etc but cant return anything. Its either all of the fitted values or just the first and last of the sub set that I need. Cheers -- View this message in context: http:

Re: [R] Extracting 'SOME' values from a linear model.

2010-04-02 Thread David Winsemius
On Apr 2, 2010, at 5:14 PM, HouseBandit wrote: I have a regression model that I have used on some data and to look at its accuracy compared to some other models I have been extracting the same 10% of the real data to perform a sum of squares calculation this is what I have tried but it g

Re: [R] Using GIS data in R

2010-04-02 Thread Rolf Turner
On 2/04/2010, at 4:37 AM, Scott Duke-Sylvester wrote: > I have a simple problem: I need to load a ERSI shapefile of US states > and check whether or not a set of points are within the boundary of > these states. I have the shapefile, I have the coordinates but I'm > having a great deal of difficu

[R] Extracting 'SOME' values from a linear model.

2010-04-02 Thread HouseBandit
I have a regression model that I have used on some data and to look at its accuracy compared to some other models I have been extracting the same 10% of the real data to perform a sum of squares calculation this is what I have tried but it gives me the '0.9*length(t)' fitted value and the 'length

Re: [R] Adding regression lines to each factor on a plot when using ANCOVA

2010-04-02 Thread Peter Ehlers
On 2010-04-02 11:07, Michael Friendly wrote: This is a nice example; thanks for providing it in this form. I tried to trim it down to show fewer groups, but ran into the following errors that I can't understand: ## keep species 1:6 > dataset <- subset(dataset, species < 7) Warning message: In

Re: [R] [R-sig-DB] How to save a model in DB and retrieve It

2010-04-02 Thread Jeff Ryan
A very simple option, since you're only looking to efficiently store and retrieve, is something like a key-value store. There is a new rredis (redis) package on CRAN, as well as the RBerkeley (Oracle Berkeley DB) package. RBerkeley is as simple as db_put() and db_get() calls where you specify a k

[R] model reparameterization

2010-04-02 Thread casperyc
== y=c(100,200,300,400,500) treatment=c(1,2,3,3,4) block=c(1,1,2,3,3) summary(lm(y~as.factor(treatment)+as.factor(block))) == The aim is to find a model that can estimate the comparison between treatment 1 with 2 and treatment 3 wit

Re: [R] panel data

2010-04-02 Thread David Winsemius
On Apr 2, 2010, at 3:39 PM, Geoffrey Smith wrote: Hello, I have an unbalanced panel data set that looks like: ID,YEAR,HEIGHT Tom,2007,65 Tom,2008,66 Mary,2007,45 Mary,2008,50 Harry,2007,62 Harry,2008,62 James,2007,68 Jack,2007,70 Jordan,2008,72 That is, James, Jack, and Jordan are missing a Y

[R] optim doesnt work with my function

2010-04-02 Thread nmolanogunal
#Hello, i have created this function, but optim doesnt maximize it, just return the value at the inits W<-function(l){ w<-rep(0,dim(D)[1]) for(i in 1:dim(D)[1]){ w[i]<-PAitk(D[i,],D[-i,],l) } return(prod(w)) } #D is a matrix with entires in {0,1}, l is a vector which length(l)= dim(D)[2] #PAitk i

Re: [R] mouse-clicking on xy-plot

2010-04-02 Thread Walmes Zeviani
You can use identify() to obtain coordinates from plotted points but if you want any coordinates you could use locator(): > plot(1:10) > loc <- locator(n=3) > str(loc) List of 2 $ x: num [1:3] 2.3 5.4 8.29 $ y: num [1:3] 6.15 8.33 2.6 > points(loc$x, loc$y, col=2) > Walmes. - ..ooo0

[R] my mail to post

2010-04-02 Thread nicolas nicolas
nmola...@gmail.com -- Att: Nicolás Molano [[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/posting-guide.html and p

Re: [R] mouse-clicking on xy-plot

2010-04-02 Thread Erik Iverson
Are you thinking of ?identify ? Nuno Prista wrote: Hi, I seem to recall coming across a function that allowed one to mouse-click on an xy-plot and obtain x and y coordinates. Can anyone remind me its name? Thanks, Nuno __ R-help@r-project.org mail

[R] Simple plot of values and error bars: Is there an existing function for this

2010-04-02 Thread John Kane
In an OpenOffice.org forum someone asked if it was possible to plot some raw data and then add a line for the confidence interval. Example at  http://www.graphpad.com/help/Prism5/scatter%20-%20grouped.png While it may be possible to do this in OOo's spreadsheet program it looks nasty (both to

[R] mouse-clicking on xy-plot

2010-04-02 Thread Nuno Prista
Hi, I seem to recall coming across a function that allowed one to mouse-click on an xy-plot and obtain x and y coordinates. Can anyone remind me its name? Thanks, Nuno __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] All sub-summands of a vector

2010-04-02 Thread Andy Rominger
Great, thanks for your help. I tried: x <- 1:1 y <- lapply(1:1,function(t){t*runmean(x,t,alg="fast",endrule="trim")}) and it worked in about 90 sec. Thanks again, Andy On Fri, Apr 2, 2010 at 3:43 PM, Gabor Grothendieck wrote: > There is also rollmean in the zoo package which might be

[R] panel data

2010-04-02 Thread Geoffrey Smith
Hello, I have an unbalanced panel data set that looks like: ID,YEAR,HEIGHT Tom,2007,65 Tom,2008,66 Mary,2007,45 Mary,2008,50 Harry,2007,62 Harry,2008,62 James,2007,68 Jack,2007,70 Jordan,2008,72 That is, James, Jack, and Jordan are missing a YEAR. Is there any command that will "fill in" the mis

[R] lineplot.CI in "sciplot": option "ci.fun" can't be changed?

2010-04-02 Thread Tao Shi
hi List and Manuel, I have encounter the following problem with the function "lineplot.CI".  I'm running R 2.10.1, sciplot 1.0-7 on Win XP.  It seems like it's a scoping issue, but I couldn't figure it out. Thanks! ...Tao > lineplot.CI(x.factor = dose, response = len, data = ToothGrowth)  

Re: [R] Sharing levels across multiple factor vectors

2010-04-02 Thread Jeff Brown
Ah, I finally figured it out: I had asked > In both of those cases, why is the [] needed? It's because when on the left hand side of an assignment, the bracket operator attempts to preserve the class and dimension of the object it's subsetting. (Or at least, that's true when the object is a

Re: [R] lineplot.CI in "sciplot": option "ci.fun" can't be changed?

2010-04-02 Thread Manuel Morales
For now, just change fun(x) to median(x) (or whatever) in your ci.fun() below. E.g. lineplot.CI(x.factor = dose, response = len, data = ToothGrowth, ci.fun= function(x) c(mean(x)-2*se(x), mean(x)+2*se(x))) Otherwise, maybe the list members could help with a solution. An example that illustrates

Re: [R] Selecting the first row based on a factor

2010-04-02 Thread Sam Albers
Thanks! On Fri, Apr 2, 2010 at 11:35 AM, Erik Iverson wrote: > Hello, > > > Sam Albers wrote: > >> Hello there, >> >> I have a situation where I would like to select the first row of a >> particular factor for a data frame (data example below). So that is, I >> would >> like to select the first

[R] compare two fingerprint images

2010-04-02 Thread Juan Antonio Gil Pascual
Hello I wanted to compare two fingerprint images. How do you do with R?. Is there a role for cross-correlation of images? Thanks -- = Juan Antonio Gil Pascual Prof. Titular de Métodos de Investigación en Educación correo: j...@edu.uned.es w

Re: [R] All sub-summands of a vector

2010-04-02 Thread Gabor Grothendieck
There is also rollmean in the zoo package which might be slightly faster since its optimized for that operation. k * rollmean(x, k) e.g. > 2 * rollmean(1:4, 2) [1] 3 5 7 will give a rolling sum. runmean in the caTools package is even faster. On Fri, Apr 2, 2010 at 2:31 PM, Jorge Ivan Velez wrot

Re: [R] Selecting the first row based on a factor

2010-04-02 Thread Erik Iverson
Hello, Sam Albers wrote: Hello there, I have a situation where I would like to select the first row of a particular factor for a data frame (data example below). So that is, I would like to select the first entry when the factor1 =A and then the first row when factor1=B etc. I have thousands of

Re: [R] All sub-summands of a vector

2010-04-02 Thread Jorge Ivan Velez
Hi Andy, Take a look at the rollapply function in the zoo package. > require(zoo) Loading required package: zoo > x <- 1:4 > rollapply(zoo(x), 1, sum) 1 2 3 4 1 2 3 4 > rollapply(zoo(x), 2, sum) 1 2 3 3 5 7 > rollapply(zoo(x), 3, sum) 2 3 6 9 > rollapply(zoo(x), 4, sum) 2 10 # all at once sappl

[R] Selecting the first row based on a factor

2010-04-02 Thread Sam Albers
Hello there, I have a situation where I would like to select the first row of a particular factor for a data frame (data example below). So that is, I would like to select the first entry when the factor1 =A and then the first row when factor1=B etc. I have thousands of entries so I need some gene

[R] All sub-summands of a vector

2010-04-02 Thread Andy Rominger
Hello, I'd like to take all possible sub-summands of a vector in the quickest and most efficient way possible. By "sub-summands" I mean for each sub-vector, take its sum. Which is to say: if I had the vector x<-1:4 I'd want the "sum" of x[1], x[2], etc. And then the sum of x[1:2], x[2:3], etc

Re: [R] Adding regression lines to each factor on a plot when using ANCOVA

2010-04-02 Thread RICHARD M. HEIBERGER
Michael and others, Here is my complete ancova example http://astro.ocis.temple.edu/~rmh/HH/hotdog.pdf This example, especially in Figure 6, places them in a context of a Cartesian product of models with the intercept having two levels and slope having three levels. It is based on the ancova c

Re: [R] R package checking error.

2010-04-02 Thread Uwe Ligges
The error message "F used instead of FALSE" is pretty clear to me ...: Use FALSE rather than F in your code. Uwe Ligges On 30.03.2010 07:36, Dong H. Oh wrote: Dear useRs, I am trying to build my package (nonpareff) which deals with some models of data envelopment analysis. The building work

Re: [R] Trouble loading package

2010-04-02 Thread Uwe Ligges
On 28.03.2010 21:20, Peter Ehlers wrote: I haven't seen an answer to this yet. Your problem may stem from having defined a variable T. I can replicate your error messages with: T <- "hello" library(RMark) So methinks that this probably indicates that there may be a problem with using T for T

Re: [R] Merge failure using zoo package

2010-04-02 Thread Gabor Grothendieck
On Fri, Apr 2, 2010 at 1:01 PM, William Dunlap wrote: >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org] On Behalf Of e-letter >> Sent: Friday, April 02, 2010 9:20 AM >> To: Gabor Grothendieck >> Cc: r-help@r-project.org >> Subject: Re: [R]

Re: [R] How to save a model in DB and retrieve It

2010-04-02 Thread Greg Snow
Look at the serialize function, it may accomplish what you want. -- 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

Re: [R] angles

2010-04-02 Thread Greg Snow
Look at the my.symbols function in the TeachingDemos package. You can get line segments using the ms.arrows function and setting the length argument to 0 (or you can make your own plotting function by copying ms.arrows and replacing the call to arrows with a call to segments). Hope this helps

Re: [R] Adding regression lines to each factor on a plot when using ANCOVA

2010-04-02 Thread Michael Friendly
This is a nice example; thanks for providing it in this form. I tried to trim it down to show fewer groups, but ran into the following errors that I can't understand: ## keep species 1:6 > dataset <- subset(dataset, species < 7) Warning message: In Ops.factor(species, 7) : < not meaningful for

Re: [R] Merge failure using zoo package

2010-04-02 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of e-letter > Sent: Friday, April 02, 2010 9:20 AM > To: Gabor Grothendieck > Cc: r-help@r-project.org > Subject: Re: [R] Merge failure using zoo package > > On 02/04/2010, Gabor Gr

[R] angles

2010-04-02 Thread Tom_R
Hi R users, I would like to construct a sort hybrid vector/scatter plot. My data is in the following format: 3-column x,y,z data-frame in which every row is a separate data-point. The x & y columns are coordinates, and the z column contains orientation data (range 0-180 degrees, with East=0 & N

Re: [R] Merge failure using zoo package

2010-04-02 Thread Gabor Grothendieck
Below is the format that was requested. This has the data followed by the corrected code at the end. There are several things that were wrong: 1. z1[,2] is wrong since z1 is a vector, not a 2d matrix. Ditto for z2. Ideally zoo would have given an error message but in any case its wrong. It sh

Re: [R] R abrupt exit

2010-04-02 Thread Peter Ehlers
Google leads to some discussion on the Intel Sofware Network: http://software.intel.com/en-us/forums/showthread.php?t=64585 Be warned: I haven't read the discussion. -Peter Ehlers On 2010-04-02 9:30, jacob wrote: Dear Lists: I recently ran quite annoyance problem while running R on Ubuntu

Re: [R] Merge failure using zoo package

2010-04-02 Thread e-letter
On 02/04/2010, Gabor Grothendieck wrote: > The code does not run with the files. I need the requested > information, namely a single file containing code and data and that I > can just copy into a session without editing and see the result you > see. I don't understand how I can combine the four

Re: [R] Exporting Nuopt from splus to R

2010-04-02 Thread Uwe Ligges
On 02.04.2010 01:16, Jp2010 wrote: Hi all, Thanks for the wonderful forum with all the valuable help and comments here. I have been a splus user for the past 7 to 8 years and now crossing the mind of changing over to R. Have been doing a lot of reading and one of the main reasons is being an

Re: [R] Merge failure using zoo package

2010-04-02 Thread Gabor Grothendieck
The code does not run with the files. I need the requested information, namely a single file containing code and data and that I can just copy into a session without editing and see the result you see. On Fri, Apr 2, 2010 at 11:27 AM, e-letter wrote: > On 02/04/2010, Gabor Grothendieck wrote: >

Re: [R] mcmcglmm starting value example

2010-04-02 Thread Jarrod Hadfield
Dear Ping, It is not possible to pass starting values for the fixed effects. It doesn't make much sense to give starting values for the fixed effects because they can be Gibbs sampled in a single pass conditional on the latent variables and the (co)variance components - after a single ite

[R] R abrupt exit

2010-04-02 Thread jacob
Dear Lists: I recently ran quite annoyance problem while running R on Ubuntu 9.10. When running the program, the system suddenly exit from the R session with the following warnings: # OMP: Hint: This may cause performance degradation and correctness is

Re: [R] Merge failure using zoo package

2010-04-02 Thread e-letter
On 02/04/2010, Gabor Grothendieck wrote: > The files only have one data column. What is the meaning of x[,2], > etc. ? What is z1? > I only want to merge one column from one file with one column from another file. With [x,2], I am trying to select the column of data. > Please provide reproduci

Re: [R] Exporting Nuopt from splus to R

2010-04-02 Thread Ben Bolker
Jp2010 yahoo.com> writes: >From my understanding it is going to be difficult, is that my understanding > right.? Probably impossible ... TIBCO, or whoever owns S-PLUS now (I don't pay much attention, so it's hard for me to keep track) does try to achieve as much R-compatibility as possible:

Re: [R] Merge failure using zoo package

2010-04-02 Thread Gabor Grothendieck
The files only have one data column. What is the meaning of x[,2], etc. ? What is z1? Please provide reproducible code and data all in a single file using this style so its clear what is what. Also please cut down the size of your data to the smallest size that will still illustrate the problem

Re: [R] Summing data based on certain conditions

2010-04-02 Thread David Winsemius
On Apr 2, 2010, at 10:36 AM, Steve Murray wrote: Dear all, Thanks for the contributions so far. I've had a look at these and the closest I've come to solving it is the following: data_ave <- ave(data$rammday, by=c(data$month, data$year)) Warning messages: 1: In split.default(x, g) : d

Re: [R] Cross-validation for parameter selection (glm/logit)

2010-04-02 Thread JLucke
Jay Unless I have misunderstood some statistical subtleties, you can use the AIC in place of actual cross-validation, as the AIC is asymptotically equivalent to leave-out-one cross-validation under MLE. Joe Stone, M. An asymptotic equivalence of choice of model by cross-validation and Akaike's

Re: [R] Merge failure using zoo package

2010-04-02 Thread e-letter
Data files test1, ...2, ...3, ...4 respectively. time1,dataset1 01:01:00,0.73512097 01:01:30,0.34860813 01:02:00,0.61306418 01:02:30,0.01495898 01:03:00,0.27035612 01:03:30,0.69513898 01:04:00,0.46451758 01:04:30,0.61672569 01:05:00,0.82496122 01:05:30,0.34766154 01:06:00,0.69618714 01:06:30,0.390

Re: [R] roccomp

2010-04-02 Thread joann
Thank you, Ravi, I have looked at that package, but I don't see any method to compare two ROC curves. I beleive the method used by roccomp is based on Delong. JoAnn From: Ravi Kulkarni [via R] [ml-node+1748903-1261333028-216...@n4.nabble.com] Sent: Friday, April

Re: [R] POSIX primer

2010-04-02 Thread Doran, Harold
Beautiful. Thank you. -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Friday, April 02, 2010 10:59 AM To: Doran, Harold Cc: r-help@r-project.org Subject: Re: [R] POSIX primer On Fri, Apr 2, 2010 at 10:49 AM, Doran, Harold wrote: > I have not used POSIX

Re: [R] Summing data based on certain conditions

2010-04-02 Thread Phil Spector
Steve - Take a closer look at the help page for ave(), especially the ... argument. Try data_ave <- ave(data$rammday, data$month, data$year,FUN=mean) (Assuming you want to calculate the mean -- your example didn't specify a function.) - Phil Spector

Re: [R] POSIX primer

2010-04-02 Thread Gabor Grothendieck
On Fri, Apr 2, 2010 at 10:49 AM, Doran, Harold wrote: > I have not used POSIX classes previously and now have a need to use them. I > have sports data with times of some athletes The main reason to use POSIXct is if you need time zones. If you don't then you might be better off with chron. See

[R] Merge failure using zoo package

2010-04-02 Thread e-letter
Readers, Please refer to attached example data files. It seems that the merge function fails for the latter section of the data set. Command terminal output: > library(chron) > library(zoo) > x<-read.zoo("test1.csv",header=TRUE,sep=",",FUN=times) > y<-read.zoo("test2.csv",header=TRUE,sep=",",FUN=

Re: [R] Summing data based on certain conditions

2010-04-02 Thread ONKELINX, Thierry
Dear Steve, Multiplying the mean with the number of observations is essentially the same as summing the numbers. Have a look at the plyr packages. library(plyr) ddply(data, c("month", "year"), function(x){ c(MeanMultiplied = mean(x$ramm) * nrow(x), Sum = sum(x$ramm)) }) --

[R] POSIX primer

2010-04-02 Thread Doran, Harold
I have not used POSIX classes previously and now have a need to use them. I have sports data with times of some athletes after different events. I need to perform some simple analyses using the times. I think I've figured out how to do this. I just want to confirm with others who have more exper

[R] Cross-validation for parameter selection (glm/logit)

2010-04-02 Thread Jay
If my aim is to select a good subset of parameters for my final logit model built using glm(). What is the best way to cross-validate the results so that they are reliable? Let's say that I have a large dataset of 1000's of observations. I split this data into two groups, one that I use for traini

Re: [R] Summing data based on certain conditions

2010-04-02 Thread Steve Murray
Dear all, Thanks for the contributions so far. I've had a look at these and the closest I've come to solving it is the following: > data_ave <- ave(data$rammday, by=c(data$month, data$year)) Warning messages: 1: In split.default(x, g) :   data length is not a multiple of split variable 2: In sp

[R] (no subject)

2010-04-02 Thread Terry Therneau
> I'm using rpart function for creating regression trees. > now how to measure the fitness of regression tree??? > > thanks n Regards, > Vibha I read R-help as a digest so often come late to a discussion. Let me start by being the first to directly answer the question: > fit <- rpart(time ~ ag

Re: [R] Plots don't update with xlab, etc. What am I doing wrong.

2010-04-02 Thread David Winsemius
On Apr 2, 2010, at 9:56 AM, Marshall Feldman wrote: Hi, I've been struggling with this problem the last few days and finally discovered it's happening at a very fundamental level. Going through Stephen Turner's tutorial on ggplot2, I entered these base graphics commands: with(diamonds, plot(

Re: [R] build Mac distribution for R package

2010-04-02 Thread David Winsemius
On Apr 2, 2010, at 9:26 AM, wenjun zheng wrote: Dear R users, can somebody give me some suggestions about how to build Mac distribution on my own Mac OS It appears you have not read the most basic background information yet: http://cran.r-project.org/doc/manuals/R-admin.pdf -- David.

[R] Plots don't update with xlab, etc. What am I doing wrong.

2010-04-02 Thread Marshall Feldman
Hi, I've been struggling with this problem the last few days and finally discovered it's happening at a very fundamental level. Going through Stephen Turner's tutorial on ggplot2, I entered these base graphics commands: > with(diamonds, plot(carat,price)) > with(diamonds, plot(carat,

Re: [R] timeseries plot

2010-04-02 Thread Gabor Grothendieck
Here are a few ways: Try this: set.seed(123) TS <- ts(1:25 + rnorm(25)) tt <- time(TS) tt.pred <- end(tt)[1] + 1:10 both <- ts(c(TS, predict(lm(TS ~ tt), list(tt = tt.pred ts.plot(both, TS, gpars = list(type = "o", col = 2:1, pch = 20)) and read ?ts, ?start, ?ts.plot and next time please pro

[R] build Mac distribution for R package

2010-04-02 Thread wenjun zheng
Dear R users, can somebody give me some suggestions about how to build Mac distribution on my own Mac OS Thanks -- Wenjun [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Derivative of a smooth function

2010-04-02 Thread Ravi Varadhan
Please learn how to use `RsiteSearch' before posting questions to the list: RSiteSearch("derivative smooth function") This should have provided you with plenty of solutions. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Di

Re: [R] [R-SIG-Finance] Derivative of a smooth function

2010-04-02 Thread Jeff Ryan
Please keep in mind this question has absolutely nothing to do with finance, and therefore needs to instead be directed to R-help. Thanks in advance for keeping the R-finance list on topic. Jeff On Fri, Apr 2, 2010 at 3:36 AM, FMH wrote: > > Dear All, > > I've been searching for appropriate cod

Re: [R] What should I do regarding "DLL attempted to change..." warning ?

2010-04-02 Thread Prof Brian Ripley
On Fri, 2 Apr 2010, Duncan Murdoch wrote: On 02/04/2010 7:01 AM, Tal Galili wrote: Hi all, The call to: library(rJava) Results in the following warning massage: Warning message: In inDL(x, as.logical(local), as.logical(now), ...) : DLL attempted to change FPU control word from 8001f to 900

[R] timeseries plot

2010-04-02 Thread vibha patel
Hello, I am using plot( ) function to plot time-series. it takes time-series object as an argument but i want to plot predicted data with training set, to compare them. is there any function available? Vibha [[alternative HTML version deleted]] ___

Re: [R] plot area: secondary y-axis does not display well

2010-04-02 Thread Ivan Calandra
Hi Muhammad, The problem is that you set the par() options before creating your png. I've tried, and it works if you do this: ... # x and y png("image.png") par(mar=c(5,5,5,7)+0.1) # inner margin par(oma=c(3,3,3,7))# outer margin ... # rest of your code HTH, Ivan Le 4/2/2010 12:12, Muhammad

[R] Restricting optimisation algorithm's parameter space in GNLM

2010-04-02 Thread dominikj
Hello, I have a problem. I am using the NLME library to fit a non-linear model. There is a linear component to the model that has a couple parameter values that can only be positive (the coefficients are embedded in a sqrt). When I try and fit the model to data the search algorithm tries t

[R] what is the significance of RSq in earth function??

2010-04-02 Thread vibha patel
Hello, I'm using earth function for Multivariate Adaptive Regression splines. what is the significance of RSq in earth function?? following's the code. printed value is of RSq. > tr.wage<-sample(1:nrow(HCMwage), 0.8*nrow(HCMwage)) > tst.wage<- (1:nrow(HCMwage))[-tr.wage] > HCMwageModel<-earth(V

Re: [R] What should I do regarding "DLL attempted to change..." warning ?

2010-04-02 Thread Tal Galili
Thanks Duncan and Romain, I'll go and do that. with regards, Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.

Re: [R] What should I do regarding "DLL attempted to change..." warning ?

2010-04-02 Thread Duncan Murdoch
On 02/04/2010 7:01 AM, Tal Galili wrote: Hi all, The call to: library(rJava) Results in the following warning massage: Warning message: In inDL(x, as.logical(local), as.logical(now), ...) : DLL attempted to change FPU control word from 8001f to 9001f After some searching I found the follow

Re: [R] Odp: plot area: secondary y-axis does not display well

2010-04-02 Thread Muhammad Rahiz
Thanks Ivan, Jim and Petr. The output turns out as desired after I've taken your suggestions. Muhammad __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-

Re: [R] time series problem: time points don't match

2010-04-02 Thread Gabor Grothendieck
On Thu, Apr 1, 2010 at 7:08 PM, Gabor Grothendieck wrote: > Perhaps something like this: > > library(zoo) > library(chron) > # read in data > > Lines1 <- "date            time            level           temp > 2009/10/01 00:01:52.0      2.8797      18.401 > 2009/10/01 00:16:52.0      2.8769      1

[R] Odp: plot area: secondary y-axis does not display well

2010-04-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.04.2010 12:12:02: > Dear useRs, > > I'm having a slight problem with plotting on 2 axes. While the following > code works alright on screen, the saved output does not turn out as > desired i.e. the secondary y-axis does not display fully. > > Jus

  1   2   >