[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] 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-axis

[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

[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 1

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

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 debeaude...@ucdavis.edu 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

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 debeaude...@ucdavis.edu 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

Re: [R] Reading from Google Docs

2009-11-25 Thread Charlie Sharpsteen
On Wed, Nov 25, 2009 at 12:02 PM, Farrel Buchinsky fjb...@gmail.com 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

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 mail2garymil...@gmail.com 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,

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] 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

[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

[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

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

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 ra.list...@gmail.com: Hi, I'm having trouble seeing graphics output from lattice xyplot() when called from inside a

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

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 baptiste.aug...@googlemail.com Hi, it's a FAQ, you need to print() the plot,

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] 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,

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 now

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 a

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

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 used to

[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

[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] 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] 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,

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,

[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

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] 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? 2)

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,

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).

[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 and

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

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 m...@stats.waikato.ac.nz 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

Re: [R] Concave hull

2009-11-25 Thread Barry Rowlingson
On Wed, Nov 25, 2009 at 11:39 PM, Remko Duursma remkoduur...@gmail.com 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

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

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 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
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] 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.htmlhttp://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 markus_ha...@gmx.de wrote: hello there, I

[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

[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, + xlab = Score,

[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] 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 placed.

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 wrote:

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 you

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] 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

[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 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

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] 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, C, D),

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

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,

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: error:

[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

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 analyse

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 package

<    1   2