Re: [R] Functional data analysis - problems with smoothing

2009-10-23 Thread Peter Ehlers
The error message is pretty clear: regardless of what *you* think, R says that 'isi' is not numeric. Are you sure that 'isi' is not a *factor* object? I'm willing to bet that it is. Use str() to check your data. -Peter Ehlers Benjamin Cheah wrote: Hi all, I'm having major issues with

[R] coxph() and survfit()

2009-10-23 Thread Mura Tamakou
Dear All, I have a question regarding the output of survfit() when I supply a Cox model. Lets say for example: library(survival) fit - coxph(Surv(time, status == 2) ~ factor(spiders), data = pbc) fit # HR for spiders is significant newdata - data.frame(spiders = factor(0:1)) sf -

[R] cut2 once, bin twice...

2009-10-23 Thread sdanzige
Hello, I'm using the Hmisc cut2 function to bin a set of data. It produces bins that I like with results like this: [96,270]:171 [69, 96): 54 [49, 69): 40 [35, 49): 28 [28, 35): 14 [24, 28): 8 (Other) : 48 I would like to take a second set of data, and assign it to bins based on factors

Re: [R] cut2 once, bin twice...

2009-10-23 Thread Dieter Menne
sdanzige wrote: I'm using the Hmisc cut2 function to bin a set of data. It produces bins that I like with results like this: [96,270]:171 [69, 96): 54 [49, 69): 40 [35, 49): 28 [28, 35): 14 [24, 28): 8 (Other) : 48 I would like to take a second set of data, and assign it to

Re: [R] twoord.plot y lab size

2009-10-23 Thread Jim Lemon
On 10/22/2009 10:26 PM, Jacob Kasper wrote: I am using twoord.plot and my Y axis units on the left y overlap. I tried using cex.axis in my par command but that only adjusted the x units, not the y. cex.axis in twoord.plot did not help. How do I adjust Y units in the twoord.plot? example:

Re: [R] Bayesian regression stepwise function?

2009-10-23 Thread spencerg
Charles C. Berry wrote: On Thu, 22 Oct 2009, Ben Bolker wrote: Allan.Y wrote: Hi everyone, I am wondering if there exists a stepwise regression function for the Bayesian regression model. I tried googling, but I couldn't find anything. I know step function exists for regular stepwise

Re: [R] Functional data analysis - problems with smoothing

2009-10-23 Thread spencerg
Hi, Ben: Which chapter in which of Ramsay's books? For his most recent book (Functional Data Analysis with R and Matlab, with Giles Hooker and your's truly), there is one script file for each chapter with names like fdarm-ch01.R, ... fdarm-ch11.R. These script files reproduce

Re: [R] PDF too large, PNG bad quality

2009-10-23 Thread Jim Lemon
On 10/23/2009 06:07 AM, Lasse Kliemann wrote: I wish to save a scatter plot comprising approx. 2 million points in order to include it in a LaTeX document. Using 'pdf(...)' produces a file of size about 20 MB, which is useless. Using 'cairo_pdf(...)' produces a smaller file, around 3 MB. This

[R] data file with columns of unequal length

2009-10-23 Thread William Simpson
I am running an expt that presents a point process input x and measures a point process output y. The times of each event are recorded. The lengths of the data records of x and y are necessarily different, and can be different by a factor of 10. I would like to save these data after each

Re: [R] data file with columns of unequal length

2009-10-23 Thread Jim Lemon
On 10/23/2009 07:58 PM, William Simpson wrote: I am running an expt that presents a point process input x and measures a point process output y. The times of each event are recorded. The lengths of the data records of x and y are necessarily different, and can be different by a factor of 10. I

[R] standard errors in bbmle

2009-10-23 Thread alexander russell
Hello, Mle2 is a little unforthcoming in the matter of standard errors? Is there a way to ask the program to supply standard errors along with estimates in cases when it doesn't print them 'voluntarily'? regards, s [[alternative HTML version deleted]]

Re: [R] data file with columns of unequal length

2009-10-23 Thread Peter Dalgaard
Jim Lemon wrote: On 10/23/2009 07:58 PM, William Simpson wrote: I am running an expt that presents a point process input x and measures a point process output y. The times of each event are recorded. The lengths of the data records of x and y are necessarily different, and can be different by

Re: [R] standard errors in bbmle

