Re: [R] Question related to merging zoo objects and apply function

2009-07-15 Thread Gabor Grothendieck
Please read the last line of every message to r-help. In particular simplify this as much as possible and construct some small artificial test data to illustrate. Anyways, func is probably not what you want. It has the same effect as func - function(x, j) x[72+j] + [144+j] On Wed, Jul 15, 2009

Re: [R] Question related to merging zoo objects and apply function

2009-07-15 Thread Sergey Goriatchev
Hello, Gabor Generally, I follow the r-help rules and provide working code snippets to illustrate the problem. In this case it was more methodological question of how to loop names in merge() function. I solved this very simply buy renaming specific columns after I have ran merge(). Thank you

Re: [R] Question in using e1071 svm routine

2009-07-07 Thread Max Kuhn
Unlike Splus, R does not use T for TRUE. On Tue, Jul 7, 2009 at 6:05 PM, Michaelcomtech@gmail.com wrote: Hi all, I've got the following error message in using e1071 svm routine... Could anybody please help me? Thank you! - model -

Re: [R] Question in using e1071 svm routine

2009-07-07 Thread Stavros Macrakis
Isn't the initial value of the variable T equal to the constant TRUE? So unless he's modified the value of T, shouldn't it work? -s On 7/7/09, Max Kuhn mxk...@gmail.com wrote: Unlike Splus, R does not use T for TRUE. On Tue, Jul 7, 2009 at 6:05 PM, Michaelcomtech@gmail.com

Re: [R] Question in using e1071 svm routine

2009-07-07 Thread Steve Lianoglou
Hi, On Jul 7, 2009, at 8:37 PM, Stavros Macrakis wrote: Isn't the initial value of the variable T equal to the constant TRUE? So unless he's modified the value of T, shouldn't it work? Yes, it should. Perhaps we should be looking at your data: model - svm(y=factor(mytraindata[, 1]),

Re: [R] Question about - assignment

2009-07-02 Thread Kenn Konstabel
On Thu, Jul 2, 2009 at 4:34 AM, Rolf Turner r.tur...@auckland.ac.nz wrote: On 2/07/2009, at 12:20 PM, Hsiu-Khuern Tang wrote: Is this expected behavior? z - 1:5 z[1] - 0 Error in z[1] - 0 : object z not found The documentation seems to suggest that z will be found in the global

Re: [R] Question about - assignment

2009-07-02 Thread Duncan Murdoch
On 01/07/2009 8:20 PM, Hsiu-Khuern Tang wrote: Is this expected behavior? z - 1:5 z[1] - 0 Error in z[1] - 0 : object z not found The documentation seems to suggest that z will be found in the global environment and modified accordingly. z - 0 works as documented, it's the indexing that

Re: [R] Question about - assignment

2009-07-02 Thread Duncan Murdoch
On 01/07/2009 9:34 PM, Rolf Turner wrote: On 2/07/2009, at 12:20 PM, Hsiu-Khuern Tang wrote: Is this expected behavior? z - 1:5 z[1] - 0 Error in z[1] - 0 : object z not found The documentation seems to suggest that z will be found in the global environment and modified accordingly. I

Re: [R] Question about - assignment

2009-07-02 Thread Duncan Murdoch
On 7/2/2009 6:44 AM, Kenn Konstabel wrote: On Thu, Jul 2, 2009 at 4:34 AM, Rolf Turner r.tur...@auckland.ac.nz wrote: On 2/07/2009, at 12:20 PM, Hsiu-Khuern Tang wrote: Is this expected behavior? z - 1:5 z[1] - 0 Error in z[1] - 0 : object z not found The documentation seems to

Re: [R] Question about - assignment

2009-07-02 Thread Peter Dalgaard
Duncan Murdoch wrote: - doesn't need to find z. It will replace it if found, or create a new one if not. (Personally I would have limited that to the first case, i.e. it should fail if it doesn't find z.) Possibly. It's a holdover from S, where - assigns to the global environment

Re: [R] Question about - assignment

2009-07-02 Thread Duncan Murdoch
On 7/2/2009 9:46 AM, Peter Dalgaard wrote: Duncan Murdoch wrote: - doesn't need to find z. It will replace it if found, or create a new one if not. (Personally I would have limited that to the first case, i.e. it should fail if it doesn't find z.) Possibly. It's a holdover from S, where

Re: [R] Question about creating lists with functions as elements

2009-07-01 Thread Craig P. Pyrame
Dear Duncan and Rolf, That's funny! Thanks a lot. Best regards, Craig Duncan Murdoch wrote: On 30/06/2009 5:11 PM, Craig P. Pyrame wrote: Dear Rolf, What do you mean? He was talking about the fortunes package. Install it, type fortune(), and you'll get a fortune cookie message. Maybe

