[R] Scaling in predict.prcomp

2008-04-19 Thread Gad Abraham
Hi, Say x.train is a matrix of covariates that I want to do PCA on, so I can do regression on its principal components, and x.test is a test set of the same covariates on which I want to evaluate the regression fit. I would like the covariates to be centred and scaled: p <- prcomp(x.train, cen

Re: [R] RPy

2008-04-19 Thread Gad Abraham
Doran, Harold wrote: > I'm curious if there are users of RPy on this list. I've recently > created a gui front end using Tkinter for some python scripts I've > written for some of our internal operations and I am quite pleased with > how this program works. > > I wonder if it is possible to also

[R] rgl snapshot

2008-04-19 Thread Mike Ryckman
Hello everyone, I know I can save a snapshot an rgl device, but currently it only appears to do png format. Is there some way of exporting a high-quality picture more fit for publication? Thanks, Mike __ R-help@r-project.org mailing list https://sta

[R] simulation and solution to SDE with jumps and point processes?

2008-04-19 Thread Michael
Hi all, I am looking for toolboxes that can handle simulation and/or solution of SDE with jumps, say levy processes, jump diffusion processes, etc. Could anybody give me some pointers to really good ones in R, (or Maple or Matlab)? I did google search myself and haven't found much...I would also l

Re: [R] Mantel-Haenszel for 2x2

2008-04-19 Thread Dr. Jeff Miller
Rob, I had tried that but mhor requires 3 variables (i.e., a conditional test). I didn't think to just create a third variable...vector of 1's. Now it works fine. Thanks! Jeff -Original Message- From: Robert Baer [mailto:[EMAIL PROTECTED] Sent: Saturday, April 19, 2008 6:48 PM To: Dr.

Re: [R] R question for Stata users

2008-04-19 Thread John Fox
Dear Joe, See ?jitter. apropos("jitter") or help.search("jitter") would have helped you to discover this. Regards, John On Sat, 19 Apr 2008 19:00:23 -0400 Joe Trubisz <[EMAIL PROTECTED]> wrote: > Hi... > > In Stata, there is the ability to display scatter plots with data > points at the s

Re: [R] R question for Stata users

2008-04-19 Thread Marc Schwartz
Joe Trubisz wrote: > Hi... > > In Stata, there is the ability to display scatter plots with data > points at the same (x,y) > location, using the 'jitter' command of the twoway scatter stata > command. > > Anyone know of a way that I can do the equivalent thing in R? > > For non-Stata reader

[R] R question for Stata users

2008-04-19 Thread Joe Trubisz
Hi... In Stata, there is the ability to display scatter plots with data points at the same (x,y) location, using the 'jitter' command of the twoway scatter stata command. Anyone know of a way that I can do the equivalent thing in R? For non-Stata readers, if jitter is enabled in stata, and n

Re: [R] Mantel-Haenszel for 2x2

2008-04-19 Thread Robert Baer
See if this is what you are looking for: library(epicalc) data(Oswego) use(Oswego) cc(ill, chocolate) mhor(ill, chocolate, sex) You might also wish to read the details of: mantelhaen.test HTH], Rob Baer - Original Message - From: "Dr. Jeff Miller" <[EMAIL PROTECTED]> To: <[EMAIL PROTEC

[R] Re ad From EXCEL

2008-04-19 Thread ermimi
Hello!!! I have been read a much about as read data from Excel File, but I haven´t found the necesary information to read the data. Now, I can create a channel : channel <- odbcConnectExcel("file.xls") but I don´t know as read the data?? I hope that you could help me. Thank you very much. -- V

[R] Feature selection

2008-04-19 Thread Computer- programmer
Dear R helpers, I'm trying to fit a model for prediction, but I have 18 variables to choose from. So, my question is what are the methods used for choosing the best and smallest subset out of those 18 to predict y ? I tried the common ways: std. and corr, multiple regression is hard beca

Re: [R] eval and parent.frame [was: Error in Design package: dataset not found for options(datadist)]

2008-04-19 Thread Charles C. Berry
On Sat, 19 Apr 2008, Gad Abraham wrote: > Charles C. Berry wrote: >> On Fri, 18 Apr 2008, Gad Abraham wrote: >> >> > Frank E Harrell Jr wrote: >> > > Gad Abraham wrote: >> > > > Hi, >> > > > >> > > > Design isn't strictly an R base package, but maybe someone can >> > > > explain >> > > >

Re: [R] spdep question - Moran's I

2008-04-19 Thread Roger Bivand
Haenlein.Michael whu.edu> writes: > > Dear all, > > I would like to calculate a Moran's I statistic using the moran function in > the spdep package. The problem > I'm having deals with how to create the listw object. > > My data stems from the area of social network analysis. I have list of p

Re: [R] Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char'

2008-04-19 Thread Prof Brian Ripley
I do think this is definitely an R-devel topic according to the posting guide, so I am not going to go into any details here. However, the issue is fairly clearly a corrupt CHARSXP cache, the only place CXTAIL is used. On Sat, 19 Apr 2008, Søren Højsgaard wrote: so it looks as though the er

Re: [R] resampling from distributions

2008-04-19 Thread Grant Gillis
I am sorry for the incorrect subject. My subject autofilled without my noticing in time. I suppose a better subject would be Calculating proportion of shared occurances and randomizations. Grant 2008/4/19 Grant Gillis <[EMAIL PROTECTED]>: > Hello All, > > Once again thanks for all of the help

[R] resampling from distributions

2008-04-19 Thread Grant Gillis
Hello All, Once again thanks for all of the help to date. I am climbing my R learning curve. I've got a few more questions that I hope I can get some guidance on though. I am not sure whether the etiquette is to break up multiple questions or not but I'll keep them together here for now as it

Re: [R] installing r-base on suse 10.3

2008-04-19 Thread bob mccall
Found it! http://download.opensuse.org/distribution/10.3/repo/oss/suse/i586/ Consider adding this link to a readme file in the download directory. Bob bob mccall <[EMAIL PROTECTED]> wrote: Greetings: I'm trying to install R-base on Suse 10.3 but Yast complains of failed dependancies. It need

Re: [R] Line-wrap problem

2008-04-19 Thread Charles C. Berry
On Fri, 18 Apr 2008, Matthew Fero wrote: > I'm wondering if someone can tell me how R determines where to wrap > lines in its output. > > I'd like to understand this because occasionally often after running > a script the output of R no longer wraps at the correct location. Try options(

Re: [R] Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char'

2008-04-19 Thread Søren Højsgaard
so it looks as though the error message is a little buggy (it should print TYPEOF(v), not TYPEOF(x), or maybe it should test x, not v.) But I don't really know what it's doing. Are you using a STRSXP somewhere that is expecting a CHARSXP? Duncan Murdoch No; the code that produces the error is

Re: [R] 3-D-Plot

2008-04-19 Thread Uwe Ligges
Edwin, the problem is that the underlying R code treats the "lab" argument as something that should be approximate in some way. In your case, you can say, e.g.: par(lwd=3) scatterplot3d(. lab= c(5,hostLength*2), .) Best wishes; uwe Edwin Sendjaja wrote:

Re: [R] superposing a group of x,y-plot points

2008-04-19 Thread hadley wickham
On Sat, Apr 19, 2008 at 1:06 PM, Tobias Verbeke <[EMAIL PROTECTED]> wrote: > Anna-Maria Tyrisevä wrote: > > > please, could somebody tell me how can I superpose a group of x,y-plot > > points (using different symbols) that belong to a certain class of factor > z? > > Can't find a solution despi

Re: [R] superposing a group of x,y-plot points

2008-04-19 Thread Tobias Verbeke
Anna-Maria Tyrisevä wrote: > please, could somebody tell me how can I superpose a group of x,y-plot > points (using different symbols) that belong to a certain class of factor z? > Can't find a solution despite of hours of reading. x <- rnorm(30) y <- rnorm(30) f <- factor(sample(LETTERS[1:5], 30

Re: [R] Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char'

2008-04-19 Thread Duncan Murdoch
On 19/04/2008 1:18 PM, Søren Højsgaard wrote: > Dear List > On windows XP using R.2.6.2 I get the message > > Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char' > > in connection with calling C code (using the .Call interface). I have been > unable to find any info on this (in

[R] Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char'

2008-04-19 Thread Søren Højsgaard
Dear List On windows XP using R.2.6.2 I get the message Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char' in connection with calling C code (using the .Call interface). I have been unable to find any info on this (in Writing R extensions). Can anyone help me with understandi

[R] installing r-base on suse 10.3

2008-04-19 Thread bob mccall
Greetings: I'm trying to install R-base on Suse 10.3 but Yast complains of failed dependancies. It needs blas and readline. I installed readline and gsl thinking that gsl would solve the blas prob, but no luck. The readline problem remains as well. Any ideas?? Thanks, Bob ---

[R] superposing a group of x,y-plot points

2008-04-19 Thread Anna-Maria Tyrisevä
Hi, please, could somebody tell me how can I superpose a group of x,y-plot points (using different symbols) that belong to a certain class of factor z? Can't find a solution despite of hours of reading. Thanks in advance, Anna-Maria __ R-help@r-proj

Re: [R] rzinb (VGAM) and dnbinom in optim - Solved.

2008-04-19 Thread Katharine Mullen
Did you notice that the residual function I gave flipped what your original example problem used as starting values for munb and size? so you can sometimes afford to give a bad starting value for these param. in trying to calculate the gradient L-BFGS-B may try evaluate fn with parameter values ou

Re: [R] Query: how to group data by months from a text file

2008-04-19 Thread Gabor Grothendieck
Lines <- "10092007 24.62 24.31 24.90 11092007 19.20 23.17 22.10 13092007 24.71 27.33 23.10 14092007 27.33 27.90 24.10 15092007 28.22 28.55 24.30 16092007 28.53 29.24 27.40 17092007 24.19 30.64 26.80 18092007 22.60 20.62 28.40 19092007 18.89 21.70 14.70 20092007 21.27 22.92 17.30 21092007 22.38 24.7

Re: [R] Making the size of bar charts smaller

2008-04-19 Thread Uwe Ligges
hoogeebear wrote: > Hi, > > Just wondering is there a way to make the width of bar charts that you > create using R smaller? > > Also, a bar chart I created has a total number of 23 entries (with 2 > different columns 14 and 9), how can I have the total number on the Y axis > adding up to 23 an

Re: [R] Line-wrap problem

2008-04-19 Thread David Winsemius
Matthew Fero <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: ?options #... and look at the width parameter > options(width = 100) > 1:40 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 [33] 33 34 35 36 37 38 39 40 There may be Mac spec

Re: [R] rzinb (VGAM) and dnbinom in optim - Solved.

2008-04-19 Thread Tim Howard
Thank you very much for the help and the great suggestion on cleaning up the residual function. Setting the bounds and being very careful with the starting position (on my real data) do seem to do the trick, which I wouldn't have guessed given the error message that was getting thrown. Best,

Re: [R] Correspondence and detrended correspondence analysis

2008-04-19 Thread Monica Pisica
Gavin, Thank you very much for the explanation it is very assuring . I knew that the sign of the eigenvectors can flip but i was puzzled that always PCA and CA came one way and DCA the other way - i mean flipped every time i've run the analysis the idea was to use different ord

Re: [R] Inverse transform after applying function in frequency domain?

2008-04-19 Thread Prof Brian Ripley
spec.pgram() does not just transform to frquency domain: for a single series it then takes the squared amplitude. You cannot undo that. Try applying (the square root of?) your function to the Fourier fransform instead. Study of the references on ?spec.pgram is recommended, or a discussion wi

[R] Query: how to group data by months from a text file

2008-04-19 Thread Stefano Sofia
Dear R-users, I have to deal with (txt) files of the form 10092007 24.62 24.31 24.90 11092007 19.20 23.17 22.10 13092007 24.71 27.33 23.10 14092007 27.33 27.90 24.10 15092007 28.22 28.55 24.30 16092007 28.53 29.24 27.40 17092007 24.19 30.64 26.80 18092007 22.60 20.62 28.40 19092007 18.89 21.70 14.

Re: [R] Regular Expressions Help

2008-04-19 Thread Hans-Jörg Bibiko
On 19.04.2008, at 06:46, maud wrote: > I am having some trouble learning regular expressions. Let me describe > the general problem I am dealing with. Consider the following setup: > > Joe<- c(1,2,3) > Bob<- c(2,4,6) > Alice <- c(9,8,7) > > Matrix <- cbind(Joe, Bob, Alice) > St <- c("Bob", "Alice"

[R] Making the size of bar charts smaller

2008-04-19 Thread hoogeebear
Hi, Just wondering is there a way to make the width of bar charts that you create using R smaller? Also, a bar chart I created has a total number of 23 entries (with 2 different columns 14 and 9), how can I have the total number on the Y axis adding up to 23 and not the larger of the two columns

Re: [R] ts.plot() labeling x-axis

2008-04-19 Thread Jeff Ryan
Have a look at chartSeries in the quantmod package. It can handle financial style series formatting quite well. Make sure to get the newest version of xts and quantmod from CRAN - as there have been recent updates to the charting facility. Some documentation can be found at http://www.quantmod.co

[R] Inverse transform after applying function in frequency domain?

2008-04-19 Thread Keith Alan Chamberlain
Dear R-Help, I wish to simulate a process so that it has certain properties in the frequency domain. What I attempted was to generate a random time-series signal, use spec-pgram(), apply a function in the frequency domain, and then inverse transform back to the time-domain. This idea does not seem

Re: [R] problem in caluclaring the multiple regression

2008-04-19 Thread Paul Hiemstra
man4ish schreef: > I am trying to calculate the regression for the follwing input data stored in > 'data.txt' file.I am reading this and storing it in the variable i .then i > am trying to get the predicted value using f1 as dependent and others > f2f10 as independent variables.It is giving the

Re: [R] Correspondence and detrended correspondence analysis

2008-04-19 Thread Gavin Simpson
On Fri, 2008-04-18 at 18:45 +, Monica Pisica wrote: > Hi, > > I hope someone knows the answer to this or has a real good reference > about it (I am using Legendre & Legendre, Numerical Ecology, 1998) > My data is a data.frame with locations as rows and vegetation > assemblages / species as

Re: [R] Response to R across the university + Eddie Izzard Bonus

2008-04-19 Thread Antony Unwin
On 19 Apr 2008, at 12:01 AM, Peter Dalgaard wrote: > Antony Unwin wrote: >> >>> A couple other maybe not all that trivial things to do is to >>> improve the data import (it is losing out on most of the things >>> that I tried) >> >> Now what would Brian say to a comment like that? Please ins

[R] problem in caluclaring the multiple regression

2008-04-19 Thread man4ish
I am trying to calculate the regression for the follwing input data stored in 'data.txt' file.I am reading this and storing it in the variable i .then i am trying to get the predicted value using f1 as dependent and others f2f10 as independent variables.It is giving the following error. Also i

[R] Regular Expressions Help

2008-04-19 Thread maud
I am having some trouble learning regular expressions. Let me describe the general problem I am dealing with. Consider the following setup: Joe<- c(1,2,3) Bob<- c(2,4,6) Alice <- c(9,8,7) Matrix <- cbind(Joe, Bob, Alice) St <- c("Bob", "Alice", "Alice:Bob") Now I want to make a new matrix having

[R] how to calculate the predicted value for the multiple regression

2008-04-19 Thread man4ish
what i am trying to do , using the following data , i want to calculate the predicted value for each row and each value e.g 0 1 2 3 7 5 0 4 4 3 this is row one then i want to do the following keep 0 dependent variable and others as indepedent (1 2 3 7 5 0 4 4 3) predict value for this. again

Re: [R] multiple separators in sep argument for read.table?

2008-04-19 Thread Ted Harding
On 19-Apr-08 06:19:09, Johan Jackson wrote: > Hello, > Is there any way to add multiple separators in the sep= argument > in read.table? I would like to be able to create different columns > if I see a white space OR a "/". > > Thanks in advance, > JJ As well as Brian Ripley's suggestion for how