2009-10-23 Thread Peter Dalgaard
alexander russell wrote: Hello, Mle2 is a little unforthcoming in the matter of standard errors? Is there a way to ask the program to supply standard errors along with estimates in cases when it doesn't print them 'voluntarily'? regards, s What did you do? Which cases? Did you look at the

Re: [R] data file with columns of unequal length

2009-10-23 Thread William Simpson
The way you do it is to compute the cross-intensity function (you can google this; a key name is David Brillinger). The general problem is that of system identification for point processes. Bill On Fri, Oct 23, 2009 at 10:31 AM, Jim Lemon j...@bitwrit.com.au wrote: On 10/23/2009 07:58 PM,

Re: [R] data file with columns of unequal length

2009-10-23 Thread William Simpson
As I understand it, they don't come in pairs anyway. Correct. For the same reason a data frame is just the wrong kind of data structure. If you don't want separate data files, you can use one file with two columns where the second column is (say) 1 for the x and 2 for the y. Could you

Re: [R] data file with columns of unequal length

2009-10-23 Thread William Simpson
Thanks Jim. BTW the times in x and y are in ascending order (time of occurrence). If I do it this way, how do I actually read the data in and store in the file? Toy code, please. Bill Hi Bill, xy-list(x=1:10,y=1:100) Note that this cheerfully ignores how you are going to figure out which

Re: [R] data file with columns of unequal length

2009-10-23 Thread Peter Dalgaard
William Simpson wrote: As I understand it, they don't come in pairs anyway. Correct. For the same reason a data frame is just the wrong kind of data structure. If you don't want separate data files, you can use one file with two columns where the second column is (say) 1 for the x and 2

Re: [R] data file with columns of unequal length

2009-10-23 Thread William Simpson
OK thanks, I look at sleep and get it Bill On Fri, Oct 23, 2009 at 12:21 PM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: William Simpson wrote: As I understand it, they don't come in pairs anyway. Correct. For the same reason a data frame is just the wrong kind of data structure. If you

Re: [R] data file with columns of unequal length

2009-10-23 Thread Jim Lemon
On 10/23/2009 10:07 PM, William Simpson wrote: Thanks Jim. BTW the times in x and y are in ascending order (time of occurrence). If I do it this way, how do I actually read the data in and store in the file? Toy code, please. Hi Bill, This seems a bit like some heartbeat data that I had

Re: [R] data file with columns of unequal length

2009-10-23 Thread Jim Lemon
On 10/23/2009 10:07 PM, William Simpson wrote: Thanks Jim. BTW the times in x and y are in ascending order (time of occurrence). If I do it this way, how do I actually read the data in and store in the file? Toy code, please. Hi Bill, This seems a bit like some heartbeat data that I had to

Re: [R] arima crashes too

2009-10-23 Thread Alberto Monteiro
Barry Rowlingson wrote: However, arima crashes for this: arima(c(1.71, 1.78, 1.95, 1.59, 2.13), order=c(1,0,0)) I'm not getting what I'd call 'crashes' with your arma or arima examples- I get an error message and a warning: arma(c(2.01, 2.22, 2.09, 2.17, 2.42), order=c(1,0)) Error in

[R] opposite estimates from zeroinfl() and hurdle()

2009-10-23 Thread Tord Snäll
Dear all, A question related to the following has been asked on R-help before, but I could not find any answer to it. Input will be much appreciated. I got an unexpected sign of the slope parameter associated with a covariate (diam) using zeroinfl(). It led me to compare the estimates given

Re: [R] a problem about integrate function in R .thank you .

2009-10-23 Thread andrew
I don't seem to get a problem with this. Have you tried a Monte Carlo approach to verify that you are getting incorrect answers? For me, I get when the upper is 1 that integrate(e2, lower = 0, upper = 1) -0.2820948 with absolute error 5e-05 sum(e2(runif(1)))/1 [1] -0.2825667 which

Re: [R] arima crashes too

2009-10-23 Thread Barry Rowlingson
On Fri, Oct 23, 2009 at 12:32 PM, Alberto Monteiro albm...@centroin.com.br wrote: I mean that, if I run a loop, it doesn't finish. Or, more catastrophically, if I am running a loop and saving data to an open file, it terminates the loop and does not close the file. Reproducible example:

[R] reset par() within plot layout

2009-10-23 Thread Janke ten Holt
Dear list, I would like to produce a matrix of plots, where par() is reset after each plot (see below [simplified] example). When I use layout() to do so, I seem to also reset the layout. I have not been able to figure out how to prevent this from happening. Any help is greatly appreciated!

