Re: [R] R Packages Crack the 3,000 Mark!

2009-11-25 Thread Peter Dalgaard
Stephan Kolassa wrote: Hi Bob, Muenchen, Robert A (Bob) wrote: Does anyone have a program that graphs the growth of R packages? I don't know if that historical data is around. John Fox had a slide on this in his useR 2008 talk "The Social Organization of the R Project" (page 7), with packag

Re: [R] Multivariate problems . . . with 200 resposes variables and 1 explanatory variable

2009-11-25 Thread Gavin Simpson
On Wed, 2009-11-25 at 16:55 -0800, ychu066 wrote: > How should I analysis it in R all the resposes variables are ordinal > from 0 to 10. and the explanatory variable is a factor ... You give very little to go on (please read the posting guide for future reference), but: If you want to analys

[R] How to display an image on RGL plot?

2009-11-25 Thread Vladimir Eremeev
Hi all. It's been a long time since I wrote to this list. Glad to see the R project well and working. I am working with a 3D plot similar to this: http://old.nabble.com/file/p26525177/rgl-device.png rgl-device.png The underlying picture is a JPEG image, loaded with the rimage package and coer

Re: [R] jpeg support in R

2009-11-25 Thread Gavin Simpson
On Wed, 2009-11-25 at 14:26 -0800, kennyPA wrote: > Hi, I'd like to have jpeg support in R under RedHat Linux, when I ran the > ./configure in the install process, the config.log gave me the following > error messages: > > configure:43621: checking if jpeglib version >= 6b > conftest.c:200:21: err

Re: [R] Feature request for as.Date() function 20)

2009-11-25 Thread nabble . 30 . miller_2555
An easy way is just to write your own function that will accept "NA", convert it to NA and then call as.Date. R is a functional language, so write some functions. Don't try to overload existing functions with new options that may break a lot of existing code. If you have special requirements, th

Re: [R] arg min ???

2009-11-25 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 25.11.2009 16:50:49: > > This is nice, but i have to define vector of possible theta, this is not what > i want to do. > I have vector of unknow parameters theta. I have som estimate of theta, but > i want to do better estimate of them, using some cri

Re: [R] Grouped Boxplot

