Re: [R] how to determine if a variable is already set?

2009-09-11 Thread Duncan Murdoch
On 9/11/2009 1:15 PM, carol white wrote: Hi, It might be a primitive question but how it is possible to determine if a variable is initialized in an environment? Suppose that we start a R session and wants to run a script which use the variable i. Which function could evaluate if i is already

Re: [R] Moving to Mac OS X

2009-09-11 Thread Steve Lianoglou
Hi, On Sep 11, 2009, at 3:08 PM, Noah Silverman wrote: 3) I purposefully chose NOT to install 64bit R. I have a dual-core machine. With the 32 bit version, R will happily keep one core running at 100%, but then I have other core free for my "regular" work. Using 64bit R shouldn't change

Re: [R] Moving to Mac OS X

2009-09-11 Thread Noah Silverman
Steve, You make a good point. I confused 64 bit with a multi-core setup. That said, I don't belive the pretty packaged up GUI has a 64 bit version, just the "raw terminal" version does. On 9/11/09 12:38 PM, Steve Lianoglou wrote: Hi, On Sep 11, 2009, at 3:08 PM, Noah Silverman wrote: 3)

Re: [R] Moving to Mac OS X

2009-09-11 Thread Steve Lianoglou
Hi, On Sep 11, 2009, at 3:40 PM, Noah Silverman wrote: Steve, You make a good point. I confused 64 bit with a multi-core setup. That said, I don't belive the pretty packaged up GUI has a 64 bit version, just the "raw terminal" version does. There is a 64bit version of the R.app GUI, you

[R] ipred bagging segfault on 64 bit linux build

2009-09-11 Thread jamesmcc
I wanted to report this issue here so others may not find themselves alone and as the author is apparently active on the list. I havent done an exhaustive test by any means, cause I dont have time. But here's a small example. Apparently the "ns" argument is the one that is killing it. I've gotten

Re: [R] Moving to Mac OS X

2009-09-11 Thread Noah Silverman
Thanks Steve, That's a big help. On 9/11/09 12:48 PM, Steve Lianoglou wrote: Hi, On Sep 11, 2009, at 3:40 PM, Noah Silverman wrote: Steve, You make a good point. I confused 64 bit with a multi-core setup. That said, I don't belive the pretty packaged up GUI has a 64 bit version, just t

[R] R on Multi Core