Re: [R] Question about - assignment

2009-07-01 Thread Rolf Turner
On 2/07/2009, at 12:20 PM, Hsiu-Khuern Tang wrote: Is this expected behavior? z - 1:5 z[1] - 0 Error in z[1] - 0 : object z not found The documentation seems to suggest that z will be found in the global environment and modified accordingly. I would agree that the documentation would

Re: [R] Question about creating lists with functions as elements

2009-06-30 Thread Henrique Dallazuanna
From the help page of rep: Value: An object of the same type as 'x' (except that 'rep' will coerce pairlists to vector lists). So, you can do: rep(list(character), 2) On Tue, Jun 30, 2009 at 9:00 AM, Craig P. Pyrame crap...@gmail.com wrote: Dear list, I am trying to construct a

Re: [R] Question about creating lists with functions as elements

2009-06-30 Thread Craig P. Pyrame
Dear Henrique, Thanks! This does work, and I find the following solution to my original problem elegant enough: rep(list(character, integer, numeric, ...), c(3, 2, 2, ...)) Best regards, Craig Henrique Dallazuanna wrote: From the help page of rep: Value: An object of the same

Re: [R] Question about creating lists with functions as elements

2009-06-30 Thread Barry Rowlingson
On Tue, Jun 30, 2009 at 1:00 PM, Craig P. Pyramecrap...@gmail.com wrote: But this fails, as above.  Why?  Why can c(character, character) create a list of two functions, but rep(character, 2) can't? Another solution to my problem I could find (and you'll hopefully suggest an even better one)

Re: [R] Question about creating lists with functions as elements

2009-06-30 Thread Craig P. Pyrame
Dear Barry, Thank you for the suggestion, it does work. I think the documentation might be improved, but it's probably not a good idea to submit bug reports just because I misunderstand what R does. Best regards, Craig Barry Rowlingson wrote: On Tue, Jun 30, 2009 at 1:00 PM, Craig P.

Re: [R] Question about creating lists with functions as elements

2009-06-30 Thread Rolf Turner
On 1/07/2009, at 12:34 AM, Craig P. Pyrame wrote: ... it's probably not a good idea to submit bug reports just because I misunderstand what R does. Gotta be a fortune!!! cheers, Rolf ##

Re: [R] Question about creating lists with functions as elements

2009-06-30 Thread Craig P. Pyrame
Dear Rolf, What do you mean? Best regards, Craig Rolf Turner wrote: On 1/07/2009, at 12:34 AM, Craig P. Pyrame wrote: ... it's probably not a good idea to submit bug reports just because I misunderstand what R does. Gotta be a fortune!!! cheers, Rolf

Re: [R] Question about creating lists with functions as elements

2009-06-30 Thread Duncan Murdoch
On 30/06/2009 5:11 PM, Craig P. Pyrame wrote: Dear Rolf, What do you mean? He was talking about the fortunes package. Install it, type fortune(), and you'll get a fortune cookie message. Maybe one with your name on it. Duncan Murdoch Best regards, Craig Rolf Turner wrote: On

Re: [R] Question about creating lists with functions as elements

2009-06-30 Thread Greg Snow
Rowlingson Subject: Re: [R] Question about creating lists with functions as elements Dear Rolf, What do you mean? Best regards, Craig Rolf Turner wrote: On 1/07/2009, at 12:34 AM, Craig P. Pyrame wrote: ... it's probably not a good idea to submit bug reports just because I

Re: [R] question about package biomaRt

2009-06-23 Thread Martin Morgan
Please ask Bioconductor questions on the Bioconductor mailing list https://stat.ethz.ch/mailman/listinfo/bioconductor Martin mau...@alice.it writes: Can biomaRt connect to data base http://mirecords.umn.edu; or a branch of it ... for instance the validated miRNAs list ..? Thank you

Re: [R] question about package biomaRt

2009-06-23 Thread James W. MacDonald
Again, please refrain from crossposting. mau...@alice.it wrote: Can biomaRt connect to data base http://mirecords.umn.edu; or a branch of it ... for instance the validated miRNAs list ..? The mirecords website isn't a Biomart, so no. Jim Thank you very much. Maura tutti i telefonini

Re: [R] question about using _apply and/or aggregate functions

2009-06-22 Thread David Winsemius
On Jun 22, 2009, at 12:04 PM, Clifford Long wrote: Hi R-list, I'll apologize in advance for (1) the wordiness of my note (not sure how to avoid it) and (2) any deficiencies on my part that lead to my difficulties. I have an application with several stages that is meant to simulate and

Re: [R] question about using _apply and/or aggregate functions

