[R] ggplot question

2008-07-24 Thread Williams Scott
I am trying to do something simple with ggplot. I wish to draw a density plot split by group, and fill each group with a different colour (and each with an alpha =0.25). I have tried a number of variations of the following, but cannot find a way to define the colour of the fill, its transparency an

Re: [R] how can I write code to detect whether the machine is Windows or Linux?

2008-07-24 Thread Peter Dalgaard
Marc Schwartz wrote: It's always dangerous to say always, but "in general", the use of: Path/To/File with *forward* slashes, will work on both Windows and Linux, including the use of relative paths. Also, notice the existence of file.path() and system.file(). (Other separators than forw

Re: [R] lmer model with continuos non normal response variable, transformation needed?

2008-07-24 Thread Christoph Scherber
Dear Arams, I would suggest to use lme() instead of lmer(), and then to use a variance function to model the heteroscedasticity in the within-group errors, such as: model.new=update(model,weights=varPower(form=~primary.covariate)) where model and model.new are lme fits, and primary.covariate

Re: [R] Functions similar to step() and all.effects() that work for lme() objects?

2008-07-24 Thread Christoph Scherber
Dear Jon, The function stepAIC() in Venable´s & Ripley´s MASS library does the job. Best wishes Christoph Jon Zadra schrieb: Hello, I make frequent use of the *step()* and, for plotting, *all.effects() *functions for *lm()* objects. I am now doing more with *lme()* random effects models,

Re: [R] convert a vector of words into a matrix

2008-07-24 Thread Patrick Burns
And what should the matrix look like? Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User") Daren Tan wrote: How to convert the strings into matrix ? (strings <- strsplit(c("1 2 3", "1 2", "1 3 4 5"), " "))[[1]

Re: [R] Functions similar to step() and all.effects() that work for lme() objects?

2008-07-24 Thread Prof Brian Ripley
On Thu, 24 Jul 2008, Christoph Scherber wrote: Dear Jon, The function stepAIC() in Venable´s & Ripley´s MASS library does the job. Actually, it is extractAIC method in the MASS package that does the job for stepAIC() or step(), so if you attach MASS then step() should work. As for 'all.eff

Re: [R] convert a vector of words into a matrix