Re: [R] reset par() within plot layout

2009-10-23 Thread stephen sefick
Maybe something like this? #Desired result is a layout of 2 plots: one red and one black par(mfrow=c(2,1)) par(col=red) plot(1:100) par(col=black) plot(1:10) On Fri, Oct 23, 2009 at 7:26 AM, Janke ten Holt j.c.ten.h...@rug.nl wrote: Dear list, I would like to produce a matrix of plots,

Re: [R] Functional data analysis - problems with smoothing

2009-10-23 Thread Benjamin Cheah
Hi Peter and Spencer (and everyone else out there), Thank you for your prompt reply to my post re. FDA - FYI - i'm very new to R and FDA. Currently half way through a biostats masters degree in Sydney, Australia! Absolutely loving it and I hope to include R computing on my future CV! Just to

Re: [R] reset par() within plot layout

2009-10-23 Thread Janke ten Holt
OK, maybe I oversimplified the example, because you are of course correct... I am working on a function, which I feed data to plot in layouts of specified dimensions. I want to be able to set any par() variables for each plot in the layout. Because the next plot does not know which par()

[R] Wavelets

2009-10-23 Thread Ashta
Hi all, I am trying to do wavelets and I got an error message saying The length of data is not a power of 2 Is there a way of handing that? or should the data length be exactly the power of 2? I am using R version 2.9.2 (2009-08-24) The is library(wavethresh). wds -

Re: [R] Wavelets

2009-10-23 Thread stephen sefick
I believe that you can extend it to the power of 2 by padding it with zeros. I don't remember if it is at the begining or the end of the time series. hth stephen On Fri, Oct 23, 2009 at 7:56 AM, Ashta sewa...@gmail.com wrote: Hi all, I am trying to do wavelets and I got  an error message

Re: [R] Wavelets

2009-10-23 Thread Josué Polanco
hi all, I don't use the package wavethresh, but I suppose that should be possible to fill of ZEROS (zero padding) the time series, such that its length has a 2^n elements. Another way is to cut (remove) some elements, so that, the new length has 2^n elements. You can get more info. @ A practical

Re: [R] twoord.plot y lab size

2009-10-23 Thread Peter Ehlers
For now, you might be able to use par(las=1). You may have to make enough margin room with par(mar=...) and you'll probably want to set ylab= and add the y-label with mtext(). -Peter Ehlers Jim Lemon wrote: On 10/22/2009 10:26 PM, Jacob Kasper wrote: I am using twoord.plot and my Y axis

Re: [R] How to find moving averages within each subgroup of a data frame

2009-10-23 Thread clair.crossup...@googlemail.com
Dear all, If I have the following data frame: set.seed(21) df1 - data.frame(col1=c(rep('a',5), rep('b',5), rep('c',5)), col4=rnorm(1:15)) col1 col4 1 a 0.793013171 2 a 0.522251264 3 a 1.74641 4 a -1.271336123 5 a 2.197389533 6 b 0.433130777 7

Re: [R] data frame is killing me! help

2009-10-23 Thread bbslover
Steve Lianoglou-6 wrote: Hi, On Oct 22, 2009, at 2:35 PM, bbslover wrote: Usage data(gasoline) Format A data frame with 60 observations on the following 2 variables. octane a numeric vector. The octane number. NIR a matrix with 401 columns. The NIR spectrum and I see the

[R] opposite estimates from zeroinfl() and hurdle()

2009-10-23 Thread Tord Snäll
Dear all, A question related to the following has been asked on R-help before, but I could not find any answer to it. Input will be much appreciated. I got an unexpected sign of the slope parameter associated with a covariate (diam) using zeroinfl(). It led me to compare the estimates given

Re: [R] Wavelets

2009-10-23 Thread Josué Polanco
hi all, On Fri, Oct 23, 2009 at 3:05 PM, stephen sefick ssef...@gmail.com wrote: I believe that you can extend it to the power of 2 by padding it with zeros.  I don't remember if it is at the begining or the end of the time series. hth at the end of the time series Cheers, -- Josue Polanco

[R] access elements of a named list using a factor

2009-10-23 Thread Robin Hankin
Hi I have a factor 'f' and a named list 'jj'. I want names(jj) to match up with levels(f). How do I use levels(f) to access elements of jj? f - factor(c(pigs,pigs,slugs)) f [1] pigs pigs slugs Levels: pigs slugs jj - list(pigs=1:10,slugs=1:3) My attempts to produce jj$pigs all give