2009-06-22 Thread Clifford Long
Hi David, I appreciate the advice. I had coerced 'list4' to as.list, but forgot to specify list=() in the call to aggregate. I made the correction, and now get the following: slope.mult = simarray[,1] adj.slope.value = simarray[,2] adj.slope.level = simarray[,2] qc.run.violation =

Re: [R] question about using _apply and/or aggregate functions

2009-06-22 Thread David Winsemius
On Jun 22, 2009, at 6:16 PM, Clifford Long wrote: Hi David, I appreciate the advice. I had coerced 'list4' to as.list, but forgot to specify list=() in the call to aggregate. I made the correction, and now get the following: slope.mult = simarray[,1] adj.slope.value = simarray[,2]

Re: [R] question about using _apply and/or aggregate functions

2009-06-22 Thread David Winsemius
On Jun 22, 2009, at 7:55 PM, David Winsemius wrote: On Jun 22, 2009, at 6:16 PM, Clifford Long wrote: Hi David, I appreciate the advice. I had coerced 'list4' to as.list, but forgot to specify list=() in the call to aggregate. I made the correction, and now get the following:

Re: [R] question about using _apply and/or aggregate functions

2009-06-22 Thread Clifford Long
David, Once again, many thanks for your very useful and timely feedback, and for your patience with my learning curve. Sincerely, Cliff On Mon, Jun 22, 2009 at 7:11 PM, David Winsemiusdwinsem...@comcast.net wrote: On Jun 22, 2009, at 7:55 PM, David Winsemius wrote: On Jun 22, 2009, at

Re: [R] question about adding plots in a grid (lattice package)

2009-06-19 Thread Deepayan Sarkar
On 6/16/09, Marion Dumas mario...@gmail.com wrote: Hello! I am starting to use the lattice package. I generated an xyplot conditioned on a factor that has three levels: hence I get three plots in three panels spaces and one is left empty. I would like to add a plot to the empty panel space.

Re: [R] Question regarding dataframes, matrix, frame, etc...

2009-06-16 Thread stephen sefick
plot(asdf[,1:7]) On Tue, Jun 16, 2009 at 10:58 AM, njhuang86njhuan...@yahoo.com wrote: Hi all, As of now, I have a 15x8 matrix (name is asdf). The first seven columns contain numbers while the last column contains a string. The class of each column is character. When I use the plot function

Re: [R] Question regarding dataframes, matrix, frame, etc...

2009-06-16 Thread David Winsemius
?data.matrix Perhaps: pairs(data.matrix(asdf[ , 1:7]) ) On Jun 16, 2009, at 10:58 AM, njhuang86 wrote: Hi all, As of now, I have a 15x8 matrix (name is asdf). The first seven columns contain numbers while the last column contains a string. The class of each column is character. When

Re: [R] question about read.xls

2009-06-05 Thread Gabor Grothendieck
Check out: http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows On Fri, Jun 5, 2009 at 1:37 PM, jlfmssmjlfm...@gmail.com wrote: I am woking on Windows and using  read.xls to read Excel.xls file. But it needs to install perl on my machine first, and then give the following until

Re: [R] question about using a remote system

2009-05-29 Thread Mark Wardle
I've not ever tried something like this. You didn't quite answer the question though. Do you need interactive sessions, or are users choosing from a number of batch jobs? If the latter, then perhaps you would be better forsaking Rcmdr (which I have not used) and instead consider a shell-based, or

Re: [R] question about using a remote system

2009-05-28 Thread Ted Harding
On 28-May-09 00:58:17, Erin Hodgess wrote: Dear R People: I would like to set up a plug-in for Rcmdr to do the following: I would start on a Linux laptop. Then I would log into another outside system and run a some commands. Now, when I tried to do system(ssh e...@xxx.edu) password

Re: [R] question about using a remote system

2009-05-28 Thread Mark Wardle
Hi. Do you need an interactive session at the remote machine, or are you simply wanting to run a pre-written script? If the latter, then you can ask ssh to execute a remote command, which conceivably could be R CMD x If you explain exactly why and what you are trying to do, then perhaps

Re: [R] question about using a remote system

2009-05-28 Thread Erin Hodgess
My goal is for a user to sit down at a Linux laptop, get to an Rcmdr type screen, submit jobs on a remote system and then get the results back in R. We will assume that the user is naive, and the only thing he/she can do is get to the Rcmdr screen. The Rcmdr plugin will have a submit jobs menu.

Re: [R] question about using a remote system

2009-05-28 Thread Greg Snow
Subject: Re: [R] question about using a remote system My goal is for a user to sit down at a Linux laptop, get to an Rcmdr type screen, submit jobs on a remote system and then get the results back in R. We will assume that the user is naive, and the only thing he/she can do is get

Re: [R] Question about barplot: gridlines value labels