2008-07-24 Thread Daren Tan
I want the matrix to look like this: [,1] [,2] [,3] [,4] [1,] "1" "2" "3" [2,] "1" "2" [3,] "1" "2" "4" "5" I tried to use do.call(rbind, strings) but failed due to unequal row lengths. > Date: Thu, 24 Jul 2008 09:35:21 +0100> From: [EMAIL PROTECTED]> To: [EMAIL > PROTECTED]> CC: [EMAIL

[R] time zone - best way to shift hours

2008-07-24 Thread DCC
I frequently work with hourly data in GMT format, and ensure that any data I read into R are expressed in GMT through as.POSIXct(mydate, tz = "GMT"). I am interested in processing air pollution data in GMT where where peaks in emissions (say from road traffic sources) tend to occur at the same L

Re: [R] convert a vector of words into a matrix

2008-07-24 Thread Wacek Kusnierczyk
Daren Tan wrote: > I want the matrix to look like this: > > [,1] [,2] [,3] [,4] > [1,] "1" "2" "3" > [2,] "1" "2" [3,] "1" "2" "4" "5" > > I tried to use do.call(rbind, strings) but failed due to unequal row lengths. > you can't {r,c}bind them because of different lengths. one way to r

[R] Coconut benchmark for R?

2008-07-24 Thread Imanpreet
Hello All, Could anybody point me out any port of "Global Optimization Test Problems" OR "Constraint Satisfaction Test Problems" part of Coconut[%] benchmark or other such similar benchmarks for R. [%] Coconut benchmark: http://www.mat.univie.ac.at/users/neum/public_html/glopt/coconu

Re: [R] time zone - best way to shift hours

2008-07-24 Thread Prof Brian Ripley
On Thu, 24 Jul 2008, DCC wrote: I frequently work with hourly data in GMT format, and ensure that any data I read into R are expressed in GMT through as.POSIXct(mydate, tz = "GMT"). That makes no sense. POSIXct times are absolute times, not in any timezone. You can display them in any time

[R] How to get rule number in arules

2008-07-24 Thread Daniel Wagner
 Dear R experts   I generated rules using apriori method in arules package. Though I can access rules using %in% function but I am unable to access a specific rule by its unique identifier number. I want to use rule number for further analysis..   Thanking you in advance.   Daniel Amsterdam Â

[R] Is there an equivalent * operator?

2008-07-24 Thread Williams, Robin
Hi all, Is there an equivalent to the general * operator in R, where * can represent any character? I have a dataset, one column being date, date ranging between April-September, 97-06. I would like to be able to acquire the data for a specific month, say September, so that I can take average t

[R] unable to load a library

2008-07-24 Thread Gérard Henry
hello all, i'm running R-2.6.1 on solaris 10 (x86). I added the package aplpack without problems, but when i try to use it, i got errors: library(aplpack) Loading required package: tcltk Error in namespaceExport(ns, exports) : undefined exports :addTclPath, as.tclObj, is.tclObj, is.tkwin, tclf

Re: [R] Is there an equivalent * operator?

2008-07-24 Thread john seers (IFR)
Something like this might do what you want: dates<-paste(c("2008"), c("Jan", "Feb", "Sep", "Sep", "Dec"), 1:3, sep="") temp<-rnorm(length(dates))*30 data1<-data.frame(Dates=dates, Temp=temp) data.s1<-data1[grep("Sep", data1[["Dates"]]),] > data.s1 Dates Temp 3 2008Sep3 22.263627 4 2

Re: [R] Is there an equivalent * operator?

2008-07-24 Thread Duncan Murdoch
Williams, Robin wrote: Hi all, Is there an equivalent to the general * operator in R, where * can represent any character? I have a dataset, one column being date, date ranging between April-September, 97-06. I would like to be able to acquire the data for a specific month, say September, so

Re: [R] Using PrettyR to produce LaTeX output

2008-07-24 Thread Jim Lemon
On Wed, 2008-07-23 at 12:46 -0700, jcarmichael wrote: > Hello everyone. I am new to R, so please bear with me. I am trying to find > an easy way to export descriptive statistics and other information about my > data frame to a LaTeX format. > > I have found the describe function in PrettyR to be

[R] Just 2 more questions - for now!

2008-07-24 Thread Williams, Robin
Hi all, Thanks for the help with my previous post. I have just two more questions for the minute. I think I said in a previous post that I like to use the terminal, i.e. run rterm.exe. On exiting the terminal, I am asked if I want to save the workspace. If I hit y (yes), the workspace is just

[R] Bootstraping GAMs: confidence intervals

2008-07-24 Thread Luis Reino
Dear R-Users, I am trying to apply a bootstrap to a GAM in order to calculate the 95% confidence intervals for a smooth curve obtained by the “plot.gam” function of the mgcv package. Nonetheless, I am getting some difficulties in transposing the results for the graphs. I used the following c

Re: [R] convert a vector of words into a matrix

2008-07-24 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > Daren Tan wrote: > >> I want the matrix to look like this: >> >> [,1] [,2] [,3] [,4] >> [1,] "1" "2" "3" >> [2,] "1" "2" [3,] "1" "2" "4" "5" >> >> I tried to use do.call(rbind, strings) but failed due to unequal row lengths. >> >> > you can't {r,c}bi

[R] Problems with Rmpi and LAM 7.1.4

2008-07-24 Thread giuseppe1 . milicia
Guys, I'm running LAM 7.1.4 and R/Rmpi on a SuSE 9.3 box. When I do >library(Rmpi) The whole thing crashes with the following message: - No SSI RPI modules said that they were available to run. This should only happe

Re: [R] convert a vector of words into a matrix

2008-07-24 Thread Henrique Dallazuanna
Try this: print(t(sapply(strings, '[', 1:max(sapply(strings, length, na=".") On 7/24/08, Daren Tan <[EMAIL PROTECTED]> wrote: > > I want the matrix to look like this: > > [,1] [,2] [,3] [,4] > [1,] "1" "2" "3" > [2,] "1" "2" [3,] "1" "2" "4" "5" > > I tried to use do.call(rbind, strings

[R] Interactive plot

2008-07-24 Thread Megh Dal
I have created following interactive plot : library(TeachingDemos) plott = function(x) { return(hist(rnorm(as.integer(1000, 10, x)), xlab=NA)) } tkexamp(plott, list(x=list('slider',from=1,to=40, resolution=0.1, init=2)), plotloc='top') Here everything works fine, but the problaem is wh

Re: [R] Just 2 more questions - for now!

2008-07-24 Thread stephen sefick
lm(x~y+z) this should work- I think On Thu, Jul 24, 2008 at 7:01 AM, Williams, Robin < [EMAIL PROTECTED]> wrote: > Hi all, > Thanks for the help with my previous post. > I have just two more questions for the minute. > I think I said in a previous post that I like to use the terminal, > i.e. run

Re: [R] Interactive plot

2008-07-24 Thread Duncan Murdoch
On 7/24/2008 7:34 AM, Megh Dal wrote: I have created following interactive plot : library(TeachingDemos) plott = function(x) { return(hist(rnorm(as.integer(1000, 10, x)), xlab=NA)) } tkexamp(plott, list(x=list('slider',from=1,to=40, resolution=0.1, init=2)), plotloc='top') Here every

[R] Problem with scatterplot3d example

2008-07-24 Thread Tom La Bone
I tried to run the following example from section 4.1.4 of the "Scatterplot3d - an R package for Visualizing Multivariate Data" vignette and got an error on the part that plots the regression plane: > library(scatterplot3d) > data(trees) > s3d <- scatterplot3d(trees, type = "h", color = "blue", +

Re: [R] Just 2 more questions - for now!

2008-07-24 Thread Mark Difford
Hi Robin, >> I ... can't get lm to work despite reading the help. I can get it to work >> with a single >> explanatory variable, EG model <- lm(data$admissions~data$maxitemp) I'll answer just the second of your questions. Advice: don't just read the help file, look at the examples and run them;

[R] NAs - NAs are not allowed in subscripted assignments

2008-07-24 Thread Kunzler, Andreas
Dear List, I ran into some trouble handling missing values. Assume 2 vectors (numeric) including NAs a <- c(rep(seq(1,4),4),NA,NA) b <- c(sample(1:2,14,replace=T),NA,NA,1,2) I want to replace the values of vector a that are smaller than 2 and larger than 3 into NAs only in case vector b equals

Re: [R] Just 2 more questions - for now!

2008-07-24 Thread Duncan Murdoch
On 7/24/2008 7:01 AM, Williams, Robin wrote: Hi all, Thanks for the help with my previous post. I have just two more questions for the minute. I think I said in a previous post that I like to use the terminal, i.e. run rterm.exe. On exiting the terminal, I am asked if I want to save the work

Re: [R] Problem with scatterplot3d example

2008-07-24 Thread Duncan Murdoch
On 7/24/2008 8:02 AM, Tom La Bone wrote: I tried to run the following example from section 4.1.4 of the "Scatterplot3d - an R package for Visualizing Multivariate Data" vignette and got an error on the part that plots the regression plane: library(scatterplot3d) data(trees) s3d <- scatterplot3d

Re: [R] Interactive plot

2008-07-24 Thread Megh Dal
Thanks for this. Can you please explain me what are those MDI and SDI and the diff in laymans language? --- On Thu, 7/24/08, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > From: Duncan Murdoch <[EMAIL PROTECTED]> > Subject: Re: [R] Interactive plot > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] >

Re: [R] Is there an equivalent * operator?

2008-07-24 Thread Felix Andrews
If you really want to work with character strings, you could do something like data.s1 <- data$date[grep(".*-Sep-.*", date)] (see ?regexp for more on pattern matching) but there are better ways to handle dates. You should convert the character strings into Date objects: see ?Date. And check out t

Re: [R] Just 2 more questions - for now!

2008-07-24 Thread john seers (IFR)
Q1: Have a look at: ?save ?save.image ?load Q2: I am not sure this is right: model<-lm(data$admissions~data$maxitemp) Try and code a line that looks more like this with the variables the names of the columns in your data: model<-lm(admissions ~ maxitemp + minitemp, data=data) Have a read

Re: [R] Interactive plot

2008-07-24 Thread Duncan Murdoch
On 7/24/2008 8:24 AM, Megh Dal wrote: Thanks for this. Can you please explain me what are those MDI and SDI and the diff in laymans language? Not really. Just try them both, the differences are obvious. Duncan Murdoch --- On Thu, 7/24/08, Duncan Murdoch <[EMAIL PROTECTED]> wrote: From:

Re: [R] Is there an equivalent * operator?

2008-07-24 Thread René Capell
Hi Robin, to answer your question: I think you are looking for a regular expression, have a look at regex(). In your particular case, where all the strings show the same structure, you can also use substr() to cut out the substring of interest. More generally, you could consider to convert your

Re: [R] NAs - NAs are not allowed in subscripted assignments

2008-07-24 Thread Richard . Cotton
> I ran into some trouble handling missing values. > > Assume 2 vectors (numeric) including NAs > > a <- c(rep(seq(1,4),4),NA,NA) > b <- c(sample(1:2,14,replace=T),NA,NA,1,2) > > I want to replace the values of vector a that are smaller than 2 and > larger than 3 into NAs only in case vector b e

Re: [R] how to export ".xls" file with colorful cells?

2008-07-24 Thread Gabor Grothendieck
You didn't mention your OS but if its Windows then see: http://tolstoy.newcastle.edu.au/R/help/05/07/8950.html and try adding this line to that -- actually it gives me an error message (from Excel?) using Excel 2007 on Vista, RDCOMClient 0.92-0 and "R version 2.7.1 RC (2008-06-16 r45949)" but it

[R] how know the status of particular process

2008-07-24 Thread Kurapati, Ravichandra (Ravichandra)
Hi I have the process id, How can I know whether it is in active state or not Thanks K.Ravichandra [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

[R] incrementing for loop by 2

2008-07-24 Thread Clark, Jennifer H
Dear List-serv members: How can I structure a for loop so that it will increment the counter by two using R? I am just looking for a simple example that shows where the incrementing part should go. Thanks! Jennifer -- Jennifer Hayes Clark Assistant Professor Department of Political Science Un

[R] How to delete duplicate cases?

2008-07-24 Thread Daniel Wagner
Dear R users,   I have a dataframe with lot of duplicate cases and I want to delete duplicate ones which have low rank and keep that case which has highest rank. e.g   > df1   cno      rank 1  1342    0.23 2  1342    0.14 3  1342    0.56 4  2568    0.15 5  2568    0.89

Re: [R] how know the status of particular process

2008-07-24 Thread Duncan Murdoch
Kurapati, Ravichandra (Ravichandra) wrote: Hi I have the process id, How can I know whether it is in active state or not This is not an R question. Find out how to do it in your operating system (whatever that is), and do the same in R using system(). Duncan Murd

Re: [R] How to delete duplicate cases?

2008-07-24 Thread Jorge Ivan Velez
Dear Daniel, Try this: x=read.table(textConnection("cno rank 1 13420.23 2 13420.14 3 13420.56 4 25680.15 5 25680.89"),header=TRUE,sep="") x[cumsum(tapply(x$rank,x$cno,which.max)),] cno rank 3 1342 0.56 5 2568 0.89 HTH, Jorge On Thu, Jul 24, 2008 at 10:00 AM, D

Re: [R] How to delete duplicate cases?

2008-07-24 Thread Henrique Dallazuanna
Try this: aggregate(x$rank, list(cno=x$cno), max) On 7/24/08, Daniel Wagner <[EMAIL PROTECTED]> wrote: > Dear R users, > > I have a dataframe with lot of duplicate cases and I want to delete duplicate > ones which have low rank and keep that case which has highest rank. > e.g > > > df1 > cno

Re: [R] Weighted variance function?

2008-07-24 Thread Gavin Simpson
On Thu, 2008-07-24 at 02:25 +0530, Arun Kumar Saha wrote: > There is a R function to calculate weighted mean : weighted.mean() under > stats package. Is there any direct R function for calculating weighted > variance as well? Here are two ways; weighted.var() is via the usual formula and weighted.

Re: [R] How to delete duplicate cases?

2008-07-24 Thread Erik Iverson
Daniel - First, use order() to arrange the data.frame into an appropriate format. Then, use duplicated() with the negation operator to get rid of the duplicated values. Daniel Wagner wrote: Dear R users, Â I have a dataframe with lot of duplicate cases and I want to delete duplicate ones

[R] Error - unable to load shared library

2008-07-24 Thread Youngik Yang
Hi, I'm trying to use fastICA package but I only get an error message like following. > library(fastICA) Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/usr/lib/R/library/fastICA/libs/fastICA.so': /usr/lib/R/library/fastICA/libs/fastICA.so: undefined symbol:

[R] error with .dll file and RGtk2

2008-07-24 Thread paulandpen
Hi all, I am getting the following error message. Does somebody know what needs to happen here? I have tried re-installing the RGtk2 package and also downloading a .dll file and installing it in the RGtk2 file folder Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to

[R] [Fwd: Re: Coefficients of Logistic Regression from bootstrap - how to get them?]

2008-07-24 Thread Michal Figurski
Thank you Frank and all for your advices. Here I attach the raw data from the Pawinski's paper. I have obtained permission from the corresponding Author to post it here for everyone. The only condition of use is that the Authors retain ownership of the data, and any publication resulting from the

Re: [R] How to delete duplicate cases?

2008-07-24 Thread Marc Schwartz
on 07/24/2008 09:00 AM Daniel Wagner wrote: Dear R users, I have a dataframe with lot of duplicate cases and I want to delete duplicate ones which have low rank and keep that case which has highest rank. e.g df1 cno rank 1 13420.23 2 13420.14 3 13420.56 4 25680.1

Re: [R] How to delete duplicate cases?

2008-07-24 Thread Patrizio Frederic
this works cno = c(rep(1342,times=3),rep(2568,times=2)) rank= c(.23,.14,.56,.15,.89) df1 = data.frame(cno,rank)[order(cno,rank),] cnou= unique(cno) ind = match(cno,cnou) where = tapply(rank,ind,length) where = cumsum(as.numeric(where)) df1[where,] regards, PF 2008/7

Re: [R] NAs - NAs are not allowed in subscripted assignments

2008-07-24 Thread Kunzler, Andreas
Hy Richie, thank you for the quick response. Unfortunately my problems hold on. Once again: 2 vectors (numeric) including NAs My intention: I want to replace the values of vector a that are smaller than 2 and larger than 3 into NAs only in case vector b equals 1 a <- c(rep(seq(1,4),4),NA,NA) b

[R] Help with which()

2008-07-24 Thread naw3
Hi, I'm using which to find the position of a value in my data table, and it is returning the correct position and the position of another number that differs by an extra decimal place. For example, when I do: where1<-which(Operons==3573.1,arr.ind=TRUE) it returns the position of that number and

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-24 Thread Michal Figurski
Greg and all, Just another thought on bias and variability. As I tried to explain, I perceive this problem as a very practical problem. The equation, that is the goal of this work, is supposed to serve the clinicians to estimate a pharmacokinetic parameter. It therefore must be simple and al

Re: [R] Help with which()

2008-07-24 Thread Erik Iverson
See http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f [EMAIL PROTECTED] wrote: Hi, I'm using which to find the position of a value in my data table, and it is returning the correct position and the position of another number that differs by an ex

Re: [R] Problem with scatterplot3d example

2008-07-24 Thread Uwe Ligges
Duncan Murdoch wrote: On 7/24/2008 8:02 AM, Tom La Bone wrote: I tried to run the following example from section 4.1.4 of the "Scatterplot3d - an R package for Visualizing Multivariate Data" vignette and got an error on the part that plots the regression plane: library(scatterplot3d) data

Re: [R] error with .dll file and RGtk2

2008-07-24 Thread Prof Brian Ripley
On Fri, 25 Jul 2008, paulandpen wrote: Hi all, I am getting the following error message. Does somebody know what needs to happen here? I have tried re-installing the RGtk2 package and also downloading a .dll file and installing it in the RGtk2 file folder Error in dyn.load(x, as.logical(lo

Re: [R] ggplot question

2008-07-24 Thread hadley wickham
On Thu, Jul 24, 2008 at 2:23 AM, Williams Scott <[EMAIL PROTECTED]> wrote: > I am trying to do something simple with ggplot. I wish to draw a density > plot split by group, and fill each group with a different colour (and > each with an alpha =0.25). I have tried a number of variations of the > fol

[R] What is wrong with this contrast matrix?

2008-07-24 Thread Christoph Scherber
Dear all, I am fitting a multivariate linear model with 7 response variables and 1 explanatory variable. The following matrix P: P <- cbind( c(1,-1,0,0,0,0,0), c(2,2,2,2,2,-5,-5), c(1,0,0,-1,0,0,0), c(-2,-2,0,-2,2,2,2), c(-2,1,0,1,0,0,0), c(0,-1,0,1,0,0,0)) should consist of orthogonal elemen

Re: [R] NAs - NAs are not allowed in subscripted assignments

2008-07-24 Thread Gabor Csardi
On Thu, Jul 24, 2008 at 04:45:14PM +0200, Kunzler, Andreas wrote: > Hy Richie, thank you for the quick response. > > Unfortunately my problems hold on. > > Once again: 2 vectors (numeric) including NAs > My intention: I want to replace the values of vector a that are smaller > than 2 and larger

Re: [R] NAs - NAs are not allowed in subscripted assignments

2008-07-24 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Kunzler, Andreas > Sent: Thursday, July 24, 2008 7:45 AM > To: [EMAIL PROTECTED] > Cc: r-help@r-project.org; [EMAIL PROTECTED] > Subject: Re: [R] NAs - NAs are not allowed in subscripted assignments >

Re: [R] What is wrong with this contrast matrix?

2008-07-24 Thread Ted Harding
On 24-Jul-08 15:30:57, Christoph Scherber wrote: > Dear all, > I am fitting a multivariate linear model with 7 response variables and > 1 explanatory variable. > > The following matrix P: > > P <- cbind( > c(1,-1,0,0,0,0,0), > c(2,2,2,2,2,-5,-5), > c(1,0,0,-1,0,0,0), > c(-2,-2,0,-2,2,2,2), > c(-2

Re: [R] incrementing for loop by 2

2008-07-24 Thread Wacek Kusnierczyk
Clark, Jennifer H wrote: > Dear List-serv members: > How can I structure a for loop so that it will increment the counter by two > using R? I am just looking for a simple example that shows where the > incrementing part should go. Thanks! > > for (i in seq(, , by=2)) { ... } vQ ___

Re: [R] What is wrong with this contrast matrix?

2008-07-24 Thread Christoph Scherber
Dear Ted, Thanks for your help; is there any straightforward way to construct an orthogonal contrast matrix by hand? Of course contrasts(as.factor(letters[1:6])) would also do the job, but user-defined contrasts would make more sense. Ideally, I would like to have a function that "tests" for

Re: [R] Help with which()

2008-07-24 Thread Ben Bolker
Erik Iverson biostat.wisc.edu> writes: > > See > > http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f > > naw3 duke.edu wrote: > > I'm using which to find the position of a value in my data table [snip] > For example, when I do: > > > > where1<

Re: [R] NAs - NAs are not allowed in subscripted assignments

2008-07-24 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Gabor Csardi > Sent: Thursday, July 24, 2008 8:39 AM > To: Kunzler, Andreas > Cc: r-help@r-project.org; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: Re: [R] NAs - NAs are not allowed in subscripte

Re: [R] Help with which()

2008-07-24 Thread Ted Harding
On 24-Jul-08 15:35:45, Erik Iverson wrote: > See > > http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-the > se-numbers-are-equal_003f That's not an applicable response: The difference between 3573.1 and 3573.15 is far too large for them to be confused by "==". Thr confusion on

Re: [R] Help with which()

2008-07-24 Thread Erik Iverson
Ben Bolker wrote: Erik Iverson biostat.wisc.edu> writes: See http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f naw3 duke.edu wrote: I'm using which to find the position of a value in my data table [snip] For example, when I do: where

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-24 Thread Bert Gunter
To quote (or as nearly so as I can) Einstein's famous remark: "Make everything as simple as possible ... but no simpler" Moreover, "as possible" here means "maintaining fidelity to scientific validity," not "simple enough for me to understand." So I don't think a physicist can explain relativist

Re: [R] NAs - NAs are not allowed in subscripted assignments

2008-07-24 Thread Gabor Csardi
On Thu, Jul 24, 2008 at 09:30:54AM -0700, Nordlund, Dan (DSHS/RDA) wrote: [...] > > > a <- c(rep(seq(1,4),4),NA,NA) > > > b <- c(rep(seq(1,2),7),NA,NA,1,2) > > > > Andreas, > > > > what is wrong with > > > > a[ (a < 2 | a > 3) & b==1 ] <- NA > > > > ? Isn't this what you want? > > [...] > >

[R] Dividing by 0

2008-07-24 Thread nmarti
I'm trying to calculate the percent change for a time-series variable. Basically the first several observations often look like this, x <- c(100, 0, 0, 150, 130, 0, 0, 200, 0) and then later in the life of the variable they're are generally no more 0's. So when I try to calculate the percent c

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-24 Thread Michal Figurski
What are the arguments against fidelity of this concept to scientific validity? The concept of predictive performance was devised by one of you, biostatisticians - not me! I accept the authoritative view of the person that did it, especially because I do understand it. When I think of it, ex

Re: [R] Dividing by 0

2008-07-24 Thread Robert Baer
I'm trying to calculate the percent change for a time-series variable. Basically the first several observations often look like this, x <- c(100, 0, 0, 150, 130, 0, 0, 200, 0) and then later in the life of the variable they're are generally no more 0's. So when I try to calculate the percent c

[R] Parallel Processing and Linear Regression

2008-07-24 Thread Alan Spearot
Does anybody have any suggestions regarding applying standard regression packages lm(), hccm(), and others within a parallel environment? Most of the packages I've found only deal with iterative processes (bootstrap) or simple linear algebra. While the latter might help, I'd rather not program th

[R] R-package install

2008-07-24 Thread cindy Guo
Hi, I have a R package, which is a .tar.tar file. And it is said to be source code for all platforms. And the author said it should install on any system (but he didn't know about Windows). I am wondering if I can use this package in Windows R. Thank you, Cindy [[alternative HTML version d

Re: [R] NAs - NAs are not allowed in subscripted assignments

2008-07-24 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: Gabor Csardi [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 24, 2008 9:59 AM > To: Nordlund, Dan (DSHS/RDA) > Cc: r-help@r-project.org > Subject: Re: [R] NAs - NAs are not allowed in subscripted assignments > > On Thu, Jul 24, 2008 at 09:30:54AM -0700, Nordl

Re: [R] Help with which()

2008-07-24 Thread Ben Bolker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: | Hi guys, | | Thank you all for looking at this, and I'm sorry - I was making a silly | mistake. | I was using a previous version of the data table in R, while looking at | a new | file in excel (its easier for me to view the

Re: [R] How to get rule number in arules

2008-07-24 Thread Hans W. Borchers
As always, 'str(rules)' will provide you with a view on the internal structure of 'rules'. By the way, 'rules' is of class 'rules', see the "rules-class" entry in the ARULES help pages, with more explanations on the meaning of attributes. For example, '[EMAIL PROTECTED]' will show support, confid

Re: [R] incrementing for loop by 2

2008-07-24 Thread Marc Schwartz
on 07/24/2008 07:59 AM Clark, Jennifer H wrote: Dear List-serv members: How can I structure a for loop so that it will increment the counter by two using R? I am just looking for a simple example that shows where the incrementing part should go. Thanks! It would be helpful to have an idea of w

Re: [R] Calculating Betweenness - Efficiency problem

2008-07-24 Thread Senthil Purushothaman
Dear Gabor, I am really sorry about the file attachment. As you might have figured out I am quite new to the forum interaction techniques. I will keep your suggestion in mind. Thanks for taking the time to test the data I sent you. I found out where exactly the problem is. The surprising p

[R] Problem with GLS dwtest function

2008-07-24 Thread mm745
Hi, I want to test for independence in my GLS model fitp2, but when I try to use the dwtest function in the lmtest library, I get the error message "Error in terms.default(formula) : no terms component". The model and data set are below. Any suggestions would be really helpful! Thanks a lot in ad

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-24 Thread Frank E Harrell Jr
Michal Figurski wrote: Thank you all for your words of wisdom. I start getting into what you mean by bootstrap. Not surprisingly, it seems to be something else than I do. The bootstrap is a tool, and I would rather compare it to a hammer than to a gun. People say that hammer is for driving na

Re: [R] [Fwd: Re: Coefficients of Logistic Regression from bootstrap - how to get them?]

2008-07-24 Thread Frank E Harrell Jr
Michal Figurski wrote: Thank you Frank and all for your advices. Here I attach the raw data from the Pawinski's paper. I have obtained permission from the corresponding Author to post it here for everyone. The only condition of use is that the Authors retain ownership of the data, and any public

Re: [R] Coconut benchmark for R?

2008-07-24 Thread Hans W. Borchers
I wonder what such a benchmark test would be good for. Relevant and speaking tests in Global Optimization are formulated as models in AMPL, GAMS, GMPK, MPS, etc. Rewriting a model in matrix form can be a tedious manual task and I have not yet seen it. Very few optimization packages in R accept s

[R] Multinomial logistic regression with non-numerical data.

2008-07-24 Thread TL Vincent
Hi all, I have a set of data which looks similar to this (only way bigger!) linktyperegister F D a E D b R D c A T d D T a F D b . . . . . . and would like to

Re: [R] NAs - NAs are not allowed in subscripted assignments

2008-07-24 Thread Gabor Csardi
On Thu, Jul 24, 2008 at 10:39:34AM -0700, Nordlund, Dan (DSHS/RDA) wrote: [...] > Yes, it does help. I was misunderstanding how logical values are > used for indexing. I assumed incorrectly that a value would be > returned only if the index expression evaluated as TRUE. It would > seem that the

[R] factor question

2008-07-24 Thread Edna Bell
Hi! Suppose I have a factor: > fac1 <- factor(rep(c("dog","cat","tree"),c(2,3,4))) > fac1 [1] dog dog cat cat cat tree tree tree tree Levels: cat dog tree > length(fac1) [1] 9 Now I want to get rid of the dogs: > fac1 <- fac1[3:9] > fac1 [1] cat cat cat tree tree tree tree Levels: cat do

Re: [R] factor question

2008-07-24 Thread Henrique Dallazuanna
Try: fac1[3:9][drop=T] On Thu, Jul 24, 2008 at 4:19 PM, Edna Bell <[EMAIL PROTECTED]> wrote: > Hi! > > Suppose I have a factor: > >> fac1 <- factor(rep(c("dog","cat","tree"),c(2,3,4))) >> fac1 > [1] dog dog cat cat cat tree tree tree tree > Levels: cat dog tree >> length(fac1) > [1] 9 > > No

Re: [R] factor question

2008-07-24 Thread Mark Difford
Hi Edna, Because I am "always" subsetting, I keep the following function handy mydata[] <- lapply(mydata, function(x) if(is.factor(x)) x[,drop=T] else x) This will strip out all factor levels that have been dropped by a previous subsetting operation. For novice users of R (though I am not sugge

[R] ggplot2 help

2008-07-24 Thread Edna Bell
Hi yet again! Thank you for being patient with me. Is there a "how to" for ggplot2, please? I would like to look at it, but have no idea where to start, please. Thanks, Edna Bell __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] Dividing by 0

2008-07-24 Thread Rolf Turner
On 25/07/2008, at 5:24 AM, Robert Baer wrote: I'm trying to calculate the percent change for a time-series variable. Basically the first several observations often look like this, x <- c(100, 0, 0, 150, 130, 0, 0, 200, 0) and then later in the life of the variable they're are generally

[R] Cairo graphics

2008-07-24 Thread Edna Bell
Hi again. Sorry to be a pest. What are Cairo graphics and how to find out about them, please? Thanks yet again, Edna __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-projec

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-24 Thread John Kane
--- On Thu, 7/24/08, Michal Figurski <[EMAIL PROTECTED]> wrote: > From: Michal Figurski <[EMAIL PROTECTED]> > Subject: Re: [R] Coefficients of Logistic Regression from bootstrap - how to > get them? > To: > Cc: "r-help@r-project.org" > Received: Thursday, July 24, 2008, 11:02 AM > Greg and a

[R] Question: how to build a subset to do separate calculations

2008-07-24 Thread Spencer
Dear R Experts, I am trying to create several subsets that I want to use as separate datasets. After separate subsets are created for each country, I want to do some calculations for each. I did the following: data <- data.frame(na.omit(read.spss("trial.sav"))) attach (data) Netherlands <-

[R] SPR experiment: using lmer, transforming data, collinearity, and using a covariable

2008-07-24 Thread Claire Delle Luche
Dear R users, I try to analyse a self paced reading experiment where I have two fixed variables (Relativiser, Attachment), two random variables (Participant, ItemNbr), and one covariable (BiasValue). The dependant variable is RT, reading time region by region. My aim is to remove the variance i

Re: [R] Subsetting an array by a vector of dimensions

2008-07-24 Thread Kenn Konstabel
Returning to the old question ... > Is it possible to subset an n-dimensional array by a > vector of n dimensions? On Sat, Jul 12, 2008 at 1:34 AM, Wolfgang Huber <[EMAIL PROTECTED]> wrote: > > do.call("[", list(x,1,2,TRUE)) > [1] 3 9 15 21 > > See also http

Re: [R] Question: how to build a subset to do separate calculations

2008-07-24 Thread Erik Iverson
Spencer - Spencer wrote: Dear R Experts, I am trying to create several subsets that I want to use as separate datasets. After separate subsets are created for each country, I want to do some calculations for each. I did the following: data <- data.frame(na.omit(read.spss("trial.sav"))) at

Re: [R] Cairo graphics

2008-07-24 Thread Philipp Pagel
> What are Cairo graphics and how to find out about them, please? http://www.google.de/search?hl=de&q=cairo+graphics cu Philipp -- Dr. Philipp Pagel Lehrstuhl für Genomorientierte Bioinformatik Technische Universität München Wissenschaftszentrum Weihenstephan 85350 Freising, Germany ht

[R] Should this PDF render correctly without font embedding?

2008-07-24 Thread Jeffrey Horner
A professor here at Vanderbilt sent me the following code. Each of the text strings should right justify against the center vertical bar, but because of font issues it doesn't. I understand that there are workarounds, but I was just curious if this was consistent across all platforms. On linux

Re: [R] R-package install

2008-07-24 Thread Mark Difford
Hi Cindy, >> Hi, I have a R package, which is a .tar.tar file. And it is said to be >> source code for all >> platforms. ... I am wondering if I can use this package in Windows R. If it is source code you would first need to compile it to binary format before you can use it. Can you do that? W

Re: [R] Question: how to build a subset to do separate calculations

2008-07-24 Thread stephen sefick
or sapply as I have recently found to be useful. On Thu, Jul 24, 2008 at 4:33 PM, Erik Iverson <[EMAIL PROTECTED]> wrote: > Spencer - > > Spencer wrote: > >> >> Dear R Experts, >> >> I am trying to create several subsets that I want to use as separate >> datasets. After separate subsets are creat

  1   2   >