2009-09-11 Thread Noah Silverman
Hi, Our discussions about 64 bit R has led me to another thought. I have a nice dual core 3.0 chip inside my Linux Box (Running Fedora 11.) Is there a version of R that would take advantage of BOTH cores?? (Watching my system performance meter now is interesting, Running R will hold a single

Re: [R] Barplot+Table

2009-09-11 Thread Andy Choens
On Friday 11 September 2009 02:47:32 pm Henrique Dallazuanna wrote: > Try the textplot function in the gplots package: Thank you. That definitely gives me a direction to pursue. It doesn't look like there is an easy way to make things line up though, which is unfortunate but I'm sure it's possib

Re: [R] R on Multi Core

2009-09-11 Thread Romain Francois
On 09/11/2009 10:05 PM, Noah Silverman wrote: Hi, Our discussions about 64 bit R has led me to another thought. I have a nice dual core 3.0 chip inside my Linux Box (Running Fedora 11.) Is there a version of R that would take advantage of BOTH cores?? (Watching my system performance meter now

[R] Alternative to Scale Function?

2009-09-11 Thread Noah Silverman
Hi, Is there an alternative to the scale function where I can specify my own mean and standard deviation? I've come across an interesting issue where this would help. I'm training and testing on completely different sets of data. The testing set is smaller than the training set. Using the

[R] constrOptim parameters

2009-09-11 Thread ivo welch
Dear R wizards: I am playing (and struggling) with the example in the constrOptim function. simple example. let's say I want to constrain my variables to be within -1 and 1.I believe I want a whole lot of constraints where ci is -1 and ui is either -1 or 1. That is, I have 2*N constraints.

Re: [R] How to do rotation for polygon?

2009-09-11 Thread Greg Snow
Does this do what you want? library(TeachingDemos) ms.pent <- function(ang=0,...) { theta <- seq(ang, length.out=6, by=2*pi/5) cbind( cumsum(cos(theta)/2), cumsum(sin(theta)/2) ) } par(xpd=NA) my.symbols( rep(1,5), rep(1,5), ms.pent, ang=seq(0, by=2*pi/5, length.ou

[R] ANN: rproto v1 (Protocol Buffers and R)

2009-09-11 Thread Saptarshi Guha
Hello, I apologize if this is not the list for package announcements. Having said that I've released a package called rprotos which implements a simple serialization using Googles protocol buffers[1]. The package also includes some miscellaneous functions for writing/ reading variable length e

Re: [R] generating multiple sequences in subsets of data

2009-09-11 Thread Jason Baucom
My apologies for bringing up an old topic, but still having some problems! I got this code to work, and it was running perfectly fine. I tried it with a larger data set and it crashed my machine, slowly chewing up memory until it could not allocate any more for the process. The following line ki

Re: [R] For sending my R package as part of R-project

2009-09-11 Thread Liviu Andronic
Hello On Fri, Sep 11, 2009 at 4:40 PM, Lio, Yuhlong wrote: > The reviewers and editor suggest the R package for the sampling plans of the > paper be part of R-project. Please let me know what I should do to make the R > package available for R-project group. > I would suggest that you check thi

Re: [R] generating multiple sequences in subsets of data

2009-09-11 Thread Jason Baucom
A bit of debugging information > merged_cut_col$pickseq <- > ave(as.numeric(as.Date(merged_cut_col$pickts)),merged_cut_col$cpid,as.numeric(as.Date(merged_cut_col$pickts)) > > as.numeric(as.Date("2008-12-01")),FUN=seq) Error: cannot allocate vector of size 55 Kb > memory.size() [1] 1882.56 > obje

Re: [R] Alternative to Scale Function?

2009-09-11 Thread Noah Silverman
I think I just answered my own question. The scale function will return the mean and sd of the data. So the process is fairly simple. scale training data varaible note mean and sd from the scale then manually scale the test data using the mean and sd from the training data. That should make s

Re: [R] constrOptim parameters

2009-09-11 Thread Ravi Varadhan
Ivo, Do you only have "box" constraints, i.e. upper and lower bounds on the parameters themselves? If so, you do not need to use `constrOptim'. You could use "L-BFGS-B" in `optim' or `nlminb' or `spg'. You are mistaken about how `ui' is set up. It should be a matrix with dimension, Ni x p, whe

[R] ANN: rproto v1 (Protocol Buffers and R) [repost]

2009-09-11 Thread Saptarshi Guha
Hello, (Previous message was scrubbed) I apologize if this is not the list for package announcements. Having said that I've released a package called rprotos which implements a simple serialization using Googles protocol buffers[1]. The package also includes some miscellaneous functions for writin

Re: [R] Alternative to Scale Function?

2009-09-11 Thread Gavin Simpson
On Fri, 2009-09-11 at 13:10 -0700, Noah Silverman wrote: > Hi, > > Is there an alternative to the scale function where I can specify my own > mean and standard deviation? A couple of calls to sweep? See ?sweep set.seed(123) dat <- data.frame(matrix(runif(10*10), ncol = 10)) xbar <- colMeans(da

[R] help in matching two column vectors

2009-09-11 Thread ravi
Dear list, I have a long list of two vectors with some matching elements. I would like to line them up in two columns and have an NA in those positions of the second vector where a match is absent. With a simple example, I will explain my problem. (a<-1:6) (b<-c(5,2)) (m1<-match(a,b)) (ab<-cbind

Re: [R] Best R text editors?

2009-09-11 Thread Patrick Connolly
On Fri, 11-Sep-2009 at 03:46PM +0100, Ted Harding wrote: [] |> Well, not really!! My point (and certainly Charles Curran's point) |> is that in touch-typing you know by proprioception and |> neuromuscular coordination where your fingers are relative to the |> keys on the keyboard, and what ke

Re: [R] Alternative to Scale Function?

2009-09-11 Thread Mark Difford
>> The scale function will return the mean and sd of the data. By default. Read ?scale. Mark. Noah Silverman-3 wrote: > > I think I just answered my own question. > > The scale function will return the mean and sd of the data. > > So the process is fairly simple. > scale training data varai

Re: [R] Alternative to Scale Function?

2009-09-11 Thread Noah Silverman
Genius, That certainly is much faster that what I had worked out on my own. I looked at sweep, but couldn't understand the rather thin help page. Your example makes it really clear Thank You!!! -- Noah On 9/11/09 1:57 PM, Gavin Simpson wrote: > On Fri, 2009-09-11 at 13:10 -0700, Noah Silver

Re: [R] Working with large matrix

2009-09-11 Thread A Ezhil
HI Steve, Thanks a lot for your suggestions. I never used bigmemory and biglm before. Is there a way (using systems commands) to combine awk and R? I was thinking of calling a R program inside Awk, passing each row to R, do the lm, get back results and process it with awk. Will this make the ca

Re: [R] rpart - the xval argument in rpart.control and in xpred.rpart

2009-09-11 Thread jamesmcc
I have this *exact* same confusion. Adding to this is the fact that Everitt and Hothorn in their book, HSAUR, say that setting xval=100 gives "100 runs of 10-fold cross-validation" (1st ed., page 136). Is this actually 1 run of 100-fold cross-validation? For large xval, doing multiple cross-v

Re: [R] Barplot+Table

2009-09-11 Thread Marc Schwartz
On Sep 11, 2009, at 1:20 PM, Andy Choens wrote: I am trying to automate a report that my company does every couple of years for the state of Maine. In the past we have used SPSS to run the data and then used complicated Excel template to make the tables/graphics which we then imported into

[R] Using R for a slightly tricky survey analysis

2009-09-11 Thread Andreas Stefik
Hello folks, I have recently finished a pilot study of a survey and am working to complete the statistical analysis of the results in R. My Phd is technically in computer science (not statistics), although I teach basic stats and have a "decent" working knowledge of the area. With that said, my ex

Re: [R] Using R for a slightly tricky survey analysis

2009-09-11 Thread Andreas Stefik
Hello folks, I have recently finished a pilot study of a survey and am working to complete the statistical analysis of the results in R. My Phd is technically in computer science (not statistics), although I teach basic stats and have a "decent" working knowledge of the area. With that said, my ex

Re: [R] bar chart with means - using ggplot

2009-09-11 Thread Felipe Carrillo
Like this? # example using qplot library(ggplot2) meanprice <- tapply(diamonds$price, diamonds$cut, mean);meanprice cut <- factor(levels(diamonds$cut), levels = levels(diamonds$cut)) qplot(cut, meanprice, geom="bar", stat="identity", fill = I("grey50")) dev.new() # create a new graph to compare wi

Re: [R] Best R text editors?

2009-09-11 Thread Nikos Alexandris
[Answering to the threads question] For those who use Gnome's gedit, there is now RGedit: http://sourceforge.net/projects/rgedit Apologies if this was already posted, Nikos __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] goodness of "prediction" using a model (lm, glm, gam, brt, regression tree .... )

2009-09-11 Thread jamesmcc
I think it's important to say why you're unhappy with your current measures? Are they not capturing aspects of the data you understand? I typically use several residual measures in conjunction, each has it's benefits/drawbacks. I just throw them all in a table. -- View this message in contex

Re: [R] Best R text editors?

2009-09-11 Thread Ted Harding
On 11-Sep-09 21:02:06, Patrick Connolly wrote: > On Fri, 11-Sep-2009 at 03:46PM +0100, Ted Harding wrote: > > [] > >|> Well, not really!! My point (and certainly Charles Curran's point) >|> is that in touch-typing you know by proprioception and >|> neuromuscular coordination where your finger

Re: [R] For sending my R package as part of R-project

2009-09-11 Thread Turner Rolf
From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Liviu Andronic [landronim...@gmail.com] Sent: Saturday, September 12, 2009 8:42 AM To: Lio, Yuhlong Cc: r-help@r-project.org Subject: Re: [R] For sending my R package as part of

[R] help with for loop

2009-09-11 Thread Edward Chen
example code: P = function(whichday,columns){ y = which(pvalue[,whichday]0){ #diffbig = meandayxx0) x[i] = raw_urine[x_index[i],1] dayx[i]= raw_urine[x_index[i],day1_ind] dayy[i] = raw_urine[x_index[i],columns] jpeg("test 1.jpg",width=800, height = 800) matplot(x[i],dayx[i],lwd = 3,pch=1,col = "bla

Re: [R] help with for loop

2009-09-11 Thread Steve Lianoglou
Hi, On Sep 11, 2009, at 6:35 PM, Edward Chen wrote: example code: P = function(whichday,columns){ y = which(pvalue[,whichday]0){ #diffbig = meandayxx0) x[i] = raw_urine[x_index[i],1] dayx[i]= raw_urine[x_index[i],day1_ind] dayy[i] = raw_urine[x_index[i],columns] jpeg("test 1.jpg",width=800, hei

[R] Way to iteratively change line color and line style

2009-09-11 Thread Jason Rupert
I would like to have a way to automatically change the line color and line style. Below is an example of the items I am plotting. I've contemplated coming up with a list of desired colors and styles, but I am hoping there is an automated way for this to be accomplished as the number of lines

Re: [R] help in matching two column vectors

2009-09-11 Thread jim holtman
Is this what you want: > (a<-1:6) [1] 1 2 3 4 5 6 > (b<-c(5,2)) [1] 5 2 > (m1<-match(a,b)) [1] NA 2 NA NA 1 NA > cbind(a, b[m1]) a [1,] 1 NA [2,] 2 2 [3,] 3 NA [4,] 4 NA [5,] 5 5 [6,] 6 NA > Your 'missing function b' in the first example was due to you thinking 'b(m1[i])' is equivalent t

Re: [R] For sending my R package as part of R-project

2009-09-11 Thread Lio, Yuhlong
Thank you for your help. We will read the intructions. When it is ready, I or my co-authers will send our package to R-project.org. Yuhlong From: Turner Rolf [r.tur...@auckland.ac.nz] Sent: Friday, September 11, 2009 5:30 PM To: Liviu Andronic; Lio, Y

Re: [R] Moving to Mac OS X

2009-09-11 Thread Victor Manuel Garcia Guerrero
Thanks to everybody for your comments. All the best. Víctor Manuel García Guerrero Doctorado en Estudios de Población, CEDUA, COLMEX Camino al Ajusco N° 20, Pedregal de Sta. Teresa C.P.10740, Tlalpan, México, D.F. * : vmgar...@colmex.mx * : 5617-9016 __

Re: [R] generating multiple sequences in subsets of data

2009-09-11 Thread David Winsemius
Have you tried running merged_cut_col$pickts through something that is less complex? Perhaps: table(merged_cut_col$pickts) ... to see if there are problems with the "inner" functions? Also I think the as.numeric might be superfluous, since Dates are really just integers with some attitude,

Re: [R] Accumulating results from "for" loop in a list/array

2009-09-11 Thread Johannes Hüsing
Steven Kang schrieb: Dear R users, I would like to accumulate objects generated from 'for' loop to a list or array. To illustrate the problem, arbitrary data set and script is shown below, x <- data.frame(a = c(rep("n",3),rep("y",2),rep("n",3),rep("y",2)), b = c(rep("y",2),rep("n",4),rep("y"

Re: [R] bar chart with means - using ggplot

2009-09-11 Thread Dianne Cook
I would recommend not representing means by bars at all. Bars are for counts, stacking from zero. Means are point estimates. ggplot has a lot of routines for displaying means with errors bars: geom_linerange, geom_pointrange. To hone your ggplot skills I recommend looking into these geoms.

[R] mclustBIC version 3.3.1

2009-09-11 Thread madmax1425
Hi there, I started getting a new error with the latest mclust package version 3.3.1. My only solution was to install the older package 3.2.1 or even 3.1-10. , (i think older ones will still work since i ve been using it for a while) the sentence giving trouble is: BIC <- mclustBIC(as.vector

<    1   2