2009-05-18 Thread Dimitri Liakhovitski
Thanks a lot - I am trying it with lattice now On Sat, May 16, 2009 at 10:44 PM, Duncan Mackay mac...@northnet.com.au wrote: Dimitri You mentioned lattice so I presumed that you tried a barchart in lattice if you found the class of table.a.percents will it comply with the lattice

Re: [R] Question about barplot: gridlines value labels

2009-05-17 Thread Jim Lemon
Dimitri Liakhovitski wrote: Hello! I promise I looked into help files before asking. Still cannot figure it out. I think it's because I am totally confused what packages use lettice, which use trellis, etc. Sections 1 and 2 below produce the data and the data to plot. My question is about

Re: [R] Question about barplot: gridlines value labels

2009-05-16 Thread Duncan Mackay
Dimitri You mentioned lattice so I presumed that you tried a barchart in lattice if you found the class of table.a.percents will it comply with the lattice requirements of the data type ? class(table.a.percents) [1] matrix Using the lattice package and converting to a data.frame x -

Re: [R] question about setClass

2009-05-14 Thread Uwe Ligges
Erin Hodgess wrote: Hi R People: I have a question about setClass please. I'm working thru R Programming for Bioinformatics. Actually, I was wondering if there is such a thing as an updateClass, in order to change a contains option, please? that is, if I had setClass(dog,

Re: [R] question on aggregate

2009-05-01 Thread milton ruser
Mark, Give a look: rres-read.table(stdin(), head=T, sep=,) ID,Traversed, v2 1,5,1 1,7,1 1,8,1 2,8,2 2,11,2 2,7,2 3,11,3 3,22,3 3,16,3 aggregate(rres[c(Traversed, v2)], list(rres$ID), sum) bests milton On Fri, May 1, 2009 at 5:07 PM, Altaweel, Mark R. maltaw...@anl.gov wrote: Hi, I am

Re: [R] question about adaboost.