2009-11-25 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 24.11.2009 18:44:43: > Back in March Soren Vogel asked exactly the same thing: > > Here is the solution that was offered then. (He offered a dataset as > requested in the Posting Guide.) ... with only a minor adjustment: > > g <- rep.int(c("A", "B",

Re: [R] as.data.frame.table() to convert by() output to a data frame

2009-11-25 Thread David Winsemius
On Nov 26, 2009, at 12:17 AM, David Winsemius wrote: On Nov 25, 2009, at 9:54 PM, Michael Ash wrote: I remain confused by the difference between library(MASS) data(Cars93) as .data .frame (tapply (Cars93 $Price,list(Cars93$Origin,Cars93$AirBags,Cars93$Passengers),median)) as .data .frame .

Re: [R] as.data.frame.table() to convert by() output to a data frame

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 9:54 PM, Michael Ash wrote: I remain confused by the difference between library(MASS) data(Cars93) as .data .frame (tapply (Cars93 $Price,list(Cars93$Origin,Cars93$AirBags,Cars93$Passengers),median)) as .data .frame .table (tapply (Cars93 $Price,list(Cars93$Origin,Cars93$A

[R] Binary operators in packages and documentation?

2009-11-25 Thread Zhou Fang
Hi, I'm trying to make a package defining a new (S3?) class. Part of this involves a custom version of a binary operator. e.g. "*.foo", so I can do obj.foo * bar, or things like that. Now, I think to makes this work with a NAMESPACE, I can do S3method("*", foo) in the NAMESPACE file, right? The

Re: [R] as.data.frame.table() to convert by() output to a data frame

2009-11-25 Thread Michael Ash
I remain confused by the difference between library(MASS) data(Cars93) as.data.frame(tapply(Cars93$Price,list(Cars93$Origin,Cars93$AirBags,Cars93$Passengers),median)) as.data.frame.table(tapply(Cars93$Price,list(Cars93$Origin,Cars93$AirBags,Cars93$Passengers),median)) I clearly want the latter,

Re: [R] Multivariate problems . . . with 200 resposes variables and 1 explanatory variable

2009-11-25 Thread Jason Morgan
Please see the posting guide here: http://www.r-project.org/posting-guide.html In short, it would be helpful if you provided more information on your data and what the goal of your analysis is. However, to get you started, see the polr() function in the MASS package. Depending on your goal/data,

Re: [R] Question in using e1071 svm routine

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 7:54 PM, akal wrote: Hi all, I am encountering the same error "Error in if (any(co)) { : missing value where TRUE/FALSE needed" when i run:model <- svm(databctrain, classesbctrain) I am not sure what this error means . is it some problem with the dataset ? How do y

Re: [R] Question in using e1071 svm routine

2009-11-25 Thread akal
Hi all, I am encountering the same error "Error in if (any(co)) { : missing value where TRUE/FALSE needed" when i run:model <- svm(databctrain, classesbctrain) I am not sure what this error means . is it some problem with the dataset ? Could i get some help ? Thanks, Akshatha losemind wrot

[R] R help with princomp and pam clustering

2009-11-25 Thread Tyler82
Hi all! I am working with R package cluster and I have a little problem: let's say I have two datasets...first one ("A") is divided into 4 clusters by means of Pam algorythm. Let's say I want to project the second database ("B") onto the Comp.1 X Comp.2 graph, and see where its elements are place

[R] jpeg support in R

2009-11-25 Thread kennyPA
Hi, I'd like to have jpeg support in R under RedHat Linux, when I ran the ./configure in the install process, the config.log gave me the following error messages: configure:43621: checking if jpeglib version >= 6b conftest.c:200:21: error: jpeglib.h: No such file or directory I assume I need to

[R] Adding text in the panels for Trellis plot ...

2009-11-25 Thread ychu066
i was trying to do a for loop for plotting the histograms , but it doesnt work properly > library(lattice) > columns <- 8:153 > plots <- vector("list", length(columns)) > j <- 0 > for (i in columns) + { + plots[[ j <- j+1 ]] <- histogram( ~ data[,i] | data[,2],ylab = "Frequency", +

[R] Multivariate problems . . . with 200 resposes variables and 1 explanatory variable

2009-11-25 Thread ychu066
How should I analysis it in R all the resposes variables are ordinal from 0 to 10. and the explanatory variable is a factor ... -- View this message in context: http://old.nabble.com/Multivariate-problems-.-.-.-with-200-resposes-variables-and-1-explanatory-variable-tp26522912p26522912.html

Re: [R] Arrhenius plot with lattice

2009-11-25 Thread milton ruser
Hi Markus, PLEASE do read the posting guide http://www.R-project.org/posting-guide.html Your example is not reproducible. Help your helper :-) bests miltinho On Wed, Nov 25, 2009 at 5:54 PM, Markus Häge wrote: > hello there, > > I like to print a t

Re: [R] Concave hull

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 7:51 PM, David Winsemius wrote: Drats; Forgot the plot: xx <- runif(100, -1, 1) yy <- abs(xx)+rnorm(100,0,.2); plot(xx,yy, xlim=c( min(xx)-sd(xx), max(xx)+sd(xx)), ylim =c( min(yy)-sd(yy), max(yy)+sd(yy))) dens2 <- kde2d(xx, yy, lims=c(min(xx)-sd(xx), max(xx)+sd(xx),

Re: [R] Concave hull

2009-11-25 Thread David Winsemius
Drats; Forgot the plot: xx <- runif(100, 0, 1) xx <- runif(100, -1, 1) yy <- abs(xx)+rnorm(100,0,.2); plot(xx,yy, xlim=c( min(xx)-sd(xx), max(xx)+sd(xx)), ylim =c( min(yy)-sd(yy), max(yy)+sd(yy))) dens2 <- kde2d(xx, yy, lims=c(min(xx)-sd(xx), max(xx)+sd(xx), min(yy)- sd(yy), max(yy)+sd(yy)

Re: [R] Concave hull

2009-11-25 Thread David Winsemius
This is not a true convave hull, but a 2D density is something similar and perhaps more "statistical": library(MASS) xx <- runif(100, 0, 1) xx <- runif(100, -1, 1) yy <- abs(xx)+rnorm(100,0,.2) dens2 <- kde2d(xx, yy, lims=c(min(xx)-sd(xx), max(xx)+sd(xx), min(yy)-sd(yy), max(yy)+sd(yy) )

Re: [R] Concave hull

2009-11-25 Thread Remko Duursma
Oh right I think I did not catch that *because of* the caps. Sorry. r - Remko Duursma Post-Doctoral Fellow Centre for Plants and the Environment University of Western Sydney Hawkesbury Campus Richmond NSW 2753 Dept of Biological Science Macqua

Re: [R] Concave hull

2009-11-25 Thread Barry Rowlingson
On Wed, Nov 25, 2009 at 11:39 PM, Remko Duursma wrote: > See the function 'convhulln' in the 'geometry' package. It uses this > algorithm : http://www.qhull.org/ That looks like a CONVEX hull, the original poster asked about CONCAVE hulls (and in all CAPS to emphasise this!). I've seen various

Re: [R] R or C++ on FreeNX servers

2009-11-25 Thread Gad Abraham
On Thu, Nov 26, 2009 at 8:00 AM, Murray Jorgensen wrote: > Hi all, > > I have just found out that the machine learning group in our Faculty has a > lot of spare capacity on their FreeNX servers. I do not know a lot about > these beasts but I understand that they are a free version of something > p

Re: [R] Concave hull

2009-11-25 Thread Remko Duursma
See the function 'convhulln' in the 'geometry' package. It uses this algorithm : http://www.qhull.org/ remko - Remko Duursma Post-Doctoral Fellow Centre for Plants and the Environment University of Western Sydney Hawkesbury Campus Richmond NSW 27

[R] Arrhenius plot with lattice

2009-11-25 Thread Markus Häge
hello there, I like to print a theoretical function into my data. It would work with "panel.curve" when it's all "normal". but unfortunately it's an arrhenius plot and I need "1000/Temperature"(70-300K) at the x-axis. With my data it wasn't a Problem but now I have to add this function to the plot

Re: [R] as.data.frame.table() to convert by() output to a data frame

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 4:11 PM, Michael Ash wrote: Dear all, This seems to be working, but I'd like to make sure that I'm not doing anything wrong. I am using by() to construct a complicated summary statistic by several factors in my data (specifically, the 90-50 income ratio by city and race).

Re: [R] Insert elements into a vector in a defined positions

2009-11-25 Thread Rolf Turner
On 26/11/2009, at 10:46 AM, Manuel Ramon wrote: Dear R users, I have a vector of length n and I want to insert some elements (in my case the NA string) into a defined positions. For example, my vector is z1 and I want to add NA's in positions 4, 6 y 7 so after that, my new vector, z2, s

[R] Interpretation of plots in linear regression models (verification of Gauss-Markov hypothesis)

2009-11-25 Thread jose romero
Hello R Gurus: I'm doing a simple linear regression model: modelo1 <- lm(X9 ~ 1 + X1 + I(log(X2)) + X3 + I(log(X4)) + X5 + I(log(X6)) + X7) of which i later do a plot: plot(modelo1) This shows 4 graphics, about which I ask: 1) In the "Residuals vs. Fitted", what does the red curve represent?

Re: [R] How to sum only a few elements in a line

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 3:45 PM, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Marcio Resende Sent: Wednesday, November 25, 2009 12:27 PM To: r-help@r-project.org Subject: [R] How to sum only a few elements in

[R] predict(): NoSuchMethodError

2009-11-25 Thread nstender49
I am currently working on a code which clusters attributes from a data set, then uses a linear regression model to predict NA values in the data set. The code works for almost all cases, but then errors out on a case that seems like it should work the same. This is the line of code that is givi

Re: [R] Feature request for as.Date() function 20)

2009-11-25 Thread nabble . 30 . miller_2555
On Wed, Nov 25, 2009 at 2:56 PM, jim holtman - jholt...@gmail.com <+nabble+miller_2555+9dc9649aca.jholtman#gmail@spamgourmet.com> wrote: > Seems to work fine in my testing: > > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-co

[R] as.data.frame.table() to convert by() output to a data frame

2009-11-25 Thread Michael Ash
Dear all, This seems to be working, but I'd like to make sure that I'm not doing anything wrong. I am using by() to construct a complicated summary statistic by several factors in my data (specifically, the 90-50 income ratio by city and race). cityrace.by <- by(microdata, list(microdata$city,mi

[R] Insert elements into a vector in a defined positions

2009-11-25 Thread Manuel Ramon
Dear R users, I have a vector of length n and I want to insert some elements (in my case the NA string) into a defined positions. For example, my vector is z1 and I want to add NA's in positions 4, 6 y 7 so after that, my new vector, z2, should have a length of 10+3. z1 <- 1:10 id <- c(4,6,7

[R] R installation error: perl not found

2009-11-25 Thread Cristian Opazo
Hello: I'm trying to install R 2.10 on a Linux 64-bit machine running RHE4 using the "R-core-2.10.0-2.el4.i386.rpm" install package I downloaded from http://cran.opensourceresources.org/. After executing the RPM, the system looks for package dependencies and I get the following error message:

[R] R or C++ on FreeNX servers

2009-11-25 Thread Murray Jorgensen
Hi all, I have just found out that the machine learning group in our Faculty has a lot of spare capacity on their FreeNX servers. I do not know a lot about these beasts but I understand that they are a free version of something produced by a firm called "NoMachine". They are designed for exe

Re: [R] Reading from Google Docs

2009-11-25 Thread Farrel Buchinsky
Oh OH! Could you please help with a problem that I never used to get. library(RGoogleDocs) ps <-readline(prompt="get the password in ") sheets.con = getGoogleDocsConnection(getGoogleAuth("fjb...@gmail.com", ps, service ="wise")) ts2=getWorksheets("OnCall",sheets.con) Those opening lines of script

Re: [R] R Packages Crack the 3,000 Mark!

2009-11-25 Thread Stephan Kolassa
Hi Bob, Muenchen, Robert A (Bob) wrote: Does anyone have a program that graphs the growth of R packages? I don't know if that historical data is around. John Fox had a slide on this in his useR 2008 talk "The Social Organization of the R Project" (page 7), with package counts up to March 20

Re: [R] Feature request for as.Date() function

2009-11-25 Thread smu
hi, it fails, when the NA is surrounded by double quotes, which is the default way of quoting of the write.table command. x <- read.csv(textConnection('date,value + + 2009-01-01,10 + + 2009-02-01,1 + + "NA", 3'), colClasses=c("Date", 'integer')) Fehler in fromchar(x) : character string is not in

Re: [R] Reading from Google Docs

2009-11-25 Thread Farrel Buchinsky
That was painless. I had already installed Rtools and had already put it on my path. Your line worked very well. [Thanks for telling me. However I did it last time was worse than sticking daggers in my eyes. ] install.packages( "RGoogleDocs", repos="http://www.omegahat.org/R";, type="source" ) I

Re: [R] order of panels in xyplots

2009-11-25 Thread Peter Ehlers
Titus Malsburg wrote: The documentation of xyplot could be improved here. It says: "If 'index.cond' is a list, it has to be as long as the number of conditioning variables, and the 'i'-th component has to be a valid indexing vector for the integer vector '1:nlevels(g_i)' (which can, am

Re: [R] R or C++ on FreeNX servers

2009-11-25 Thread Tobias Verbeke
Hi Murray, Murray Jorgensen wrote: I have just found out that the machine learning group in our Faculty has a lot of spare capacity on their FreeNX servers. I do not know a lot about these beasts but I understand that they are a free version of something produced by a firm called "NoMachine".

Re: [R] lattice: plotting in a loop

2009-11-25 Thread Ryan Archer
Ah, it's a FAQ ... thought I'd looked hard enough. The ignominy, and for a first post! Well, in any case, thanks a lot Baptiste. 2009/11/25 baptiste auguie > Hi, > it's a FAQ, you need to print() the plot, > > > http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-n

Re: [R] How to sum only a few elements in a line

2009-11-25 Thread Peter Ehlers
Marcio Resende wrote: Hello, I have a matrix with the numbers 0,1 and 9 I would like to write a function that could sum each line skiping everytime a number 9 appears for example [0 1 0 1 1 9 1] the sum would be 4. However I cannot replace 9 by 0 otherwise after the sum is done I wouldn´t be a

Re: [R] lattice: plotting in a loop

2009-11-25 Thread baptiste auguie
Hi, it's a FAQ, you need to print() the plot, http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f baptiste 2009/11/25 Ryan Archer : > Hi, > > I'm having trouble seeing graphics output from lattice xyplot() when called > from inside a for loop: > > x <-

Re: [R] R or C++ on FreeNX servers

2009-11-25 Thread Cedrick W. Johnson
All FreeNX allows you to do is access a regular linux machine using X over SSH as opposed to ssh'ing in, redirecting the X-display back to your local machine (running a xserver locally).. You can install R on the machine(s) just as you would normally, and if the machines are in some sort of cl

[R] lattice: plotting in a loop

2009-11-25 Thread Ryan Archer
Hi, I'm having trouble seeing graphics output from lattice xyplot() when called from inside a for loop: x <- 1:50 for ( i in 1:5 ) { y <- rnorm(x) xyplot(y~x) # no graphics when inside for-loop # plot(x,y)# works fine # Sys.sleep(0.5) # doesn't seem to help } The x

[R] R or C++ on FreeNX servers

2009-11-25 Thread Murray Jorgensen
Hi all, I have just found out that the machine learning group in our Faculty has a lot of spare capacity on their FreeNX servers. I do not know a lot about these beasts but I understand that they are a free version of something produced by a firm called "NoMachine". They are designed for executi

Re: [R] How to sum only a few elements in a line

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 3:27 PM, Marcio Resende wrote: Hello, I have a matrix with the numbers 0,1 and 9 I would like to write a function that could sum each line skiping everytime a number 9 appears for example [0 1 0 1 1 9 1] sum(x[x != 9]) the sum would be 4. However I cannot replace 9

Re: [R] How to sum only a few elements in a line

2009-11-25 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Marcio Resende > Sent: Wednesday, November 25, 2009 12:27 PM > To: r-help@r-project.org > Subject: [R] How to sum only a few elements in a line > > > Hello, > > I have a matrix

Re: [R] How to sum only a few elements in a line

2009-11-25 Thread Peter Alspach
Tena koe Marcio Try something like (untested) apply(yourMatrix, 1, function(x) sum(x[x!=9])) HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Marcio Resende > Sent: Thursday, 26 November 2009 9:27 a.m

Re: [R] Grouped Barplot

2009-11-25 Thread Gary
I'm able to add legend. ~Gary On Wed, Nov 25, 2009 at 3:15 PM, Gary wrote: > Thanks David. I reduced the data set and its copied below (also attached to > this email as text file). Now N=50, Only 2 years, Only 2 Cities. I tried: > > foo<-read.table("SampleData.txt", header=TRUE) > boxplot(foo$ad

Re: [R] Reading from Google Docs

2009-11-25 Thread Charlie Sharpsteen
On Wed, Nov 25, 2009 at 12:02 PM, Farrel Buchinsky wrote: > I reinstalled from a binary that Duncan Temple Lang placed in omegahat. I > see that omegahat has a subdirectory for each version of R. There is not a > directory for 2.10. I took the liberty of taking it from the 2.9 directory. That exp

Re: [R] Mysterious R script behavior when called from webserver

2009-11-25 Thread Dylan Beaudette
On Wednesday 25 November 2009, Barry Rowlingson wrote: > On Wed, Nov 25, 2009 at 8:15 PM, Dylan Beaudette > > wrote: > > Hi, > > > > I am trying to transition a system based on dynamic image generation (via > > R) from our development system to a production environment. Our R script > > functions

Re: [R] Mysterious R script behavior when called from webserver

2009-11-25 Thread Barry Rowlingson
On Wed, Nov 25, 2009 at 8:15 PM, Dylan Beaudette wrote: > Hi, > > I am trying to transition a system based on dynamic image generation (via R) > from our development system to a production environment. Our R script > functions as expected when run by a regular user. However the script dies > when

Re: [R] order of panels in xyplots

2009-11-25 Thread Titus Malsburg
The documentation of xyplot could be improved here. It says: "If 'index.cond' is a list, it has to be as long as the number of conditioning variables, and the 'i'-th component has to be a valid indexing vector for the integer vector '1:nlevels(g_i)' (which can, among other things, repeat

[R] error with hmm()?

2009-11-25 Thread Alon Ben-Ari
Hello R users, I am suing library(hmm.discnp) I have a vector y " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 [741] 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 2 2 1 0 0 0 0 0" So I did y=y+1 (Otherwise R crahsed) "... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6 1 1 1 1 1 1 1 1 1 1 1 1

[R] How to sum only a few elements in a line

2009-11-25 Thread Marcio Resende
Hello, I have a matrix with the numbers 0,1 and 9 I would like to write a function that could sum each line skiping everytime a number 9 appears for example [0 1 0 1 1 9 1] the sum would be 4. However I cannot replace 9 by 0 otherwise after the sum is done I wouldn´t be able to distiguish which o

Re: [R] Grouped Barplot

2009-11-25 Thread Gary
Thanks David. I reduced the data set and its copied below (also attached to this email as text file). Now N=50, Only 2 years, Only 2 Cities. I tried: foo<-read.table("SampleData.txt", header=TRUE) boxplot(foo$admit ~ foo$city + foo$year, col=2:3) I need some help with: 1) Defining labels for x-ax

[R] Mysterious R script behavior when called from webserver

2009-11-25 Thread Dylan Beaudette
Hi, I am trying to transition a system based on dynamic image generation (via R) from our development system to a production environment. Our R script functions as expected when run by a regular user. However the script dies when calling the png() function, when started by the webserver user.

Re: [R] Feature request for as.Date() function

2009-11-25 Thread jim holtman
Seems to work fine in my testing: > x <- read.csv(textConnection("date,value + 2009-01-01,10 + 2009-02-01,1 + 'NA', 3"), colClasses=c("Date", 'integer')) > > str(x) 'data.frame': 3 obs. of 2 variables: $ date :Class 'Date' num [1:3] 14245 14276 NA $ value: int 10 1 3 > x <- read.csv(textCon

Re: [R] predict: remove columns with new levels automatically

2009-11-25 Thread Andreas Wittmann
Thank you all for the good advice. Now i did a fast hack, which does want i was looking for, maybe anyone else finds this usefull set.seed(0) x <- rnorm(9) y <- x + rnorm(9) training <- data.frame(x=x, y=y, z1=c(rep("A", 3), rep("B", 3), rep("C", 3)),

Re: [R] Grouped Barplot

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 1:48 PM, Gary wrote: Hi R Users, I tried plotting a similar boxplot as it is on the FOLLOWING LINK: http://www.imachordata.com/wp-content/uploads/2009/09/boxplot.png Looks like a product of a function from ggplot2. In fact trimming that URL brings you to a page with th

Re: [R] Reading from Google Docs

2009-11-25 Thread Charlie Sharpsteen
On Wed, Nov 25, 2009 at 5:39 AM, Farrel Buchinsky wrote: > I recently installed R 2.10 > > Now I get > >> library(RGoogleDocs) > Loading required package: RCurl > Loading required package: bitops > Loading required package: XML > > Attaching package: 'RGoogleDocs' > > >        The following object

Re: [R] help writing for loop

2009-11-25 Thread Steven McKinney
Hi, The great thing about the S language is that it is 'vectorized', so you can do a lot of matrix manipulations without loops. Here's a smaller example of what you describe. matrix A with 3 columns and 10 rows (instead of 100) matrix B with 3 columns and 15 rows (instead of 1500) > set.seed(123

Re: [R] Grouped Barplot

2009-11-25 Thread S Devriese
On 11/25/2009 07:48 PM, Gary wrote: > Hi R Users, > > I tried plotting a similar boxplot as it is on the FOLLOWING LINK: > > http://www.imachordata.com/wp-content/uploads/2009/09/boxplot.png > > Sample data is attached -- there are 9 years and 5 cities. In my case I'm > looking to plot "Year" on x-

[R] Feature request for as.Date() function

2009-11-25 Thread nabble . 30 . miller_2555
Hello - I have a csv file with a few date columns. Some of the records have an "NA" character string instead of the date. When I attempt to use read.csv() and typecast the columns using colClasses, I receive the following error: Error in charToDate(x) : character string is not in a stand

[R] multi variate plot with string data

2009-11-25 Thread frenchcr
Ive got two columns in data_set that are strings the first column is called "character" and has levels: good, bad, ugly the second column is called "abusive" and has levels: aggressive, moderately aggressive, mildly aggressive I want to do a stacked boxplot that has this sort of structure:

Re: [R] Is there a package for generating standardized R script command line options?

2009-11-25 Thread Trevor . L . Davis
> Hi, > > In python, there is a package that helps generating command line > options. I am wondering if there is such a package in R that helps > generating the command options for a R script? > > http://docs.python.org/library/optparse.html > > Regards, > Peng I recently put a package on CRAN tha

Re: [R] overdispersion and quasibinomial model

2009-11-25 Thread Peter Ehlers
djpren wrote: Thanks for the reply. Naturally I already searched the site and help for the answers to these questions. I think I've figured out how to run a quasi-binomial model, but I cannot figure out how to test for over-dispersion or how to apply a shapiro-wilk test. This is not homework,

[R] Sampling dataframe

2009-11-25 Thread Ronaldo Reis Júnior
Hi, I have a table like that: > datatest var1 var2 var3 1 111 2 312 3 813 4 614 51015 6 221 7 422 8 623 9 824 10 1025 I need to create another table based on that with th

Re: [R] R: Re: R: Re: chol( neg.def.matrix ) WAS: Re: Choleski and Choleski with pivoting of matrix fails

2009-11-25 Thread Ravi Varadhan
I do not understand what the problem is, as it works just fine for me: A <- matrix(c(0.5401984,-0.3998675,-1.3785897,-0.3998675,1.0561872, 0.8158639,-1.3785897, 0.8158639, 1.6073119), 3, 3, byrow=TRUE) eA <- eigen(A) chA <- eA$vec %*% diag(sqrt(eA$val+0i)) %*% t(eA$vec) all.equal(A, Re(chA %

[R] Grouped Barplot

2009-11-25 Thread Gary
Hi R Users, I tried plotting a similar boxplot as it is on the FOLLOWING LINK: http://www.imachordata.com/wp-content/uploads/2009/09/boxplot.png Sample data is attached -- there are 9 years and 5 cities. In my case I'm looking to plot "Year" on x-axis and grouping boxplots by "City". I tried the

Re: [R] order of panels in xyplots

2009-11-25 Thread S Devriese
On 11/25/2009 07:33 PM, Titus Malsburg wrote: > On Wed, Nov 25, 2009 at 7:03 PM, Titus Malsburg wrote: > >> I was expecting >> that this should plot the panels in the order in which the levels >> occur in the data frame: >> >> xyplot(dur~roi|trial, data, index.cond=unique(as.integer(data$tria

[R] help writing for loop

2009-11-25 Thread Jessica Schedlbauer
Hi, I’d like to ask for some help in writing a loop. My situation is the following: I have a matrix (matrix.A) containing 3 columns and 100 rows. The columns represent parameter estimates a, b, and c. The rows contain different values for these parameter estimates. Each row is unique. I w

Re: [R] order of panels in xyplots

2009-11-25 Thread Titus Malsburg
On Wed, Nov 25, 2009 at 7:03 PM, Titus Malsburg wrote: >  I was expecting > that this should plot the panels in the order in which the levels > occur in the data frame: > >  xyplot(dur~roi|trial, data, index.cond=unique(as.integer(data$trial))) The answer is apparently: xyplot(dur~roi|trial, d

[R] augPred and nlme

2009-11-25 Thread Sam Albers
Hello there, Using 'The R Book' (p675-677) I am following instructions on performing a series of nonlinear regressions fitting the same model to a set of groups. I have been to able to fit the model to my data using the following call to nlme: >library(nlme) >inorg.model<-nlme(inorg.grv ~ a*exp(

[R] draw circle on PCA plot

2009-11-25 Thread phoebe kong
Hi, I have a hard time in drawing circle on PCA. I have 60 samples. The corresponding PC1 scores and PC2 scores were stored as "mergedata". Here are the summary of PCs scores. > range(mergedata[,"PC1"]) [1] 0.0085 0.0100 > range(mergedata[,"PC2"]) [1] 0.0032 0.0075 > mean(mergedata[,"PC1"]) [1] 0

[R] order of panels in xyplots

2009-11-25 Thread Titus Malsburg
I'd like do a simple xyplot with customized order of panels and try to understand how to use index.cond for that. Several attempts didn't deliver the correct results. Now, I noticed the following: > p <- xyplot(dur~roi|trial, data) > p$index.cond [[1]] [1] 1 2 3 4 5 6 7 8 9 10 These num

Re: [R] Structural Equation Models(SEM)

2009-11-25 Thread William Revelle
Ralf, If you are representing this as a factor model, you need to have the factors lead to the variables: model.RLIM <- specify.model() f1 -> R , laddR, NA f1 -> L, laddL, NA f1 -> I, laddI, NA f1 -> M, laddM, NA R <-> R, dR,NA L <-> L, dL,NA I <->

Re: [R] Importing many files from a single code

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 9:35 AM, ram basnet wrote: Dear R users, Does somebody know the way to import many files by a single command in R ? I have 50 files in a directory and now, i am importing the files repeatedly (one by one). If there is a way to import all files at a time, it makes much

Re: [R] Structural Equation Models(SEM)

2009-11-25 Thread Viechtbauer Wolfgang (STAT)
The model you have specified there is not an ordinary factor analysis model. This may be closer to what you are thinking of: model.RLIM <- specify.model() f1 -> R, laddR, NA f1 -> L, laddL, NA f1 -> I, laddI, NA f1 -> M, laddM, NA R <-> R, dR, NA L <-> L,

Re: [R] fitting mixture of normals distribution to asset return data

2009-11-25 Thread Christian Hennig
Dear John, I don't know what the "exp" stuff in your line below is about, but mclustBIC in package mclust does fit normal mixtures. Try for a start library(mclust) mmm <- mclustBIC(data,G=2) mmms <- summary(mmm) mmms If you want to learn more, read the documentation. Christian On Wed, 25 Nov

Re: [R] Importing many files from a single code

2009-11-25 Thread Erik Iverson
See the example in ?source, which does exactly this... or make a package depending on your needs. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of ram basnet > Sent: Wednesday, November 25, 2009 8:35 AM > To: R help > Subject:

Re: [R] R Packages Crack the 3,000 Mark!

2009-11-25 Thread Muenchen, Robert A (Bob)
I thought that the unique function would eliminate duplicate package names. Is there a better way to count the number of packages? Thanks, Bob -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Wednesday, November 25, 2009 10:40 AM To: Muenchen, Robert A

Re: [R] difference of two rows

2009-11-25 Thread jim holtman
Try this: > x <- read.table(textConnection("ID YEAR + 13 2007 + 15 2003 + 15 2006 + 15 2008 + 21 2006 + 21 2007"), header=TRUE) > x$diff <- ave(x$YEAR, x$ID, FUN=function(a) c(diff(a), NA)) > > x ID YEAR diff 1 13 2007 NA 2 15 20033 3 15 20062 4 15 2008 NA 5 21 20061 6 21 2007

Re: [R] Unique observations

2009-11-25 Thread David Winsemius
On Nov 25, 2009, at 9:44 AM, John Lipkins wrote: Hey R list, A beginners question. How can I do the following: In my research population it is possible that several items can appear several times, measured on different moments in time. This is being supplied in a total list with all observa

Re: [R] Unique observations

2009-11-25 Thread jim holtman
shouldn't the first observation for Tree1 be " Tree1 leaves 01-01-2009"? > x <- read.table(textConnection("Tree disease date + Tree1 leaves 01-01-2009 + Tree2 roots 13-09-2009 + Tree1 roots 24-10-2009"), header=TRUE) > closeAllConnections() > # split by "Tree" and take first observati

Re: [R] Importing many files from a single code

2009-11-25 Thread jim holtman
Exactly what do you mean by "import"? What commands are you using? You can get a list of the files in a directory and then iterate through reading each one in. If you use 'lapply', you can 'read.table' in some data frames and then 'rbind' them into a single data frame. You need to be more specif

Re: [R] Natural colours for topographic data

2009-11-25 Thread Karl Ove Hufthammer
Tysdag 24. november 2009 11.08.08 skreiv du: >>> > I would be happy with a simple one, that just mapped negative values >>> > to water colours and positive values to land colours. > > Have you tried my colourscheme package? Its not on CRAN but you can >get it from here: Thanks for the suggestion.

Re: [R] tick marks on fold change versus fold change plot

2009-11-25 Thread jim holtman
It sounds like you want to plot 'log' on both axis: plot(..., log='xy') On Wed, Nov 25, 2009 at 12:24 PM, Alla Bulashevska wrote: > > Dear R users, > i try to produce the fold change versus fold change plot > where i have the values for x and y ranging from 0.01 to > 100. So i start with > plot(

Re: [R] XML package example code?

2009-11-25 Thread Tony B
It's been a long time since i read the tutorials, but 'I think', the reason you get those notifications is because the html code is malformed, meaning that some of the opening tags '' don't have corresponding end tags etc. The XML package seems rather good at working with malformed code, and ther

[R] R: Re: R: Re: chol( neg.def.matrix ) WAS: Re: Choleski and Choleski with pivoting of matrix fails

2009-11-25 Thread simona.racio...@libero.it
Dear Peter, thank you very much for your answer. My problem is that I need to calculate the following quantity: solve(chol(A)%*%Y) Y is a 3*3 diagonal matrix and A is a 3*3 matrix. Unfortunately one eigenvalue of A is negative. I can anyway take the square root of A but when I multiply it by Y

Re: [R] XML package example code?

2009-11-25 Thread Tony B
Not sure if my code was attached in that last post: library(RCurl) library(XML) html <- getURL("http://www.omegahat.org/RSXML/index.html";) html.tree <- htmlTreeParse(html, useInternalNodes = TRUE, error = function(...){}) On 25 Nov, 16:21, Peng Yu wrote: > On Wed, Nov 25, 2009 at 12:19 AM, cls

[R] Unique observations

2009-11-25 Thread John Lipkins
Hey R list, A beginners question. How can I do the following: In my research population it is possible that several items can appear several times, measured on different moments in time. This is being supplied in a total list with all observations identified by a number (per item) and a moment of

Re: [R] R 2.9.1: Error building target 'front'

2009-11-25 Thread Loris Bennett
Loris Bennett writes: Bad news: I found no solution to this problem. Good news: The problem does not occur with version 2.10.0. Loris > Loris Bennett writes: > > I get the same problem using R version 2.9.2. > > I would be very grateful if anyone could shed some light on this > issue. > > Re

[R] tick marks on fold change versus fold change plot

2009-11-25 Thread Alla Bulashevska
Dear R users, i try to produce the fold change versus fold change plot where i have the values for x and y ranging from 0.01 to 100. So i start with plot(x,y,xlim=c(0.01,100),ylim=c(0.01,100), axes=F). Then i would like both axes to have tick marks as c(0.01,0.1,1,10,100) but they should appear e

Re: [R] XML package example code?

2009-11-25 Thread Duncan Temple Lang
Peng Yu wrote: > On Wed, Nov 25, 2009 at 12:19 AM, cls59 wrote: >> >> Peng Yu wrote: >>> I'm interested in parsing an html page. I should use XML, right? Could >>> you somebody show me some example code? Is there a tutorial for this >>> package? >>> >> Did you try looking through the help pages

Re: [R] difference of two rows

2009-11-25 Thread R Help
You want to use tapply ?tapply This is a simple example dat = data.frame(a=sample(1:10,100,T),b=rnorm(100,0,1)) tapply(dat$b,dat$a,mean) Hope that helps, Sam On Wed, Nov 25, 2009 at 11:55 AM, clion wrote: > > Dear R user, > I'd like to calculate the difference of two rows, where "ID" is the s

  1   2   >