[R] Memory Problems with CSV and Survey Objects

2009-10-23 Thread Anthony Damico
I'm working with a 350MB CSV file on a server that has 3GB of RAM, yet I'm hitting a memory error when I try to store the data frame into a survey design object, the R object that stores data for complex sample survey data. When I launch R, I execute the following line from Windows: C:\Program

Re: [R] access elements of a named list using a factor

2009-10-23 Thread Dimitris Rizopoulos
do you mean: f - factor(c(pigs, pigs, slugs)) jj - list(pigs = 1:10, slugs = 1:3) jj[levels(f)[1]] jj[[levels(f)[1]]] Best, Dimitris Robin Hankin wrote: Hi I have a factor 'f' and a named list 'jj'. I want names(jj) to match up with levels(f). How do I use levels(f) to access elements

[R] Inserting rows

2009-10-23 Thread Ashta
Hi all, I have the data set df with three varaibles, x1 x2 x3 1 2 5 2 4 1 5 6 0 1 1 2 I want to insert more rows ( eg, 3 rows with value filled with zeros) 1 2 5 2 4 1 5 6 6 1 1 2 0 0 0 0 0 0 0 0 0 Can any body help me out? Thanks

Re: [R] access elements of a named list using a factor

2009-10-23 Thread Robin Hankin
Hello Dimitris thanks for this. It works! I guess I was fixated on the dollar sign. I must confess that I don't really understand any of the error messages below. Can anyone help me interpret them? rksh Dimitris Rizopoulos wrote: do you mean: f - factor(c(pigs, pigs, slugs)) jj -

Re: [R] Inserting rows