2009-04-28 Thread Uwe Ligges
: r-help@r-project.org Sent: Tuesday, April 28, 2009 9:42 AM Subject: Re: [R] question about adaboost. Cecilia Lezama wrote: Hello, I would like to know how to obtain the misclassification error when performing a boosting analisis with ADABAG package? With: prop.table(Tesis.boostcv$confusion

Re: [R] question about adaboost.

2009-04-28 Thread Cecilia Lezama
0.00667 0.01333 Many, many thanks! - Original Message - From: Uwe Ligges lig...@statistik.tu-dortmund.de To: Cecilia Lezama che...@netgate.com.uy Cc: r-help@r-project.org Sent: Tuesday, April 28, 2009 9:42 AM Subject: Re: [R] question about adaboost. Cecilia Lezama wrote

Re: [R] Question of nlme package

2009-04-28 Thread Dieter Menne
Helen Chen 96258011 at nccu.edu.tw writes: I would like to run some panel regressions with R. Therefore I want to use fixed effect model. The focus of lme is on mixed models, but gls in nlme can handle fixed-only problems. I doubt, however that it is exactly what you want for your case. I

Re: [R] question about adaboost.

2009-04-28 Thread Uwe Ligges
Cecilia Lezama wrote: Hello, I would like to know how to obtain the misclassification error when performing a boosting analisis with ADABAG package? With: prop.table(Tesis.boostcv$confusion) I obtain the confusion matrix, but not the overall missclassification error. Well, the

Re: [R] Question of Quantile Regression for Longitudinal Data

2009-04-26 Thread Tirthankar Chakravarty
This is a nontrivial problem. This comes up often on the Statalist (-qreg- is for cross-section quantile regression): You want to fit a plane through the origin using the L-1 norm. This is not as easy as with L-2 norm (LS), as it is more than a matter of dropping a constant predictor yet

Re: [R] Question of Quantile Regression for Longitudinal Data

2009-04-26 Thread roger koenker
I was trying to resist responding to this question since the original questioner had already been admonished twice last october about asking questions on R-help about posted code that was not only not a part of R-base, but not even a part of an R package. But the quoted comment about Stata is

Re: [R] Question on binomial data

2009-04-21 Thread David Winsemius
You should review your course material on interpreting general linear models. The criterion you have chosen for significance (looking at p values for indivdiual coefficients) is not the recommended one. Seek out the section that discusses the proper method for using deviance estimates for

Re: [R] Question on binomial data

2009-04-21 Thread ehud cohen
I thought of testing the difference in deviance between the null model and the fitted model, assuming it is distributed as chi-sq. However, Faraway writes that if the outcome is binary, the deviance distribution is far from chisq. I've done a permutation test: N-5000; # Towards the upper limit,

Re: [R] Question on binomial data

2009-04-21 Thread David Winsemius
Surely Faraway does not suggest using the Wald statistic in preference to the deviance? Even if the distribution of deviance is not exactly chi-square, it appears generally accepted that a comparison of the difference in deviance to the chi-square statistic is better than using the ratio

Re: [R] Question on binomial data

2009-04-21 Thread ehud cohen
David, Faraway suggests using the Hosmer Lemeshow test in the case of a binary response, and discusses the inadequacy of Wald statistics. However, I'm not sure it applies here due to the limited number of cases. Thanks, Ehud. On Wed, Apr 22, 2009 at 2:04 AM, David Winsemius

Re: [R] Question about rpart(sth~.,database)

2009-04-19 Thread Gavin Simpson
Grześ wrote: I have a standard database - HouseVotes84 For example: Class V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 1 republicann y ny y y n n n y NA y y y ny 2 republicann y ny y y n n n nn y y y n NA 3

Re: [R] Question about rpart(sth~.,database)

2009-04-19 Thread Grześ
Gavin Simpson wrote: Grześ wrote: I have a standard database - HouseVotes84 For example: Class V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 1 republicann y ny y y n n n y NA y y y ny 2 republicann y ny y y n n n nn

Re: [R] question on using lattice panel plots

2009-04-16 Thread Sundar Dorai-Raj
Try: z - cbind(rep(c(BIC, hist), each = 150), rep(rep(c(5, 10, 30), each = 50),2)) z - as.data.frame(z) z - cbind(z, runif(300)) names(z) - c(Method, sigma, Error) z$sigma - factor(z$sigma, c(5, 10, 30)) library(lattice) sigma - as.numeric(levels(z$sigma)) sigmaExprList - lapply(sigma,

Re: [R] question on using lattice panel plots

2009-04-16 Thread Sundar Dorai-Raj
Sorry, that should be: sigma - as.numeric(levels(z$sigma)) sigmaExprList - lapply(sigma, function(s) bquote(sigma == .(s))) sigmaExpr - as.expression(sigmaExprList) bwplot(Error~Method | sigma, data = z, horiz = F, xlab = Method, strip = function(which.given, which.panel, var.name,

Re: [R] question on using lattice panel plots

2009-04-16 Thread Deepayan Sarkar
On Thu, Apr 16, 2009 at 1:45 PM, Sundar Dorai-Raj sdorai...@gmail.com wrote: Sorry, that should be: sigma - as.numeric(levels(z$sigma)) sigmaExprList - lapply(sigma, function(s) bquote(sigma == .(s))) sigmaExpr - as.expression(sigmaExprList) bwplot(Error~Method | sigma, data = z,      

Re: [R] Question on zero-inflated Poisson count data with r epeated measures design - glmm.ADMB

2009-04-14 Thread David Winsemius
Strubbe Diederik diederik.strubbe at ua.ac.be writes: Dear R community, I have some questions regarding the analysis of a zero-inflated count dataset and repeated measures design. The dataset is arranged as follows : Unit of analysis: point - these are points were bird were counted

Re: [R] Question on zero-inflated Poisson count data with repeatedmeasures design - glmm.ADMB

2009-04-14 Thread ONKELINX, Thierry
Dear Diederik, If you revisited the same points then it makes sense to use the data at the point level. But then I would mke that explicit by using a nested random effect. In the nlme/lme4 syntax: 1|Site/Point. Make shure that each point has a unique ID. Naming a variable count is not a very

Re: [R] Question on zero-inflated Poisson count data with repeatedmeasures design - glmm.ADMB

2009-04-14 Thread Strubbe Diederik
, University of Antwerp Universiteitsplein 1 B-2610 Antwerp, Belgium http://webhost.ua.ac.be/deco tel : 32 3 820 23 85 -Original Message- From: ONKELINX, Thierry [mailto:thierry.onkel...@inbo.be] Sent: Tue 14-4-2009 15:46 To: Strubbe Diederik; r-help@r-project.org Subject: RE: [R] Question

Re: [R] Question: R software

2009-04-05 Thread Dimitris Rizopoulos
check package adapt, http://cran.r-project.org/web/packages/adapt/index.html Best, Dimitris salia a wrote: I need the commond in R for double integral over the range - infinityxy infinity . Could you please help me. Thanks and regards Salya [[alternative HTML version

Re: [R] Question on summing rows within nested variable

2009-03-13 Thread David Winsemius
DF2 - read.table(textConnection(sidpidslope + 1.11.12 + 1.14.13 + 1.15.12 + 2.15.13 + 3.21.22 + 3.21.73), header = TRUE) tapply(DF2$slope, as.factor(DF2$pid), mean) 1.1 1.2 1.7 4.1

Re: [R] Question on summing rows within nested variable

2009-03-13 Thread jim holtman
If you want zero if only one variable: DF2 sid pid slope 1 1.1 1.1 2 2 1.1 4.1 3 3 1.1 5.1 2 4 2.1 5.1 3 5 3.2 1.2 2 6 3.2 1.7 3 tapply(DF2$slope, DF2$sid, function(x) if(length(x) == 1) 0 else mean(x)) 1.1 2.1 3.2 2.33 0.00 2.50 On Fri,

Re: [R] Question about datatypes/plotting issue

2009-03-11 Thread Oscar Bonilla
David, I struggled with this for a while. I think the problem with the dates I have is that they are not specific dates, they are partial dates. A workaround for that that I got from someone else in the list was: as.Date(paste(x$Date, '1'), '%B %Y %d') to make them specific dates (the

Re: [R] Question about datatypes/plotting issue

2009-03-11 Thread Gabor Grothendieck
Another approach is to use yearmon. e.g. library(zoo) as.yearmon(January 1987, %B %Y) [1] Jan 1987 Thus we can replace the w - line in my example code with: w - zoo(as.matrix(W[-1]), as.yearmon(W[,1], %B %Y)) On Wed, Mar 11, 2009 at 12:48 PM, Oscar Bonilla oboni...@galileo.edu wrote: David,

Re: [R] Question about datatypes/plotting issue

2009-03-10 Thread Gabor Grothendieck
There are two header lines which is confusing it. Use pattern= to start at the second one. See the three vignettes in zoo for info on the rest. library(gdata) W - read.xls(http://www2.standardandpoors.com/spf/pdf/index/CSHomePrice_History_022445.xls;, pattern = LXXR) library(zoo) w -

Re: [R] Question about datatypes/plotting issue

2009-03-10 Thread David Winsemius
You need to convert W$Date into a real date variable. At the moment it is just a character variable. str(W) 'data.frame': 265 obs. of 23 variables: $ Date: Factor w/ 265 levels ,April 1987,..: 1 90 68 156 2 178 134 ... $ AZ.Phoenix : Factor w/ 236 levels

Re: [R] Question on Variabeles

2009-03-08 Thread Uwe Ligges
David1234 wrote: Hi everyone, Im quite new to R an I have the following Question: I would like to define Variables which I can add and multiply etc. and that R can simplyfy the terms. The variables should stand for integers. For example I would like to have an entry in an array with

Re: [R] Question on Variables

2009-03-07 Thread jim holtman
myArray[, 'z'] - myArray[, 'z'] + b Is this what you want? On Sat, Mar 7, 2009 at 9:52 AM, David1234 danielth...@web.de wrote: Hi everyone, Im quite new to R an I have the following Question: I would like to define Variables which I can add and multiply etc. and that R can simplyfy the

Re: [R] Question on Variabeles

2009-03-07 Thread David Winsemius
I fear that you are looking for a symbolic algebra system, and R is not that sort of platform. If I am correct and you still want to access a symbolic algebra system from R, then you should look at YACAS and the interface to it, Ryacas. -- David Winsemius On Mar 7, 2009, at 9:52 AM,

Re: [R] Question about the use of large datasets in R

2009-03-04 Thread Thomas Lumley
On Wed, 4 Mar 2009, Vadlamani, Satish {FLNA} wrote: Hi: Sorry if this is a double post. I posted the same thing this morning and did not see it. I just started using R and am asking the following questions so that I can plan for the future when I may have to analyze volume data. 1) What are

Re: [R] Question about multiple plots of zoo objects

2009-03-03 Thread Gabor Grothendieck
Are you trying to color the points themselves? This plots the first two series in frame 1 (they are the same but one is plotted as points and the other as a line) and the third series is shown in frame 2 and for the series of points it colors them green or red. The lines are all colored black:

Re: [R] Question about multiple plots of zoo objects

2009-03-03 Thread Sergey Goriatchev
Hi, Gabor No, what I am trying to do is similar to: abline(v=time(spread)[spread[,Indicator]==(-1)], col=yellow), where spread is the multivariate zoo object (say, 5 timeseries). That is, I want to color parts of the plots where indicator==(-1), but do the coloring without using layout() and

Re: [R] Question about multiple plots of zoo objects

2009-03-03 Thread Gabor Grothendieck
Do you mean you want to shade a portion of the plot? There are two examples of that in the examples section of ?plot.zoo and a further example using xyplot.zoo in the examples section of ?xyplot.zoo On Tue, Mar 3, 2009 at 8:37 AM, Sergey Goriatchev serg...@gmail.com wrote: Hi, Gabor No, what

Re: [R] Question about multiple plots of zoo objects

2009-03-03 Thread Sergey Goriatchev
Gabor, yes, I want to color portions of EACH plot of the MULTIPLE plot done with plot.zoo() I tried to do: plot(multivariate zoo object) abline(v=...) but that does not work. I will check your suggestions of the examples. Thank you for your help, as always! Best, Sergey On Tue, Mar 3, 2009 at

Re: [R] Question about multiple plots of zoo objects

2009-03-03 Thread Sergey Goriatchev
Supreme! Thanks Gabor! On Tue, Mar 3, 2009 at 15:20, Gabor Grothendieck ggrothendi...@gmail.com wrote: If you want to use abline on a multivariate plot it must be issued within a panel function like this: # same set up as in prior email p - function(x, y, ...) { points(x, y); lines(x, y);

Re: [R] Question about normalization to a set of internal standards

2009-03-01 Thread Frank E Harrell Jr
Waverley wrote: Hi, I have a question of the method as how to normalize the data sets according to a set of the internal measurements. For example, I have performed two batches of experiments contrasting two different conditions (positive versus negative conditions): one at a time. 1. each

Re: [R] question about 3-d plot

2009-02-27 Thread Tony Breyal
Hi Deepankar The code on the following page looks kind of cool, and also seems to produce something of the type of graph you are after perhaps: https://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/pkg/rgl/demo/regression.r?rev=702root=rglsortby=dateview=auto [below is a copy of the code...]

Re: [R] question about 3-d plot

2009-02-26 Thread andrew
the following should work library(lattice) x - seq(1,100) y - seq(1,100) gr - expand.grid(x,y) gr$z - x + y + rnorm(1,0,100) cloud(z ~ x + y, data = gr) also, look for the package rgl which does similar but with more possiblities. On Feb 27, 4:28 pm, Dipankar Basu basu...@gmail.com wrote:

Re: [R] question about 3-d plot

2009-02-26 Thread andrew
actually, I just realised you also want a line in the plot. I am not super-sure how to do this. On Feb 27, 5:20 pm, andrew andrewjohnro...@gmail.com wrote: the following should work library(lattice) x - seq(1,100) y - seq(1,100) gr - expand.grid(x,y) gr$z - x + y + rnorm(1,0,100)

Re: [R] question about loading date file in R

2009-02-23 Thread Yihui Xie
The interface is so self-explaining... Data -- Import data -- text files... # pls don't mind :) library(fortunes) fortune(15) Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of

Re: [R] question about tool collisions

2009-02-13 Thread Bert Gunter
See the warn.conflicts arguments of require() and library(). People thought about this a long time ago. -- Bert Gunter -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Carl Witthoft Sent: Friday, February 13, 2009 4:05 PM To:

Re: [R] question about tool collisions

2009-02-13 Thread Marc Schwartz
on 02/13/2009 06:05 PM Carl Witthoft wrote: Recently I got introduced to two packages: {seewave} and {audio} . Turns out they both have a tool to call a system audio tool, and in both cases the name of the tool is play(). Naturally these two tools do slightly different things with

Re: [R] Question about apply()

2009-02-11 Thread Gabor Grothendieck
See ?diff.zoo dif - diff(data, arithmetic = FALSE) - 1 cbind(data, dif) On Wed, Feb 11, 2009 at 6:21 AM, Sergey Goriatchev serg...@gmail.com wrote: Hello, everyone! Assume you have this data: data - structure(c(66.609375, 67.09375, 66.40625, 66.734375, 67.109375, 66.875, 66.09375,

Re: [R] Question about apply()

2009-02-11 Thread Peter Dalgaard
Sergey Goriatchev wrote: Hello, everyone! Assume you have this data: data - structure(c(66.609375, 67.09375, 66.40625, 66.734375, 67.109375, 66.875, 66.09375, 65.921875, 66.546875, 66.140625, 66.140625, 65.65625, 65.875, 65.59375, 65.515625, 66.09375, 66.015625, 66.140625, 66.109375,

Re: [R] Question about apply()

2009-02-11 Thread Sergey Goriatchev
Dear Gabor, Thank you as always. I will follow your suggestion. But, I still want to know what I do wrong in the above code (with embed(), apply(), and merge() functions). Why do I get that error message and how can I rewrite the code to make it run. Best Regards, Sergey On Wed, Feb 11, 2009 at

Re: [R] Question about apply()

2009-02-11 Thread Sergey Goriatchev
Dear Peter, I tried with the comma already, it did not work. rets TY1.lev SP1.lev GC1.lev CL1.lev 2000-01-03 66.60938 1702.7 453.7 18.34 2000-01-04 67.09375 1647.7 447.8 18.29 2000-01-05 66.40625 1649.4 446.2 17.65 2000-01-06 66.73438 1639.9 446.5 17.52 2000-01-07

Re: [R] Question about apply()

2009-02-11 Thread Peter Dalgaard
Sergey Goriatchev wrote: Dear Peter, I tried with the comma already, it did not work. Ah, yes, sorry. The real issue is that you are trying to index twice, both by apply(.,2,.) and by z=TY1.lev (the former loops over columns and the latter selects one of them). So what func() sees is an

Re: [R] Question about apply()

2009-02-11 Thread Gabor Grothendieck
There is no zoo method for embed. embed is implicit in rollapplly so its not normally needed in zoo and rollapply, lag or diff would normally be used instead. If you did want to use embed then unzoo data first but that will lose the time index so add it back in later: e -

Re: [R] Question about apply()

2009-02-11 Thread Sergey Goriatchev
Understood. Peter, Gabor, thank you for your time and help. Regards, Sergey On Wed, Feb 11, 2009 at 14:24, Gabor Grothendieck ggrothendi...@gmail.com wrote: There is no zoo method for embed. embed is implicit in rollapplly so its not normally needed in zoo and rollapply, lag or diff would

Re: [R] question about mean

2009-02-09 Thread Wacek Kusnierczyk
Rolf Turner wrote: On 9/02/2009, at 4:40 PM, bill.venab...@csiro.au wrote: Store your 'matrix' as a data frame. Surely it's a data frame already, since ``school'' is character or factor, and ``value'' is (must be?) numeric. People have this unfortunate predilection to refer

Re: [R] Question about ROCR package

2009-02-08 Thread Tobias Sing
Waverley, you can also use p...@y.values to access the slot (see help(performance-class) for a description of the slots). You might also want have a look at the code for demo(ROCR) and at this slide deck: http://rocr.bioinf.mpi-sb.mpg.de/ROCR_Talk_Tobias_Sing.ppt HTH, Tobias On Sat, Feb 7,

Re: [R] Question about ROCR package

2009-02-08 Thread Frank E Harrell Jr
Tobias Sing wrote: Waverley, you can also use p...@y.values to access the slot (see help(performance-class) for a description of the slots). You might also want have a look at the code for demo(ROCR) and at this slide deck: http://rocr.bioinf.mpi-sb.mpg.de/ROCR_Talk_Tobias_Sing.ppt HTH,

Re: [R] question about mean

2009-02-08 Thread Bill.Venables
Store your 'matrix' as a data frame. Call it 'SchoolVals' say. Then SchoolMeans - with(SchoolVals, tapply(value, school, mean)) should do it. If you have missing values you want to ignore: SchoolMeans - with(SchoolVals, tapply(value, school, mean, na.rm = TRUE)) Bill Venables

Re: [R] question about mean

2009-02-08 Thread Rolf Turner
On 9/02/2009, at 4:40 PM, bill.venab...@csiro.au wrote: Store your 'matrix' as a data frame. Surely it's a data frame already, since ``school'' is character or factor, and ``value'' is (must be?) numeric. People have this unfortunate predilection to refer to data frames

Re: [R] Question about plotting data points in box plots

2009-02-07 Thread John Fox
Dear George, You could use jitter(x) in place of x to randomly perturb the horizontal coordinates. See ?jitter for details. I hope this helps, John -- John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario, Canada web:

Re: [R] Question about ROCR package

2009-02-07 Thread David Winsemius
If you post the code that you used, prehapsy using the sample data in the same package, you may get more useful replies: commented, minimal, self-contained, reproducible code. Gee, ... where have I seen that before? Also could see the thread;

Re: [R] Question about ROCR package

2009-02-07 Thread Jorge Ivan Velez
Dear Waverley, Try this: unlist(slot(perf,y.values)) See ?slot for more details. HTH, Jorge On Sat, Feb 7, 2009 at 3:17 PM, Waverley waverley.paloa...@gmail.comwrote: Hi, I have a question about ROCR package. I got the ROC curve plotted without any problem following the manual.

Re: [R] Question about ROCR package

2009-02-07 Thread Jorge Ivan Velez
Hi Waverley, I forgot to tell you that perf is your performance object. Here is an example from the ROCR package: ## computing a simple ROC curve (x-axis: fpr, y-axis: tpr) library(ROCR) data(ROCR.simple) pred - prediction( ROCR.simple$predictions, ROCR.simple$labels) perf -

Re: [R] question about running multiple R windows

2009-02-05 Thread milton ruser
On Thu, Feb 5, 2009 at 6:31 AM, Uwe Ligges lig...@statistik.tu-dortmund.dewrote: milton ruser wrote: Dear George, I think it will depends on the amount of memory that each your session will need. Case each session use a big amount of memory, may be your some of your sessions will get

<    8   9   10   11   12   13   14   15   16   >