Re: [R] building compiled help html files

2010-11-03 Thread Edison
Vogue ladies like to go http://www.earlshop.com mens watches out for purchasing or parties with their distinctive designer http://www.sonbags.com replica handbags luggage. The designer baggage should meet their have to have http://www.sonbags.com designer handbags to lead the efficient shopp

Re: [R] memory allocation problem

2010-11-03 Thread Lorenzo Cattarino
Following on my memory allocation problem... I tried to run my code on our university HPU facility, requesting 61 GB of memory, and it still can not allocate a vector of 5 MB of size. > load('/home/uqlcatta/test_scripts/.RData') > > myfun <- function(Range, H1, H2, p, coeff) + { + -(coeff[1]+coe

Re: [R] memory allocation problem

2010-11-03 Thread Lorenzo Cattarino
Thanks for all your suggestions, This is what I get after removing all the other (not useful) objects and run my code: > getsizes() [,1] org_results 47240832 myfun 11672 getsizes4176 SS 3248 coeff168 NA NA

Re: [R] R script on linux?

2010-11-03 Thread gokhanocakoglu
I'll try this thanx... -- View this message in context: http://r.789695.n4.nabble.com/R-script-on-linux-tp3023650p3024922.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

[R] Data transformation

2010-11-03 Thread Santosh Srinivas
Dear Group, Need to do the following transformation: I have the dataset structure(list(Date = structure(1L, .Label = "2010-06-16", class = "factor"), ACC.returns1Day = -0.018524832, ACC.returns5Day = 0.000863931, ACC.returns7Day = -0.019795222, BCC.returns1Day = -0.009861859, BCC.r

Re: [R] "non-numeric argument to binary operator" error while reading ncdf file

2010-11-03 Thread Charles Novaes de Santana
Thank you everybody for the help! The solution of my problem is here: http://climateaudit.org/2009/10/10/unthreaded-23/ "The mv variable is the designated NA for the variable and it appears that somebody screwed that up in the file. This workaround worked for me: Print out the function get.var.n

Re: [R] Colour filling in panel.bwplot from lattice

2010-11-03 Thread Deepayan Sarkar
On Wed, Nov 3, 2010 at 4:11 AM, Dennis Murphy wrote: > Hi: > > I don't know why, but it seems that in > > bwplot(voice.part ~ height, data = singer, > main = "NOT THE RIGHT ORDER OF COLOURS\n'yellow' 'blue' 'green' 'red' > 'pink' 'violet' 'brown' 'gold'", > fill=c("yellow","blue","green","red","pi

Re: [R] One question on heatmap

2010-11-03 Thread Jim Lemon
On 11/03/2010 02:50 AM, Hua wrote: ... When I try to make heatmap based on this gene expression value table, I found that, when I set 'scale' to 'column', the heatmap will be always be red. I think this is because, there's very large values in the matrix (gene Actb), while the most are just ve

[R] save() with 64 bit and 32 bit R

2010-11-03 Thread Andrew Collier
hi, i have been using a 64 bit desktop machine to process a whole lot of data which i have then subsequently used save() to store. i am now wanting to use this data on my laptop machine, which is a 32 bit install. i suppose that i should not be surprised that the 64 bit data files do not open on m

Re: [R] Drawing circles on a chart

2010-11-03 Thread Barry Rowlingson
On Wed, Nov 3, 2010 at 2:07 AM, Santosh Srinivas wrote: > Dear Group, > Inside each cell there should be a circle (sphere preferable) with radius of > mod(data value). The color should be either red or green depending on -ve or > +ve and the intensity should be based on the value of the datapoint

[R] boxplot of timeseries with different lengths

2010-11-03 Thread Simone Gabbriellini
Hello List, I have a time serie of observations representing the activity of some users in different time periods, like: > table(obs1) user1 user2 user3 user31 user33 user4 user5 user6 user7 user8 user82 user83 user85 user9 1 1 3 1 1 1

[R] install vegan

2010-11-03 Thread Carolin
Dear all, I am trying to install Vegan, but I allways get the following error message: Warning in install.packages(choose.files("", filters = Filters[c("zip", : 'lib = "C:/Programme/R/R-2.12.0/library"' is not writable Error in install.packages(choose.files("", filters = Filters[c("zip", :

[R] Recoding -- test whether number begins with a certain number

2010-11-03 Thread Marcel Gerds
Dear R community, I have a question concerning recoding of a variable. I have a data set in which there is a variable devoted to the ISCO code describing the occupation of this certain individual (http://www.ilo.org/public/english/bureau/stat/isco/isco88/major.htm). Every type of occupation begi

Re: [R] save() with 64 bit and 32 bit R

2010-11-03 Thread Duncan Murdoch
Andrew Collier wrote: hi, i have been using a 64 bit desktop machine to process a whole lot of data which i have then subsequently used save() to store. i am now wanting to use this data on my laptop machine, which is a 32 bit install. i suppose that i should not be surprised that the 64 bit dat

Re: [R] save() with 64 bit and 32 bit R

2010-11-03 Thread Prof Brian Ripley
On Wed, 3 Nov 2010, Andrew Collier wrote: hi, i have been using a 64 bit desktop machine to process a whole lot of data which i have then subsequently used save() to store. i am now wanting to use this data on my laptop machine, which is a 32 bit install. i suppose that i should not be surprise

[R] Tukey's table

2010-11-03 Thread Silvano
Hi, I'm building Tukey's table using qtukey function. It happens that I can't get the values of Tukey's one degree of freedom and also wanted to eliminate the first column. The program is: Trat <- c(1:30) # number of treatments gl <- c(1:30, 40, 60, 120) # degree free

Re: [R] Colour filling in panel.bwplot from lattice

2010-11-03 Thread Rainer Hurling
Am 03.11.2010 10:23 (UTC+1) schrieb Deepayan Sarkar: On Wed, Nov 3, 2010 at 4:11 AM, Dennis Murphy wrote: Hi: I don't know why, but it seems that in bwplot(voice.part ~ height, data = singer, main = "NOT THE RIGHT ORDER OF COLOURS\n'yellow' 'blue' 'green' 'red' 'pink' 'violet' 'brown' 'gold'"

Re: [R] density() function: differences with S-PLUS

2010-11-03 Thread Nicola Sturaro Sommacal (Quantide srl)
Dear Joshua, first of all, thank you very much for reply. I hoped that someone who's familiar with both S+ and R can reply to me, because I spent some hours to looking for a solution. If someone else would try, this is the SPLUS code and output, while below there is the R code. I obtain the same

[R] bad optimization with nnet?

2010-11-03 Thread rynkiewicz
Hy, I try to give an example of overfitting with multi-layer perceptron. I have done following small example : library(nnet) set.seed(1) x <- matrix(rnorm(20),10,2) z <- matrix(rnorm(10),10,1) rx <- max(x)-min(x) rz <- max(z)-min(z) x <- x/rx z <- z/rz erreur <- 10^9 for(i in 1:100){ temp.mo

Re: [R] Multiple imputation for nominal data

2010-11-03 Thread Frank Harrell
The aregImpute function in the Hmisc package can do this through predictive mean matching and canonical variates (Fisher's optimum scoring algorithm). Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Mu

Re: [R] Recoding -- test whether number begins with a certain number

2010-11-03 Thread Barry Rowlingson
On Wed, Nov 3, 2010 at 10:01 AM, Marcel Gerds wrote: >  Dear R community, > > I have a question concerning recoding of a variable. I have a data set > in which there is a variable devoted to the ISCO code describing the > occupation of this certain individual > (http://www.ilo.org/public/english/b

Re: [R] Colour filling in panel.bwplot from lattice

2010-11-03 Thread Deepayan Sarkar
On Wed, Nov 3, 2010 at 4:25 PM, Rainer Hurling wrote: > Am 03.11.2010 10:23 (UTC+1) schrieb Deepayan Sarkar: >> >> On Wed, Nov 3, 2010 at 4:11 AM, Dennis Murphy  wrote: >>> >>> Hi: >>> >>> I don't know why, but it seems that in >>> >>> bwplot(voice.part ~ height, data = singer, >>> main = "NOT THE

Re: [R] Drawing circles on a chart

2010-11-03 Thread Santosh Srinivas
Thanks Barry ... actually the intention was to have areas of the circle depicting the value (radius imputed) -Original Message- From: b.rowling...@googlemail.com [mailto:b.rowling...@googlemail.com] On Behalf Of Barry Rowlingson Sent: 03 November 2010 15:02 To: Santosh Srinivas Cc: r-help@

Re: [R] Colour filling in panel.bwplot from lattice

2010-11-03 Thread Rainer Hurling
Am 03.11.2010 12:52 (UTC+1) schrieb Deepayan Sarkar: On Wed, Nov 3, 2010 at 4:25 PM, Rainer Hurling wrote: Am 03.11.2010 10:23 (UTC+1) schrieb Deepayan Sarkar: On Wed, Nov 3, 2010 at 4:11 AM, Dennis Murphywrote: Hi: I don't know why, but it seems that in bwplot(voice.part ~ height, da

Re: [R] install vegan

2010-11-03 Thread Uwe Ligges
On 03.11.2010 10:39, Carolin wrote: Dear all, I am trying to install Vegan, but I allways get the following error message: Warning in install.packages(choose.files("", filters = Filters[c("zip", : 'lib = "C:/Programme/R/R-2.12.0/library"' is not writable Error in install.packages(choose.f

Re: [R] memory allocation problem

2010-11-03 Thread Jonathan P Daily
The optim function is very resource hungry. I have had similar problems in the past when dealing with extremely large datasets. What is perhaps happening is that each 'step' of the optimization algorithm stores some info so that it can compare to the next 'step', and while the original vector m

[R] optim works on command-line but not inside a function

2010-11-03 Thread Damokun
Dear all, I am trying to optimize a logistic function using optim, inside the following functions: #Estimating a and b from thetas and outcomes by ML IRT.estimate.abFromThetaX <- function(t, X, inits, lw=c(-Inf,-Inf), up=rep(Inf,2)){ optRes <- optim(inits, method="L-BFGS-B", fn=IRT.llZetaLa

Re: [R] optim works on command-line but not inside a function

2010-11-03 Thread Jonathan P Daily
As the error message says, the values of your function must be finite in order to run the algorithm. Some part of your loop is passing arguments (inits maybe... you only tried (0,0) in the CLI example) that cause IRT.llZetaLambdaCorrNan to be infinite. -- Jon

[R] Granger causality with panel data (econometrics question)

2010-11-03 Thread Harun Özkan
Hi folks, I am trying to perform a Granger causality analysis with panel data. There are some packages around for panel data analysis and Granger causality. However, I have found neither a package for both panel data and Granger causality nor any R procedures (homogenous/heterogenous causality

[R] dll problem with C++ function

2010-11-03 Thread Carsten Dormann
Dear fellow R-users, I have the problem of being unable to repeatedly use a C++-function within R unless by dyn.unloading/dyn.loading it after each .C call. The C++-code (too large to attach) compiles without problem using R CMD SHLIB. It loads (using dyn.load("myfun.so")) and executes (via .

[R] longer object length is not a multiple of shorter object length

2010-11-03 Thread Stephen Liu
Hi folks, I'm following An Introduction to R http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics to learn R. Coming to; 2.2 Vector arithmetic > v <- 2*x + y + 1 Warning message: In 2 * x + y : longer object length is not a multiple of shorter object length What does it mean?

Re: [R] longer object length is not a multiple of shorter object length

2010-11-03 Thread David Winsemius
On Nov 3, 2010, at 11:00 AM, Stephen Liu wrote: Hi folks, I'm following An Introduction to R http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics to learn R. Coming to; 2.2 Vector arithmetic v <- 2*x + y + 1 Warning message: In 2 * x + y : longer object length is not a mul

[R] Lattice plots for images

2010-11-03 Thread Neba Funwi-Gabga
Hello UseRs, I need help on how to plot several raster images (such as those obtained from a kernel-smoothed intensity function) in a layout such as that obtained from the lattice package. I would like to obtain something such as obtained from using the "levelplot" or "xyplot" in lattice. I current

Re: [R] longer object length is not a multiple of shorter object length

2010-11-03 Thread Stephen Liu
- Original Message From: David Winsemius To: Stephen Liu Cc: r-help@r-project.org Sent: Wed, November 3, 2010 11:03:18 PM Subject: Re: [R] longer object length is not a multiple of shorter object length - snip - >> v <- 2*x + y + 1 >> Warning message: >> In 2 * x + y : >> longer obje

Re: [R] longer object length is not a multiple of shorter object length

2010-11-03 Thread David Winsemius
On Nov 3, 2010, at 11:17 AM, Stephen Liu wrote: - Original Message From: David Winsemius To: Stephen Liu Cc: r-help@r-project.org Sent: Wed, November 3, 2010 11:03:18 PM Subject: Re: [R] longer object length is not a multiple of shorter object length - snip - v <- 2*x + y + 1

[R] [klaR package] [NaiveBayes] warning message numerical 0 probability

2010-11-03 Thread Fabon Dzogang
Hi, I run R 2.10.1 under ubuntu 10.04 LTS (Lucid Lynx) and klaR version 0.6-4. I compute a model over a 2 classes dataset (composed of 700 examples). To that aim, I use the function NaiveBayes provided in the package klaR. When I then use the prediction function : predict(my_model, new_data). I g

Re: [R] dll problem with C++ function

2010-11-03 Thread Peter Langfelder
Just a shot in the dark... Do you properly close the input/output files at the end of your function? If not and the file remains open, it may throw an error upon new attempt to read it. It is possible that dyn.unload, among other things, closes all open connections and hence upon re-load everything

Re: [R] Lattice plots for images

2010-11-03 Thread Matt Shotwell
Have you tried using the 'mai' argument to par()? Something like: par(mfrow=c(3,3), mai=c(0,0,0,0)) I've used this in conjunction with image() to plot raster data in a tight grid. -Matt On Wed, 2010-11-03 at 11:13 -0400, Neba Funwi-Gabga wrote: > Hello UseRs

Re: [R] Lattice plots for images

2010-11-03 Thread David Winsemius
On Nov 3, 2010, at 11:13 AM, Neba Funwi-Gabga wrote: Hello UseRs, I need help on how to plot several raster images (such as those obtained from a kernel-smoothed intensity function) in a layout such as that obtained from the lattice package. I would like to obtain something such as obtained

Re: [R] Line numbers in Sweave

2010-11-03 Thread Yihui Xie
Well, I know this is true for the default Sweave(), and my problem actually comes from the pgfSweave package: I used some tricks to "cheat" R to parse and deparse the code chunks so that the output can be automatically formatted (and preserve the comments, [1]). The price to pay for not being "hone

Re: [R] "non-numeric argument to binary operator" error while reading ncdf file

2010-11-03 Thread David Pierce
Charles Novaes de Santana wrote: > Thank you everybody for the help! The solution of my problem is here: > > http://climateaudit.org/2009/10/10/unthreaded-23/ > > "The mv variable is the designated NA for the variable and it appears that > somebody screwed that up in the file. This workaround worke

Re: [R] Tukey's table

2010-11-03 Thread Dennis Murphy
Hi: Try this: Trat <- c(2:30) # number of treatments gl <- c(2:30, 40, 60, 120) # Write a one-line 2D function to get the Tukey distribution quantile: f <- function(x,y) qtukey(0.95, x, y) outer(Trat, gl, f) It's slow (takes a few seconds) but it seems to work. HTH, Dennis

Re: [R] Line numbers in Sweave

2010-11-03 Thread Duncan Murdoch
On 03/11/2010 11:52 AM, Yihui Xie wrote: Well, I know this is true for the default Sweave(), and my problem actually comes from the pgfSweave package: I used some tricks to "cheat" R to parse and deparse the code chunks so that the output can be automatically formatted (and preserve the comments,

[R] How to unquote string in R

2010-11-03 Thread lord12
s= "Hey" a = "Hello" table = rbind(s,a) write.table(table,paste("blah",".PROPERTIES",sep = ""),row.names = FALSE,col.names = FALSE) In my table, how do I output only the words and not the words with the quotations? -- View this message in context: http://r.789695.n4.nabble.com/How-to-unquote-

Re: [R] How to unquote string in R

2010-11-03 Thread Henrique Dallazuanna
Put the quote = FALSE argument in write.table On Wed, Nov 3, 2010 at 2:13 PM, lord12 wrote: > > > s= "Hey" > a = "Hello" > table = rbind(s,a) > write.table(table,paste("blah",".PROPERTIES",sep = ""),row.names = > FALSE,col.names = FALSE) > > In my table, how do I output only the words and not th

Re: [R] density() function: differences with S-PLUS

2010-11-03 Thread Nicola Sturaro Sommacal (Quantide srl)
Dear William, thank you very much for your reply. I see it only after my reply to Joshua. Unfortunately I cannot try until tomorrow, because I don't have S-PLUS on this machine. Thanks again. Nicola 2010/11/3 William Dunlap > Did you get my reply (1:31pm PST Tuesday) > to your request? It

Re: [R] How to unquote string in R

2010-11-03 Thread Erik Iverson
lord12 wrote: s= "Hey" a = "Hello" table = rbind(s,a) write.table(table,paste("blah",".PROPERTIES",sep = ""),row.names = FALSE,col.names = FALSE) In my table, how do I output only the words and not the words with the quotations? You read the help page for the function you're using :). Fro

[R] smooth: differences between R and S-PLUS

2010-11-03 Thread Nicola Sturaro Sommacal (Quantide srl)
Hi! I am studying differences between R and S-PLUS smooth() functions. I know from the help that they worked differently, so I ask: - exist a package that permit to have the same results? - alternatively, someone know how can I obtain the same results in R, using a self made script? I know that

Re: [R] Orthogonalization with different inner products

2010-11-03 Thread adet...@uw.edu
Suppose one wanted to consider random variables X_1,...X_n and from each subtract off the piece which is correlated with the previous variables in the list. i.e. make new variables Z_i so that Z_1=X_1 and Z_i=X_i-cov(X_i,Z_1)Z_1/var(Z_1)-...- cov(X_i,Z__{i-1})Z__{i-1}/var(Z_{i-1}) I have code

[R] '=' vs '<-'

2010-11-03 Thread km
Hi all, can we use '=' instead of '<-' operator for assignment in R programs? regards, KM __ 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

[R] programming questions

2010-11-03 Thread ivo welch
quick programming questions. I want to "turn on" more errors. there are two traps I occasionally fall into. * I wonder why R thinks that a variable is always defined in a data frame. > is.defined(d) [1] FALSE > d= data.frame( x=1:5, y=1:5 ) > is.defined(d$z) [1] TRUE

Re: [R] programming questions

2010-11-03 Thread Erik Iverson
ivo welch wrote: quick programming questions. I want to "turn on" more errors. there are two traps I occasionally fall into. * I wonder why R thinks that a variable is always defined in a data frame. > is.defined(d) [1] FALSE > d= data.frame( x=1:5, y=1:5 ) > is.defined(

Re: [R] programming questions

2010-11-03 Thread Duncan Murdoch
On 03/11/2010 2:05 PM, ivo welch wrote: quick programming questions. I want to "turn on" more errors. there are two traps I occasionally fall into. * I wonder why R thinks that a variable is always defined in a data frame. > is.defined(d) [1] FALSE > d= data.frame( x=1:5,

Re: [R] programming questions

2010-11-03 Thread ivo welch
yikes. this is all my fault. it was the first thing that I ever defined when I started using R. is.defined <- function(name) exists(as.character(substitute(name))) I presume there is something much better... /iaw On Wed, Nov 3, 2010 at 2:12 PM, Erik Iverson wrote: > > > ivo welch wrote:

Re: [R] programming questions

2010-11-03 Thread Jonathan P Daily
For data frames you can also use with() in your example: with(d, exists("z")) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a room when its empty? Does the room, the t

Re: [R] spliting first 10 words in a string

2010-11-03 Thread Matevž Pavlič
Hi all, Thanks for all the help. I realize i have a lot to learn in R but i love it. m From: steven mosher [mailto:mosherste...@gmail.com] Sent: Tuesday, November 02, 2010 11:45 PM To: Matevž Pavlič Cc: David Winsemius; Gaj Vidmar; r-h...@stat.math.ethz.ch Subject: Re: [R] spliting

Re: [R] '=' vs '<-'

2010-11-03 Thread Doran, Harold
Yes, but <- is preferred. Note, there are also some differences. You can do the following: > a <- 10 > b = 10 > identical(a,b) [1] TRUE And you can also do > myFun <- function(x, y = 100){ + result <- x*y + result} > myFun(x = 20) [1] 2000 But, you cannot use '<-' to define the arguments of a

Re: [R] '=' vs '<-'

2010-11-03 Thread Barry Rowlingson
On Wed, Nov 3, 2010 at 6:04 PM, km wrote: > Hi all, > > can we use '=' instead of '<-' operator for assignment in R programs? Yes, mostly, you can also use 'help' to ask such questions: > help("=") The operators ‘<-’ and ‘=’ assign into the environment in which they are evaluated. T

Re: [R] programming questions

2010-11-03 Thread Barry Rowlingson
On Wed, Nov 3, 2010 at 6:17 PM, ivo welch wrote: > yikes.  this is all my fault.  it was the first thing that I ever > defined when I started using R. > >   is.defined <- function(name) exists(as.character(substitute(name))) > > I presume there is something much better... You didn't do a good jo

[R] getting p-values from fitted ARIMA

2010-11-03 Thread h0453497
Hi I fitted an ARIMA model using the function arima(). The output consists of the fitted coefficients with their standard errors. However i need information about the significance of the coefficients, like p-values. I hope you can help me on that issue... ciao Stefan

Re: [R] '=' vs '<-'

2010-11-03 Thread Joshua Wiley
@all: Does it seem reasonable to add a discussion of '=' vs. '<-' to the FAQ? It seems a regular question and something of a "hot" topic to debate. @KM Here are links I've accumulated to prior discussions on this topic. I am pretty certain they are all unique. http://blog.revolutionanalytics

Re: [R] getting p-values from fitted ARIMA

2010-11-03 Thread Jorge Ivan Velez
Hi Stefan, Take a look at https://stat.ethz.ch/pipermail/r-help/2009-June/202173.html HTH, Jorge On Wed, Nov 3, 2010 at 2:50 PM, <> wrote: > Hi > > I fitted an ARIMA model using the function arima(). The output consists of > the fitted coefficients with their standard errors. > > However i nee

[R] NFFT on a Zoo?

2010-11-03 Thread Bob Cunningham
I have an irregular time series in a Zoo object, and I've been unable to find any way to do an FFT on it. More precisely, I'd like to do an NFFT (non-equispaced / non-uniform time FFT) on the data. The data is timestamped samples from a cheap self-logging accelerometer. The data is weakly re

Re: [R] getting p-values from fitted ARIMA

2010-11-03 Thread Achim Zeileis
On Wed, 3 Nov 2010, h0453...@wu.ac.at wrote: Hi I fitted an ARIMA model using the function arima(). The output consists of the fitted coefficients with their standard errors. However i need information about the significance of the coefficients, like p-values. I hope you can help me on that

Re: [R] Lattice plots for images

2010-11-03 Thread Deepayan Sarkar
On Wed, Nov 3, 2010 at 8:13 AM, Neba Funwi-Gabga wrote: > Hello UseRs, > I need help on how to plot several raster images (such as those obtained > from a kernel-smoothed intensity function) in a layout > such as that obtained from the lattice package. I would like to obtain > something such as ob

Re: [R] NFFT on a Zoo?

2010-11-03 Thread Gabor Grothendieck
On Wed, Nov 3, 2010 at 2:59 PM, Bob Cunningham wrote: > I have an irregular time series in a Zoo object, and I've been unable to > find any way to do an FFT on it.  More precisely, I'd like to do an NFFT > (non-equispaced / non-uniform time FFT) on the data. > > The data is timestamped samples fro

Re: [R] programming questions

2010-11-03 Thread ivo welch
thanks, barry and eric. I didn't do a good job---I did an awful job. alas, should R not come with an is.defined() function? a variable may never have been created, and this is different from a variable existing but holding a NULL. this can be the case in the global environment or in a data fram

Re: [R] smooth: differences between R and S-PLUS

2010-11-03 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Nicola > Sturaro Sommacal (Quantide srl) > Sent: Wednesday, November 03, 2010 10:41 AM > To: r-help@r-project.org > Subject: [R] smooth: differences between R and S-PLUS > > Hi!

Re: [R] programming questions

2010-11-03 Thread Erik Iverson
alas, should R not come with an is.defined() function? ?exists a variable may never have been created, and this is different from a variable existing but holding a NULL. this can be the case in the global environment or in a data frame. > is.null(never.before.seen) Error: objected 'ne

[R] deleteing all but some observations in data.frame

2010-11-03 Thread Matevž Pavlič
Hi, I am sure that can be done in R How would i delete all but let say 20 observations in data.frame? Thank you, M [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

Re: [R] deleteing all but some observations in data.frame

2010-11-03 Thread Erik Iverson
It depends on which 20 you want. If you have a data.frame called 'test.df', you can do: #first 20 test.df[20, ] -or- head(test.df, 20) #random 20 test.df[sample(nrow(test.df), 20), ] None of this was tested, but it should be a start. --Erik Matevž Pavlič wrote: Hi, I am sure that can

Re: [R] deleteing all but some observations in data.frame

2010-11-03 Thread Erik Iverson
Note that these methods don't 'delete' observations. They all create brand new objects that are subsets of the test.df object. You can effectively 'delete' the observations by replacing the original data.frame with the returned object... so test.df <- head(test.df, 20) Erik Iverson wrote: It

Re: [R] programming questions

2010-11-03 Thread David Winsemius
On Nov 3, 2010, at 3:32 PM, ivo welch wrote: thanks, barry and eric. I didn't do a good job---I did an awful job. is.defined(never.before.seen$anything) ## if a list does not exist, anything in it does not exist either Except the $ function return NULL rather than an error and you alrea

Re: [R] optim works on command-line but not inside a function

2010-11-03 Thread Berend Hasselman
Damokun wrote: > > Dear all, > > I am trying to optimize a logistic function using optim, inside the > following functions: > #Estimating a and b from thetas and outcomes by ML > > IRT.estimate.abFromThetaX <- function(t, X, inits, lw=c(-Inf,-Inf), > up=rep(Inf,2)){ > optRes <- optim(inits

Re: [R] programming questions

2010-11-03 Thread ivo welch
thanks, eric---I need a little more clarification. *yes, I write functions and then forget them. so I want them to be self-sufficient. I want to write functions that check all their arguments for validity.) For example, my.fn <- function( mylist ) { stop.if.not( is.defined(mylist) ) #

Re: [R] NFFT on a Zoo?

2010-11-03 Thread Bob Cunningham
On 11/03/2010 12:27 PM, Gabor Grothendieck wrote: On Wed, Nov 3, 2010 at 2:59 PM, Bob Cunningham wrote: I have an irregular time series in a Zoo object, and I've been unable to find any way to do an FFT on it. More precisely, I'd like to do an NFFT (non-equispaced / non-uniform time FFT) o

Re: [R] FW: optim works on command-line but not inside a function

2010-11-03 Thread Diederik Roijers
Well, the function should not be able to be infinite as IRT.llZetaLambdaCorrNan is a sum of products of either one or zero and log(1+exp(x)) or log(1+exp(-x)) (these logs are always bigger or equal to log(1)=0) Further more, I bounded x to be finite to fix my problem (as I expected that it might tr

Re: [R] programming questions

2010-11-03 Thread Henrik Bengtsson
On Wed, Nov 3, 2010 at 1:04 PM, ivo welch wrote: > thanks, eric---I need a little more clarification.  *yes, I write > functions and then forget them.  so I want them to be self-sufficient. >  I want to write functions that check all their arguments for > validity.)  For example, > >  my.fn <- fun

Re: [R] NFFT on a Zoo?

2010-11-03 Thread Mike Marchywka
> From: ggrothendi...@gmail.com > Date: Wed, 3 Nov 2010 15:27:13 -0400 > To: flym...@gmail.com > CC: r-help@r-project.org; rpy-l...@lists.sourceforge.net > Subject: Re: [R] NFFT on a Zoo? > > On Wed, Nov 3, 2010 at 2:59 PM, Bob Cunningham wrote: > > I

[R] Loop

2010-11-03 Thread Matevž Pavlič
Hi all, I managed to do what i want (with the great help of thi mailing list) manually . Now i would like to automate it. I would probably need a for loop for to help me with this...but of course I have no idea how to do that in R. Bellow is the code that i would like to be replicated fo

[R] avoiding too many loops - reshaping data

2010-11-03 Thread Dimitri Liakhovitski
Hello! I have a data frame like this one: mydf<-data.frame(city=c("a","a","a","a","a","a","a","a","b","b","b","b","b","b","b","b"), brand=c("x","x","y","y","z","z","z","z","x","x","x","y","y","y","z","z"), value=c(1,2,11,12,111,112,113,114,3,4,5,13,14,15,115,116)) (mydf) What I need to get i

Re: [R] avoiding too many loops - reshaping data

2010-11-03 Thread Erik Iverson
Hadley's reshape package (google for it) can do this. There's a nice intro on the site. > library(reshape) > cast(melt(mydf, measure.vars = "value"), city ~ brand, fun.aggregate = sum) city x y z 1a 3 23 450 2b 12 42 231 Although the numbers differ slightly? I've heard of

Re: [R] avoiding too many loops - reshaping data

2010-11-03 Thread Henrique Dallazuanna
Try this: xtabs(value ~ city + brand, mydf) On Wed, Nov 3, 2010 at 6:23 PM, Dimitri Liakhovitski < dimitri.liakhovit...@gmail.com> wrote: > Hello! > > I have a data frame like this one: > > > mydf<-data.frame(city=c("a","a","a","a","a","a","a","a","b","b","b","b","b","b","b","b"), > brand=c("x

Re: [R] avoiding too many loops - reshaping data

2010-11-03 Thread Dimitri Liakhovitski
Thanks a lot! Yes - I just found the reshape package too - and guess what, my math was wrong! reshape2 seems like the more up-to-date version of reshape. Wonder what's faster - xtabs or dcast... Dimitri On Wed, Nov 3, 2010 at 4:32 PM, Henrique Dallazuanna wrote: > Try this: > >  xtabs(value ~ c

Re: [R] avoiding too many loops - reshaping data

2010-11-03 Thread Dimitri Liakhovitski
In reshape2 this does the job: dcast(mydf,city~brand,sum) On Wed, Nov 3, 2010 at 4:37 PM, Dimitri Liakhovitski wrote: > Thanks a lot! > > Yes - I just found the reshape package too - and guess what, my math was > wrong! > reshape2 seems like the more up-to-date version of reshape. > > Wonder w

[R] multi-level cox ph with time-dependent covariates

2010-11-03 Thread Mattia Prosperi
Dear all, I would like to know if it is possible to fit in R a Cox ph model with time-dependent covariates and to account for hierarchical effects at the same time. Additionally, I'd like also to know if it would be possible to perform any feature selection on this model fit. I have a data set th

Re: [R] avoiding too many loops - reshaping data

2010-11-03 Thread Dimitri Liakhovitski
Want to thank everyone once more for pointing in "reshape" direction. Saved me about 16 hours of looping! Dimitri On Wed, Nov 3, 2010 at 4:38 PM, Dimitri Liakhovitski wrote: > In reshape2 this does the job: > > dcast(mydf,city~brand,sum) > > > On Wed, Nov 3, 2010 at 4:37 PM, Dimitri Liakhovitski

Re: [R] Loop

2010-11-03 Thread Matevž Pavlič
Hi, Thanks for the help and the manuals. Will come very handy i am sure. But regarding the code i don't hink this is what i wantbasically i would like to repeat bellow code : w1<-table(lit$W1) w1<-as.data.frame(w1) write.table(w1,file="w1.csv",sep=";",row.names=T, dec=".") w1<- w1[order(w

[R] multivariate Poisson distribution

2010-11-03 Thread Jourdan Gold
Hello, from a search of the archives and functions, I am looking for information on creating random correlated counts from a multivariate Poisson distribution.  I can not seem to find a function that does this. Perhaps, it has not yet  been created. Has anyone created an R package that do

[R] biding rows while merging at the same time

2010-11-03 Thread Dimitri Liakhovitski
Hello! I have 2 data frames like this (well, actually, I have 200 of them): df1<-data.frame(location=c("loc 1","loc 2","loc 3"),date=c("1/1/2010","1/1/2010","1/1/2010"), a=1:3,b=11:13,c=111:113) df2<-data.frame(location=c("loc 1","loc 2","loc 3"),date=c("2/1/2010","2/1/2010","2/1/2010"), a=4:6,c=

Re: [R] biding rows while merging at the same time

2010-11-03 Thread Dimitri Liakhovitski
Never mind - I found it in "reshape" package: rbind.fill I wonder if it's still in reshape2. Dimitri On Wed, Nov 3, 2010 at 5:34 PM, Dimitri Liakhovitski wrote: > Hello! > > I have 2 data frames like this (well, actually, I have 200 of them): > > df1<-data.frame(location=c("loc 1","loc 2","loc >

Re: [R] biding rows while merging at the same time

2010-11-03 Thread Erik Iverson
Just merge(df1, df2, all = TRUE) does it, yes? Dimitri Liakhovitski wrote: Hello! I have 2 data frames like this (well, actually, I have 200 of them): df1<-data.frame(location=c("loc 1","loc 2","loc 3"),date=c("1/1/2010","1/1/2010","1/1/2010"), a=1:3,b=11:13,c=111:113) df2<-data.frame(locati

Re: [R] Loop

2010-11-03 Thread David Winsemius
On Nov 3, 2010, at 5:03 PM, Matevž Pavlič wrote: Hi, Thanks for the help and the manuals. Will come very handy i am sure. But regarding the code i don't hink this is what i wantbasically i would like to repeat bellow code : w1<-table(lit$W1) w1<-as.data.frame(w1) It appears you are

Re: [R] biding rows while merging at the same time

2010-11-03 Thread David Winsemius
On Nov 3, 2010, at 5:38 PM, Dimitri Liakhovitski wrote: Never mind - I found it in "reshape" package: rbind.fill I wonder if it's still in reshape2. Look in plyr. -- David. Dimitri __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

[R] Auto-killing processes spawned by foreach::doMC

2010-11-03 Thread Steve Lianoglou
Hi all, Sometimes I'll find myself "ctrl-c"-ing like a madman to kill some code that's parallelized via foreach/doMC when I realized that I just set my cpu off to do something boneheaded, and it will keep doing that thing for a while. In these situations, since I interrupted its normal execution,

[R] how to handle 'g...@gtdata' ?

2010-11-03 Thread karena
I have a few questions about GenABEL, gwaa data. 1) is there a universal way that most GenABEL people use to add more individuals into a 'gwaa' data? For example, I have a 'gwaa' data, but I need to add some dummy parents, for 'g...@phdata', it's easy to add these rows, but for 'g...@gtdata', I t

Re: [R] avoiding too many loops - reshaping data

2010-11-03 Thread Dimitri Liakhovitski
Here is the summary of methods. tapply is the fastest! library(reshape) system.time(for(i in 1:1000)cast(melt(mydf, measure.vars = "value"), city ~ brand,fun.aggregate = sum)) user system elapsed 18.400.00 18.44 library(reshape2) system.time(for(i in 1:1000)dcast(mydf,city ~ brand, su

[R] Rd installation (not markup language) primer?

2010-11-03 Thread ivo welch
I have a set of functions that I always load on startup. for example, there is my now infamous "is.defined()" function. I would like to add some documentation for these functions, so that I can do a ?is.defined inside R. The documentation tells me how to mark up Rd files is very good, but I

Re: [R] multivariate Poisson distribution

2010-11-03 Thread Ben Bolker
Jourdan Gold uoguelph.ca> writes: > > > Hello, from a search of the archives and functions, > I am looking for information on creating random > correlated counts from a multivariate Poisson distribution.  > I can not seem to find a function that > does this. Perhaps, it has not yet  been c

Re: [R] Rd installation (not markup language) primer?

2010-11-03 Thread Duncan Murdoch
On 03/11/2010 6:28 PM, ivo welch wrote: I have a set of functions that I always load on startup. for example, there is my now infamous "is.defined()" function. I would like to add some documentation for these functions, so that I can do a ?is.defined inside R. The documentation tells me

  1   2   >