2009-10-23 Thread Henrique Dallazuanna
Try this: rbind(df, matrix(0, 3, 3, dimnames = list(NULL, names(df On Fri, Oct 23, 2009 at 11:44 AM, Ashta sewa...@gmail.com wrote: Hi all, I have the data set  df with three varaibles, x1 x2 x3 1  2   5 2  4   1 5  6   0 1  1   2 I want to insert more rows ( eg, 3 rows with

Re: [R] data frame is killing me! help

2009-10-23 Thread James W. MacDonald
bbslover wrote: Steve Lianoglou-6 wrote: Hi, On Oct 22, 2009, at 2:35 PM, bbslover wrote: Usage data(gasoline) Format A data frame with 60 observations on the following 2 variables. octane a numeric vector. The octane number. NIR a matrix with 401 columns. The NIR spectrum and I see the

Re: [R] reset par() within plot layout

2009-10-23 Thread Tom Gottfried
Janke, Janke ten Holt schrieb: Dear list, I would like to produce a matrix of plots, where par() is reset after each plot (see below [simplified] example). When I use layout() to do so, I seem to also reset the layout. I have not been able to figure out how to prevent this from happening.

Re: [R] reset par() within plot layout

2009-10-23 Thread Janke ten Holt
Tom Gottfried wrote: Janke, Janke ten Holt schrieb: Dear list, I would like to produce a matrix of plots, where par() is reset after each plot (see below [simplified] example). When I use layout() to do so, I seem to also reset the layout. I have not been able to figure out how to

Re: [R] Functional data analysis - problems with smoothing

2009-10-23 Thread Peter Ehlers
Ben, I lose my bet! Good thing my opinion is never worth more than $.02. Looking at the code for smooth.spline() I see that, although 'argvals' is the first argument to the function, the error message is generated by the second argument. [** Spencer, is this intentional? **] So, Ben, try

Re: [R] Inserting rows

2009-10-23 Thread John Kane
?rbind df1 - data.frame(matrix(rep(0,9),nrow=3)) names(df1) - c(x1,x2,x3) rbind(df,df1) --- On Fri, 10/23/09, Ashta sewa...@gmail.com wrote: From: Ashta sewa...@gmail.com Subject: [R] Inserting rows To: R help r-help@r-project.org Received: Friday, October 23, 2009, 9:44 AM Hi all, I

[R] Change positions of columns in data frame

2009-10-23 Thread Joel Fürstenberg-Hägg
Hi all, Probably a simple question, but I just can't find a simple answear in the older threads or anywhere else. I've added some new vectors as columns in a data frame using cbind(). As they're all put as the last columns inte the data frame, I would like to move them to specific positions.

Re: [R] Bayesian regression stepwise function?

2009-10-23 Thread Ravi Varadhan
If 'fools rush in where angels fear to tread', then Bayesians 'jump' in where frequentists fear to 'step'... Very nice, Chuck! Definitely one for my list of fortunes. Ravi. --- Ravi Varadhan, Ph.D. Assistant

Re: [R] PDF too large, PNG bad quality

2009-10-23 Thread Vijaya Parthiban
Hello Lasse, Why not try this? (1) Create 20MB PDF from R (2) use convert command in linux, examples below: convert -resize 50% 20mbfile.pdf smallerfile.pdf convert -resize 75% 20mbfile.pdf image.png Ghostscript can help you as well for conversion! Using vector formats (pdf,ps,eps) are good

Re: [R] Change positions of columns in data frame

2009-10-23 Thread John Kane
dataframe xx x1 x2 x3 1 2 5 2 4 1 5 6 0 1 1 2 data.frame(xx$x2,xx$x1,xx$x3) # or Awkward but works --- On Fri, 10/23/09, Joel Fürstenberg-Hägg joel_furstenberg_h...@hotmail.com wrote: From: Joel Fürstenberg-Hägg joel_furstenberg_h...@hotmail.com Subject: [R] Change positions

[R] Nested logit in GEV family

2009-10-23 Thread Min Chen
Hi All, I know someone has posted similar messages before, but there is no reply. So I wonder whether there is a way to run a nested logit model in R. It is in the GEV family; however, the commands fitting GEV don't seem to work for nested logit. Or maybe I have to write down the

Re: [R] How to make R packages?

2009-10-23 Thread Peng Yu
These two are for windows. I have a linux machine. Are there any other reference for linux? On Fri, Oct 23, 2009 at 12:08 AM, Jorge Ivan Velez jorgeivanve...@gmail.com wrote: Hi Peng, Also, take a look at the following links: http://robjhyndman.com/research/Rpackages_notes.pdf

[R] Documenting related data sets

2009-10-23 Thread Michael Friendly
Say I want to include the data from Minard's march on Moscow graphic in a package. They consist of three data frames, Minard.troops, Minard.cities, Minard.temp. I've determined that I can document them all in one .Rd file, Minard.Rd, that starts: \name{Minard} \Rdversion{1.1} \alias{Minard}

Re: [R] Change positions of columns in data frame

2009-10-23 Thread Peter Ehlers
DF[ ,names(DF)[c(your_preferred_order)]] -Peter Ehlers Joel Fürstenberg-Hägg wrote: Hi all, Probably a simple question, but I just can't find a simple answear in the older threads or anywhere else. I've added some new vectors as columns in a data frame using cbind(). As they're all put as

Re: [R] standard errors in bbmle

2009-10-23 Thread Ben Bolker
Peter Dalgaard wrote: alexander russell wrote: Hello, Mle2 is a little unforthcoming in the matter of standard errors? Is there a way to ask the program to supply standard errors along with estimates in cases when it doesn't print them 'voluntarily'? regards, s What did you do?

Re: [R] removing random effect from nlme or using varPower() in nls

2009-10-23 Thread Michael A. Gilchrist
Hi Kingsford, That's exactly what I was looking for! Thanks. Mike On Thu, 22 Oct 2009, Kingsford Jones wrote: help(gnls, pack=nlme) hth, Kingsford Jones On Thu, Oct 22, 2009 at 4:36 PM, Michael A. Gilchrist mi...@utk.edu wrote: Hello, I've been fitting a random effects model using

Re: [R] cut2 once, bin twice...

2009-10-23 Thread Gabor Grothendieck
On Fri, Oct 23, 2009 at 3:58 AM, Dieter Menne dieter.me...@menne-biomed.de wrote: sdanzige wrote: I'm using the Hmisc cut2 function to bin a set of data.  It produces bins that I like with results like this: [96,270]:171 [69, 96): 54 [49, 69): 40 [35, 49): 28 [28, 35): 14 [24, 28):  

Re: [R] How to find moving averages within each subgroup of a data frame

2009-10-23 Thread Gabor Grothendieck
Try this: df1$SMA - ave(df1$col4, df1$col1, FUN = function(x) c(NA, (head(x, -1) + tail(x, -1))/2)) It would also be possible to convert it from long form to wide form using reshape (or read.zoo in the devel version of zoo), convert that to a zoo series and the use rollapply in the zoo package.

Re: [R] reset par() within plot layout

2009-10-23 Thread Peter Ehlers
Janke ten Holt wrote: Tom Gottfried wrote: Janke, Janke ten Holt schrieb: Dear list, I would like to produce a matrix of plots, where par() is reset after each plot (see below [simplified] example). When I use layout() to do so, I seem to also reset the layout. I have not been able to

Re: [R] How to make R packages?

2009-10-23 Thread Steve Lianoglou
Hi Pen, On Oct 23, 2009, at 10:31 AM, Peng Yu wrote: These two are for windows. I have a linux machine. Are there any other reference for linux? The steps are pretty much the same. For instance, in robjhyndman.com link, you can simply start from step 2 and go on. Also, the official

[R] reference for mahalanobis {stats}

2009-10-23 Thread Peng Yu
The help on mahalanobis {stats} does not include any reference. I'm interested in understand why Mahalanobis is defined in its current way and how to use it. Could somebody point me a good book on this? I have looked through a few books, but they all give very light explanation on it.

Re: [R] cut2 once, bin twice...

2009-10-23 Thread sdanzige
Dieter Menne wrote: It used to be quite tricky, but on popular request Brian Ripley has added an example how to extract the intervals using regular expression on the bottom of the examples for cut (note:cut in base, not cut2 in Hmisc). Thank you, but the regular expression example

Re: [R] Change positions of columns in data frame

2009-10-23 Thread Phil Spector
Joel - Suppose the columns are named x1, x2, x3, x4, and x5. You can use subscripting: x[c('x2','x4','x1','x3','x5')] or, to save typing the quotes subset(x,select=c(x2,x4,x1,x3,x5)) - Phil Spector

Re: [R] cut2 once, bin twice...

2009-10-23 Thread sdanzige
sdanzige wrote: Thank you, but the regular expression example doesn't seem to work correctly. I wrote a regular expression that does seem to work, so I'll post it here for anyone else that needs it. labs-levels(df$p_bin) cbind(lower=as.numeric(sub([[(],,sub(,.*,,labs))),

Re: [R] reference for mahalanobis {stats}

2009-10-23 Thread Steve Lianoglou
Hi, On Oct 23, 2009, at 11:36 AM, Peng Yu wrote: The help on mahalanobis {stats} does not include any reference. I'm interested in understand why Mahalanobis is defined in its current way and how to use it. Could somebody point me a good book on this? I have looked through a few books, but

[R] Determining which file is newer

2009-10-23 Thread Dennis Fisher
Colleagues, I wish to execute a task only if a particular file is newer than a second file. I can access the file modification dates using file.info()$mtime. This yields a time object (? POSIX). sizeisdir modemtime ctime

Re: [R] opposite estimates from zeroinfl() and hurdle()

2009-10-23 Thread Ben Bolker
Tord Snäll-4 wrote: Dear all, A question related to the following has been asked on R-help before, but I could not find any answer to it. Input will be much appreciated. I got an unexpected sign of the slope parameter associated with a covariate (diam) using zeroinfl(). It led me to

Re: [R] arima crashes too

2009-10-23 Thread Alberto Monteiro
Barry Rowlingson wrote: If you're doing anything in a loop that has the potential to fail because of singularities or other conditions when your model can't be fitted, you need to stick what you are doing in a 'try' clause. This lets you trap errors and do something with them. Plenty

Re: [R] Determining which file is newer

2009-10-23 Thread Henrik Bengtsson
Have a look at your company name and your phone number. Nudge nudge, wink wink, say no more... /H On Fri, Oct 23, 2009 at 9:02 AM, Dennis Fisher fis...@plessthan.com wrote: Colleagues, I wish to execute a task only if a particular file is newer than a second file.  I can access the file

Re: [R] Determining which file is newer

2009-10-23 Thread Barry Rowlingson
On Fri, Oct 23, 2009 at 5:02 PM, Dennis Fisher fis...@plessthan.com wrote: Colleagues, I wish to execute a task only if a particular file is newer than a second file.  I can access the file modification dates using file.info()$mtime. This yields a time object (? POSIX).                      

Re: [R] Change positions of columns in data frame

2009-10-23 Thread Tom Gottfried
You can change the order of nearly everything just by applying an appropriate index and assigning to the original object. Something like data - data[,order_of_columns] Tom Joel Fürstenberg-Hägg schrieb: Hi all, Probably a simple question, but I just can't find a simple answear in the

Re: [R] How to make R packages?

2009-10-23 Thread David M Smith
On Fri, Oct 23, 2009 at 12:10 AM, Peng Yu pengyu...@gmail.com wrote: I found the following document on making R packages. But it is old. I'm wondering if there is more current ones and hopefully more complete ones. Friedrich Leisch made an excellent tutorial for making R packages, with a

[R] Capturing lagged values?

2009-10-23 Thread Arthur Burke
Consider a data structure where header rows supply ID values (school and grade in the example below) that are not captured in subsequent rows df - read.table(textConnection( school grade studentid score 101 5 NA NA NA NA 123 21 NA NA 124 25 201 6 NA NA NA NA 231 33), header=TRUE)

Re: [R] coxph() and survfit()

2009-10-23 Thread tlumley
On Thu, 22 Oct 2009, Mura Tamakou wrote: Dear All, I have a question regarding the output of survfit() when I supply a Cox model. Lets say for example: snipped: code that doesn't quite run we observe that the 95% CIs overlap!! How is this possible since the HR for spiders is significant.

[R] ggplot2: stat_bin ..count.. with geom_text when NA is present

2009-10-23 Thread Bryan Hanson
One for the ggplot2 gurus... I have a function which makes a plot just fine if the response vector (res in the example; fac1 is a factor) has no NA in it. It plots the data, then makes a little annotation at the bottom with the data counts using: p - p + geom_text(aes(x = fac1, y = min(res)

Re: [R] Memory Problems with CSV and Survey Objects

2009-10-23 Thread tlumley
Yes, a 350Mb data frame is a bit big for 32-bit R to handle conveniently. As you note, the survey package doesn't yet do database-backed replicate-weight designs. You can get the same effect yourself without too much work. First, put the data into a database, such as SQLite. If you have the

[R] how do you know which functions are being debugged?

2009-10-23 Thread Andrew Yee
This is kind of a dumb question: I know you can use isdebugged() to find out if a specific function is flagged for debugging, but is there a way to list all the functions that are flagged for debugging? Thanks, Andrew [[alternative HTML version deleted]]

[R] Bonferroni with unequal sample sizes

2009-10-23 Thread slreiner
Hello- I have run an ANOVA on 4 treatments with unequal sample sizes (n=9,7,10 and 10). I want to determine where my sig. differences are between treatments using a Bonferroni test, and have run the code: pairwise.t.test(Wk16, Treatment, p.adf=bonf) I receive an error message stating that

Re: [R] Bonferroni with unequal sample sizes

2009-10-23 Thread Chuck Cleland
On 10/23/2009 1:30 PM, slrei...@vims.edu wrote: Hello- I have run an ANOVA on 4 treatments with unequal sample sizes (n=9,7,10 and 10). I want to determine where my sig. differences are between treatments using a Bonferroni test, and have run the code: pairwise.t.test(Wk16, Treatment,

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Yihui Xie
list all objects first; use a loop (explicitly or not) to check whether (1) your objects are functions (2) functions are debugged f = function(x) x g = 1 x = ls() debug(f) sapply(x[sapply(x, function(i) is.function(get(i)))], isdebugged) f TRUE undebug(f) sapply(x[sapply(x, function(i)

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Duncan Murdoch
On 10/23/2009 1:28 PM, Andrew Yee wrote: This is kind of a dumb question: I know you can use isdebugged() to find out if a specific function is flagged for debugging, but is there a way to list all the functions that are flagged for debugging? No, R doesn't keep any master list, it sets a

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Yihui Xie
Oops... I forgot to mention that 'envir' (or 'pos') should be specified in ls()/get() in my last reply if you are looking for debugged functions in environments other than .GlobalEnv. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-6609 Web: http://yihui.name Department of

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Gabor Grothendieck
I have often wanted to get such a list as well without having to write code myself. If a function which automatically iterated over all possible objects and listed out the ones that being debugged were available in the core it would be useful. Even if its slow this would be used at debug time

Re: [R] Bayesian regression stepwise function?

2009-10-23 Thread JLucke
The BIC (Raftery) can be used for quasi-Bayesian model selection, but it's not stepwise. Ntzoufras shows how to use WinBUGS to conduct Bayesian model selection, but again it's not stepwise Ntzoufras, I. (2002), 'Gibbs variable selection using BUGS', Journal of Statistical Software 7(7),

[R] Prediction Error Calculation

2009-10-23 Thread quaildoc
Hello List, I am fitting a logistic regression model for some presence/absence type data. I have numerous covariates I am fitting to explain variation, and I am using AIC to rank models. However, I would like to report how well my best model (s) do at prediction. I have looked over the

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Duncan Murdoch
On 10/23/2009 2:27 PM, Gabor Grothendieck wrote: I have often wanted to get such a list as well without having to write code myself. If a function which automatically iterated over all possible objects and listed out the ones that being debugged were available in the core it would be useful.

[R] help using R's linprog for LP

2009-10-23 Thread Medha Atre
Hi, I am using R in one of my courses. I am trying to use R's linprog package to solve to formulate 2-class classification problem as Linear programming problem. For my formulation, I need to set to cvec to all 0s. I know the points are linearly separable so an optimal solution x does exist,

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Gabor Grothendieck
On Fri, Oct 23, 2009 at 2:34 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 10/23/2009 2:27 PM, Gabor Grothendieck wrote: I have often wanted to get such a list as well without having to write code myself.  If  a function which automatically iterated over all possible objects and listed

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Andrew Yee
Thanks everyone for the responses. As a suggestion, wouldn't it be useful, that when you run isdebugged() without any parameters, it would just report back the functions that are being flagged for debugging? Andrew On Fri, Oct 23, 2009 at 2:12 PM, Yihui Xie xieyi...@gmail.com wrote: Oops... I

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Duncan Murdoch
On 10/23/2009 2:49 PM, Andrew Yee wrote: Thanks everyone for the responses. As a suggestion, wouldn't it be useful, that when you run isdebugged() without any parameters, it would just report back the functions that are being flagged for debugging? Could you give an example of what the answer

[R] Data format for KSVM

2009-10-23 Thread Noah Silverman
Hi, I have a process using svm from the e1071 library. it works. I want to try using the KSVM library instead. The same data used wiht e1071 gives me an error with KSVM. My data is a data.frame. sample code: svm_formula - formula(y ~ a + B + C) svm_model - ksvm(formula, data=train_data,

Re: [R] Bayesian regression stepwise function?

2009-10-23 Thread Ravi Varadhan
The stepAIC() function in MASS can be used, with k = log(n), to implement your suggestion of quasi-Bayesian stepwise selection using the BIC criterion. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Steve Lianoglou
Hi, On Oct 23, 2009, at 2:39 PM, Gabor Grothendieck wrote: On Fri, Oct 23, 2009 at 2:34 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 10/23/2009 2:27 PM, Gabor Grothendieck wrote: I have often wanted to get such a list as well without having to write code myself. If a function

Re: [R] reference for mahalanobis {stats}

2009-10-23 Thread Peng Yu
On Fri, Oct 23, 2009 at 10:59 AM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Oct 23, 2009, at 11:36 AM, Peng Yu wrote: The help on mahalanobis {stats} does not include any reference. I'm interested in understand why Mahalanobis is defined in its current way and how to use

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Gabor Grothendieck
On Fri, Oct 23, 2009 at 2:52 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 10/23/2009 2:49 PM, Andrew Yee wrote: Thanks everyone for the responses.  As a suggestion, wouldn't it be useful, that when you run isdebugged() without any parameters, it would just report back the functions

Re: [R] help using R's linprog for LP

2009-10-23 Thread Medha Atre
Hi, I found the reason. By default it puts a condition for x = 0. Is there a way to get rid of this condition? Medha On Fri, Oct 23, 2009 at 2:34 PM, Medha Atre medha.a...@gmail.com wrote: Hi, I am using R in one of my courses. I am trying to use R's linprog package to solve to formulate

[R] How to apply the Wilcoxon test to a hole table at once?

2009-10-23 Thread Iurie Malai
Hi, I have a data set: Dataset X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 1 user1 m 22 19 28 24 12 18 9 7 4 5 4 7 5 7 9 2 user2 f 25 19 23 18 18 15 6 8 6 6 7 10 7 7 7 3 user3 f 28 21 24 18 15 12 10 6 7 9 5 10 5 9 5 4

[R] Reporting discriminat analysis

2009-10-23 Thread Stats Wolf
Dear all, I want to report the results of discriminant analysis in a way that would enable the readers to use my results (functions) for classification of their own cases. For this it should suffice to provide discriminant functions along with the cut-off values for distinguishing the groups.

Re: [R] Bayesian regression stepwise function?

2009-10-23 Thread Frank E Harrell Jr
Ravi Varadhan wrote: The stepAIC() function in MASS can be used, with k = log(n), to implement your suggestion of quasi-Bayesian stepwise selection using the BIC criterion. Ravi. Although many statisticians use BIC otherwise, it was only designed to compare two pre-specified models. Frank

  1   2   >