[R] How can I easily rbind a list of data frames into one data frame?

2008-09-26 Thread Matthew Pettis
Hi, I have a list output from the 'lapply' function where the value of each element of a list is a data frame (each data frame in the list has the same column types). How can I rbind all of the list entry values into one data frame? Thanks, Matt -- It is from the wellspring of our despair and

[R] quantile / centile

2008-09-26 Thread Donald Braman
I'm wondering if there is a simple way to assign a quantile to a vector in a data frame, much like one could in Stata using centile. Let's say I want 100 slices in my assignation. I can easily see what the limits of each slice by using quantile: quantile(my.df$my.var, probs=seq(0, 1, 0.01)) But ho

[R] ggplot, getting two scales and one stat.

2008-09-26 Thread Tylere Couture
I have a simple plot: ggplot(polls, aes(x =Date, y = Popular_Support, colour=Party, shape=Source)) + stat_smooth(span=0.5) + geom_point() How can I get the smooth to only render along one of the scales? ie, I want to see regressions for each colour, but not each shape. Right now I get a trendlin

Re: [R] apply

2008-09-26 Thread Johannes Hüsing
Am 27.09.2008 um 05:46 schrieb John Sorkin: Windows XP R 2.7.1 I am trying to use apply (or lapply, sapply) to get the sample function to select 1000 samples of size 10 from c(1,2,3) with probability c(0.1,0.2,0.7), i.e. for (i in 1:1000) { j<-sample(c(1,2,3),10,replace=TRUE,prob=c(0.1,0.2

Re: [R] Add "title" in sink output and possibility of plot-like output for text

2008-09-26 Thread Michael Just
Jorge, Thanks for the suggestions. Your code works nicely. As for savePlot I am unsure if it will work for the text output to plot, but I will continue to explore. Cheers, M Just On Wed, Sep 24, 2008 at 2:57 PM, Jorge Ivan Velez <[EMAIL PROTECTED]>wrote: > > Dear Michael, > For your first questi

Re: [R] Add "title" in sink output and possibility of plot-like output for text

2008-09-26 Thread Michael Just
Greg, Thanks for the suggestions. I appreciate it. -M Just On Wed, Sep 24, 2008 at 2:47 PM, Greg Snow <[EMAIL PROTECTED]> wrote: > You could use the cat function to output some text that would then be > included in the sinked output file. Or look at the txtStart and related > functions in the T

[R] Trend graph

2008-09-26 Thread C.H.
Dear R Gurus, I have a problem related to plot. For example, I have two variables, pre and post. pre <- c(1,2,3,4,5) post <- c(2,5,7,2,3) How can I plot a line graph similar to this one? http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=1847566&rendertype=figure&id=F1 Would you please

[R] apply

2008-09-26 Thread John Sorkin
Windows XP R 2.7.1 I am trying to use apply (or lapply, sapply) to get the sample function to select 1000 samples of size 10 from c(1,2,3) with probability c(0.1,0.2,0.7), i.e. for (i in 1:1000) { j<-sample(c(1,2,3),10,replace=TRUE,prob=c(0.1,0.2,0.7)) print(j) } My solution does not work: j

Re: [R] OHLC Plot with EMA in it

2008-09-26 Thread Jeff Ryan
Using quantmod and TTR (for EMA, as well as many, many more technical tools): library(quantmod) # get some data getSymbols("") barChart() addEMA() Lots of examples at: http://www.quantmod.com http://www.quantmod.com ---and--- http://www.quantmod.com/examples/charting/ http://www.quan

Re: [R] Newbie: Ranking a data frame, grouped by 2 or more columns

2008-09-26 Thread Matthew Pettis
Thanks! I think 'ave' was what I was looking for... On Fri, Sep 26, 2008 at 6:28 PM, jim holtman <[EMAIL PROTECTED]> wrote: > Try this: > >> x > V1 V2 V3 > 1 a w 200 > 2 a w 100 > 3 b w 500 > 4 b w 200 > 5 b z 300 > 6 b z 400 >> x$rank <- ave(x$V3, x$V1, x$V2, FUN=rank) >> x > V1 V

Re: [R] Convex optimization in R?

2008-09-26 Thread Hesen Peng
Well, I finally figured out to do some algebra transformation and the problem was reduced to non-linear optimization on bounded areas. But on my way to this I ran into IMSL Fortran library function NNLPF. And its documentation toke me to DONLP2, a free Fortran package solving a huge family of nonli

[R] A Book for SAS, SPSS and R students

2008-09-26 Thread Ajay ohri
Hi List, I had the pleasure of taking Dr Bob Muenchen's interview for his upcoming book R For SAS and SPSS users. He has spent 27 years in this field while I have spent almost that much on earth. So this is more like a fan blog interview. I thought it would be of use to people curious about R, or

Re: [R] Dealing With Extremely Large Files

2008-09-26 Thread Gabor Grothendieck
Not sure if it applies to your file or not but if it does then the sqldf package facilitates reading a large file into an SQLite database. Its a front end to RSQLite which is a front end to SQLite and it reads the data straight into the database without going through R so R does not limit it in any

Re: [R] howto convert matrix of numeric values to Date class?

2008-09-26 Thread jim holtman
You should be able to convert with: myDate <- as.Date(dates, origin='1960-1-1') On Fri, Sep 26, 2008 at 12:53 PM, Philip James Smith <[EMAIL PROTECTED]> wrote: > Hi: > > I have a matrix, named "mat," of numeric values that are in days since Jan > 1, 1960. > > I want to convert them Date class val

Re: [R] Dealing With Extremely Large Files

2008-09-26 Thread jim holtman
You can always setup a "connection" and then read in the number of lines you need for the analysis, write out the results and then read in the next ones. I have also used 'filehash' to initially read in portions of a file and then write the objects into the database. These are quickly retrieved if

Re: [R] Newbie: Ranking a data frame, grouped by 2 or more columns

2008-09-26 Thread jim holtman
Try this: > x V1 V2 V3 1 a w 200 2 a w 100 3 b w 500 4 b w 200 5 b z 300 6 b z 400 > x$rank <- ave(x$V3, x$V1, x$V2, FUN=rank) > x V1 V2 V3 rank 1 a w 2002 2 a w 1001 3 b w 5002 4 b w 2001 5 b z 3001 6 b z 4002 > On Fri, Sep 26, 2008 at 4:54

Re: [R] How to update a column in a dataframe, more simply...

2008-09-26 Thread jim holtman
First of all, what you have will not work since you also have to subset the RHS of the equation: data$score[data$type=="1" & data$year=="2001"]<-data$score[data$type=="1" & data$year=="2001"] * 0.111 Another way is to construct a matrix of the values you want to search for and change: (not tested

[R] logistic regression

2008-09-26 Thread Darin Brooks
Good afternoon I have what I hope is a simple logistic regression issue. I started with 44 independent variables and then used the drop1, test="chisq" to reduce the list to 8 significant independent variables. drop1(sep22lr, test="Chisq") and wound up with this model: Model: MIN_Mstocked

[R] How to update a column in a dataframe, more simply...

2008-09-26 Thread Mark Na
Hello, I would like to be able to update an existing column in a dataframe, like this... data$score[data$type=="1" & data$year=="2001"]<-data$score * 0.111 data$score[data$type=="1" & data$year=="2002"]<-data$score * 0.222 data$score[data$type=="1" & data$year=="2003"]<-data$score * 0.333 ...

Re: [R] data frame column name as a function argument

2008-09-26 Thread Hutchinson,David [PYR]
First - you need to pass the data frame into the function. testing <- function (d, colname) { return (d[[colname]]) } d <- data.frame(cbind(x=1, y=1:10)) print (testing(d, 'x')) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of eric lee Sent: Friday, S

[R] data frame column name as a function argument

2008-09-26 Thread eric lee
Hello, I'd like to pass a column name as the argument for a function, but I'm getting "NULL" as a return value. Any suggestions? Thanks. > d <- data.frame(cbind(x=1, y=1:10)) > d x y 1 1 1 2 1 2 3 1 3 4 1 4 5 1 5 6 1 6 7 1 7 8 1 8 9 1 9 10 1 10 > testing <- function(var) {

Re: [R] Return a list

2008-09-26 Thread hadley wickham
> it depends on what the original author wanted. > > with constructs a new environment, and all assignments, if any, made in > the expression evaluated within with are invisible to the outside > (unless one plays with environments, again): > > x = 1:10 > a = 3 > with(test(), { x[1:3] = c(a,b,c); x

Re: [R] Return a list

2008-09-26 Thread Wacek Kusnierczyk
that's likely to work, but it's even worse than my non-functional version: the destructive operation on the test's caller's environment is performed here by the callee (test), and you can get ugly surprises if you forget that test does that. i'd consider this (and the 'for (name in names(result))

Re: [R] Return a list

2008-09-26 Thread Wacek Kusnierczyk
Bert Gunter wrote: > But why do this? Just leave the (preferably named) variables as list > components and work with them there. > > 1. ?comment tells you how to add a comment attribute to the list for self > documentation (what were the components? how are they related? etc.) > > 2. ?with shows y

Re: [R] Newbie: Ranking a data frame, grouped by 2 or more columns

2008-09-26 Thread hadley wickham
On Fri, Sep 26, 2008 at 3:54 PM, Matthew Pettis <[EMAIL PROTECTED]> wrote: > Hi, > > I'd like to rank obs in a data frame as subset by 2 or more columns... > The example input would look like the following: > > ++++ > x y v > -- -- -- > a w 200 > a w 100 > b w 500

Re: [R] Dot plot - equivalent of MINITAB

2008-09-26 Thread Richard M. Heiberger
I suggest the panel.dotplot.tb in the HH package. It is a lattice panel function and therefore works with standard trellis formulas including conditioning variables and grouping variables. library(HH) example(panel.dotplot.tb) Since you define what you want in terms of Minitab, I mention that thi

Re: [R] Newbie: Ranking a data frame, grouped by 2 or more columns

2008-09-26 Thread Henrique Dallazuanna
Try this: DF V1 V2 V3 1 a w 200 2 a w 100 3 b w 500 4 b w 200 5 b z 300 6 b z 400 DF$rank <- unlist(lapply(split(DF$V3, list(DF$V1, DF$V2), drop = T), rank)) On Fri, Sep 26, 2008 at 5:54 PM, Matthew Pettis <[EMAIL PROTECTED]> wrote: > Hi, > > I'd like to rank obs in a data fram

Re: [R] Return a list

2008-09-26 Thread N. Lapidus
The answers that were previously given allow you to easily extract results from your returned list, but if I understand well, this list is created only because you cannot return several arguments whereas you need to keep the values of a, b, c, etc. Am I right? Another solution would be to directly

[R] error sending selection to R

2008-09-26 Thread AnaLibe
Hello, I'm running R 2.7.2 and Tinn-R 2.0.0.7 . I followed the steps in http://sourceforge.net/forum/forum.php?forum_id=864071 , but I still get the message: source(.trPaths[5]) in R console when I make a selection. Send line works fine. Can anyone suggest a solution? Thanks, -- View this messag

Re: [R] Dealing With Extremely Large Files

2008-09-26 Thread Charles C. Berry
Try RSiteSearch("biglm") for some threads that discuss strategy for analyzing big datasets. HTH, Chuck On Fri, 26 Sep 2008, zerfetzen wrote: Hi, I'm sure that a large fixed width file, such as 300 million rows and 1,000 columns, is too large for R to handle on a PC, but are there

Re: [R] Using functions that contain sums

2008-09-26 Thread Charles C. Berry
On Fri, 26 Sep 2008, Patrick M. Joyce wrote: Hello, I'm trying to perform an integration on a function that contains a sum. Similarly I'm hoping whatever acts as a fix will be good enough to aid in a 2nd case as well but I've already put in a work-around for that situation. My code example is

Re: [R] lsmeans

2008-09-26 Thread John Fox
Dear Benjamin, In the absence of interactions, a suitably constructed model matrix could, for example, allow one predictor to range over its values while others are held to typical values (such as means). The effects package does this for linear and generalized linear models (and soon for proporti

[R] Newbie: Ranking a data frame, grouped by 2 or more columns

2008-09-26 Thread Matthew Pettis
Hi, I'd like to rank obs in a data frame as subset by 2 or more columns... The example input would look like the following: ++++ x y v -- -- -- a w 200 a w 100 b w 500 b w 200 b z 300 b z 400 ++++ And the data frame I want to create i

Re: [R] Return a list

2008-09-26 Thread Bert Gunter
But why do this? Just leave the (preferably named) variables as list components and work with them there. 1. ?comment tells you how to add a comment attribute to the list for self documentation (what were the components? how are they related? etc.) 2. ?with shows you how to access the components

Re: [R] Proper power computation for one-sided binomial tests.

2008-09-26 Thread collinl
> > Am 23.09.2008 um 23:57 schrieb Peter Dalgaard: > >> For this kind of problem I'd go directly for the binomial >> distribution. If the actual probability is 0, this is essentially >> deterministic and you can look at >> >> > binom.test(0,99,p=.03, alt="less") >> > > > This means that you don't

Re: [R] lsmeans

2008-09-26 Thread Frank E Harrell Jr
Nutter, Benjamin wrote: I hope you'll forgive me for resurrecting this thread. My question refers to John Fox's comments in the discussion of lsmeans from https://stat.ethz.ch/pipermail/r-help/2008-June/164106.html John you said, "It wouldn't be hard, however, to do the computations yourself,

Re: [R] Collecting output from terminal nodes in a recursion tree

2008-09-26 Thread James Muller
Why not have the return values of each instance of the function be: a) list containing only the current value if terminal node b) concatenated list of returned values from functions if not terminal node (and hence call other functions) My thought is the way you've set this up won't be efficie

[R] Collecting output from terminal nodes in a recursion tree

2008-09-26 Thread B Q
I have a recursive function. The recursion forms a tree with many (millions) terminal nodes. The function must output a value (say, a number or a vector) from each terminal node. At the end, when all recursion is done, we want to collect all the output values. How can that be done cleanly and ef

[R] Dealing With Extremely Large Files

2008-09-26 Thread zerfetzen
Hi, I'm sure that a large fixed width file, such as 300 million rows and 1,000 columns, is too large for R to handle on a PC, but are there ways to deal with it? For example, is there a way to combine some sampling method with read.fwf so that you can read in a sample of 100,000 records, for exam

Re: [R] lsmeans

2008-09-26 Thread Nutter, Benjamin
I hope you'll forgive me for resurrecting this thread. My question refers to John Fox's comments in the discussion of lsmeans from https://stat.ethz.ch/pipermail/r-help/2008-June/164106.html John you said, "It wouldn't be hard, however, to do the computations yourself, using the coefficient vect

Re: [R] Return a list

2008-09-26 Thread Wacek Kusnierczyk
Mike Prager wrote: > "Stefan Fritsch" <[EMAIL PROTECTED]> wrote: > > >> I have several output variables which I give back with the list command. >> >> test <- function {return(list(a,b,c,d,e,f,g,...))} >> >> After the usage of the function I want to assign the variables to the output >> var

[R] Using functions that contain sums

2008-09-26 Thread Patrick M. Joyce
Hello, I'm trying to perform an integration on a function that contains a sum. Similarly I'm hoping whatever acts as a fix will be good enough to aid in a 2nd case as well but I've already put in a work-around for that situation. My code example is here: watermelon=c(0,1,2,3) w<-function(x){ s

[R] RWeka on R-2.7.2___Can't evaluate classifier on test set

2008-09-26 Thread Ye, Bin
Hi, Everyone, I just installed R-2.7.2 on my computer and then installed package RWeka, version 0.3-13. I noticed that when using command "evaluate_Weka_Classifier", with parameter "newdata=", it still evaluated on training data. Does anyone else noticed this? My older version of R-2.6.1 with

[R] issue with varSel.svm.rfe in package MCRestimate

2008-09-26 Thread Elizabeth McClellan
Hello all, I would like to perform SVM-RFE (Guyon et al. 2002) in R and have only found one implementation of this algorithm. The function belongs to the MCRestimate package but when I try to use it I encounter a problem - the function appears to be missing a required package or other function th

Re: [R] Computing Mean Lifetime from Hazard

2008-09-26 Thread Ravi Varadhan
Hi, there was a typo in the last formula of my previous email. The correct formula is: mean life time = int_{0} ^{\inf} u * f(u) du Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Heal

[R] 10-minute presentation of R as a machine learning platform

2008-09-26 Thread Alexy Khrabrov
Greetings -- I'd like to present R to our university research group as a viable platform to do machine learning applications for human behavior modeling. The actual research will be further specialized, but general activities -- acquiring/interfacing with the data, specifying/learning a mo

Re: [R] bar and line plot

2008-09-26 Thread Gabor Grothendieck
Try this: library(lattice) DF$Date <- as.Date(DF$Date) xyplot(NumEggs ~ Date | Site, DF, type = "h") Also look at ggplot2 for another way. On Fri, Sep 26, 2008 at 2:38 PM, Felipe Carrillo <[EMAIL PROTECTED]> wrote: > Hello All: >Using the below dataset how can I make a barplot with >Dat

Re: [R] Return a list

2008-09-26 Thread Mike Prager
"Stefan Fritsch" <[EMAIL PROTECTED]> wrote: > I have several output variables which I give back with the list command. > > test <- function {return(list(a,b,c,d,e,f,g,...))} > > After the usage of the function I want to assign the variables to the output > variables. > > result <- test()

Re: [R] Computing Mean Lifetime from Hazard

2008-09-26 Thread Ravi Varadhan
Hi, The fundamental relation b/w hazard (h), survival (S), and density (f) functions is: f(t) = h(t) * S(t) Where S(t) = exp ( - int_{0} ^{t} h(u) du ) mean life time = int_{0} ^{\inf} f(u) du If you have a piecewise constant h(t), you can either smooth it and compute the required integrals u

[R] Tolerance levels in stepwise regression

2008-09-26 Thread Jenni van Ravensway
Hello, I apologize if this was sent twice but I don't think it was actually sent the first time! I have been using the step() function for stepwise regression and was wondering if there was a way to specify a tolerance level either using step() or another stepwise function. So far I have only fo

Re: [R] Generating a valid covariance matrix

2008-09-26 Thread davidr
Depending on what you want your covariance matrices to be like, you could form random symmetric matrices with positive diagonals and then use nearPD {Matrix} to make them positive definite, but the resulting distribution of covariance matrices would be hard to guess. And giving a diagonal matrix

Re: [R] R on Mandriva

2008-09-26 Thread Paul Bivand
Dear Abdel The Mandriva repositories seem to have only 18 packages in the Contrib repositories. These seem to be dependencies of various GUI flavours (the repositories include rattle, Rcmdr (as R-cran-Rcmdr) and the non-CRAN rkward. Beyond that, yes you require the build tools. You should have gc

[R] bar and line plot

2008-09-26 Thread Felipe Carrillo
Hello All: Using the below dataset how can I make a barplot with Date(X) and NumEggs(Y) by Site. Then plot Temp(lineplot) It seems really simple, but I am having a hard time trying to do it by Site. Thanks Date NumEggs Site Temp 1 2008-04-22

[R] Total Correlation / Multi-Information

2008-09-26 Thread Vishal Belsare
Hi, Given a set of stochastic sequences, say n with T observations on each. Is there any algorithm (hopefully implemented) to compute the total correlation / multi-information for this set of random sequences? I know that it entails estimation of entropy, and that is where I see blurry. How does o

Re: [R] Dot plot - equivalent of MINITAB

2008-09-26 Thread Greg Snow
Does the 'dots' function in the TeachingDemos package do what you want? (It fits one interpretation of your description, but my minitab is a bit rusty, so not sure). (The "you" above referring to kerfuffle, not Rolf, for some reason I received the reply, but not the original). -- Gregory (Greg

Re: [R] Cross Validation output

2008-09-26 Thread Donald Catanzaro, PhD
Good Day All, I have a negative binomial model that I created using the function glm.nb() with the MASS library and I am performing a cross-validation using the function cv.glm() from the boot library. I am really interested in determining the performance of this model so I can have confiden

Re: [R] Regression and data types

2008-09-26 Thread Daniel Malter
check is(X1) is(X2) to investigate whether the types of the variables are equal. Probably (most probably), X2 is a factor (treated as dummy variables) so that your 60 values from the second regression are the intercept (i.e. the coefficient for the first observation) plus 59 dummies for the offs

[R] howto convert matrix of numeric values to Date class?

2008-09-26 Thread Philip James Smith
Hi: I have a matrix, named "mat," of numeric values that are in days since Jan 1, 1960. I want to convert them Date class values so that I can do things like seq( value , len=10, by="1 week") where "value" is any of the matrix elements. How do I do this? Please reply to: [EMAIL PROTECTED]

[R] R-Language Titles From Cambridge University Press

2008-09-26 Thread Katy Strong
Cambridge Cambridge University Press is proud to present its extensive list of titles featuring the R Language with books of unrivaled excellence. Please visit our R dedicated page and check out all of the titles Cambridge has to offer. Below is just a sample of what is available from Cambridge.

Re: [R] Bug in "is" ?

2008-09-26 Thread Roy Mendelssohn
From the R-web pages, on what should be posted to which mail list: R-help The ‘main’ R mailing list, for discussion about problems and solutions using R, announcements (not covered by ‘R-announce’ or ‘R- packages’, see above), about the availability of new functionality for R and documentat

Re: [R] [SPAM] - Re: Bug in "is" ? - Found word(s) list error in the Text body

2008-09-26 Thread davidr
If one looks at the other is.* functions or ?mode, one will quickly see that each is.* function does something specific and not 'what one would expect'. For example, is.real and is.complex do not tell you whether the argument has a zero complex part or not. Another example is all.equal. If one

Re: [R] Bug in "is" ?

2008-09-26 Thread Wacek Kusnierczyk
Michael A. Miller wrote: >> Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: >> > > > but it does seem to be a wrong decision for a language > > focused mostly with statistical computations and not > > computer science concerned with how to represent an > > integer.

[R] The 'data' argument and scoping in nls

2008-09-26 Thread Keith Jewell
Hi Everyone, I seek guidance to avoid wasting a lot of time and doing things badly. Several times I've solved my problems, only to find that my solutions were clumsy and not robust. (see "nested" getInitial calls; variable scoping problems: Solved?? http://finzi.psych.upenn.edu/R/Rhelp02a/arch

Re: [R] Bug in "is" ?

2008-09-26 Thread Michael A. Miller
> Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > but it does seem to be a wrong decision for a language > focused mostly with statistical computations and not > computer science concerned with how to represent an > integer. The key word here is "computations." And after read

[R] Computing Mean Lifetime from Hazard

2008-09-26 Thread Alan Cox
Hello, If all I have access to is an empirically calculated hazard function, is it possible to compute an approximate value for the mean lifetime? I know that if the hazard function is essentially constant, the mean lifetime is 1/hazard rate.  But if I'm confident that the empirical hazard func

Re: [R] Return a list

2008-09-26 Thread Henrique Dallazuanna
Try this: sapply(names(result), function(nm)assign(nm, result[[nm]], envir = globalenv())) On Fri, Sep 26, 2008 at 10:57 AM, Stefan Fritsch <[EMAIL PROTECTED]> wrote: > Dear R Users, > > another problem for me is the output of a function. > > I have several output variables which I give back wit

[R] Tolerance levels in stepwise regression

2008-09-26 Thread Jenni van Ravensway
Hello, I have been using the step() function for stepwise regression and was wondering if there was a way to specify a tolerance level either using step() or another stepwise function. So far I have only found an option to specify tolerance in lm.fit() but I am not an experienced R user and am no

[R] ANOVA between & within variance

2008-09-26 Thread Gregor Rolshausen
hi, is there an option to calculate the 'within' & 'between' group variances for a simple ANOVA (aov) model (2 groups, 1 trait, normally distr.) ? or do I have to calculate them from the Sum Sq ? thanks for your time and greetings, gregor -- Gregor Rolshausen PhD Student; University

Re: [R] Return a list

2008-09-26 Thread baptiste auguie
?attach or ?with Hope this helps, baptiste On 26 Sep 2008, at 14:57, Stefan Fritsch wrote: Dear R Users, another problem for me is the output of a function. I have several output variables which I give back with the list command. test <- function {return(list(a,b,c,d,e,f,g,...))}

Re: [R] Converting shell("cd") to a string

2008-09-26 Thread Martin Maechler
> "AR" == Arthur Roberts <[EMAIL PROTECTED]> > on Fri, 26 Sep 2008 01:54:59 -0700 writes: AR> Hi, all, AR> Is there an R-command that will convert shell("cd") to a string, so AR> that I can use it in the paste() command? I'm pretty sure that for the specific case, you sh

[R] Return a list

2008-09-26 Thread Stefan Fritsch
Dear R Users, another problem for me is the output of a function. I have several output variables which I give back with the list command. test <- function{return(list(a,b,c,d,e,f,g,...))} After the usage of the function I want to assign the variables to the output variables. result <

Re: [R] looking for a better way to code a bar graph

2008-09-26 Thread hadley wickham
Hi Norman, This is pretty easy in ggplot2 (if you adjust your data a little): install.packages("ggplot2") library(ggplot2) days <- seq(Sys.Date(), len=100, by="1 day") df <- data.frame( date = rep(days, each = 3), trt = rep(c("A", "B", "C"), 50), price = runif(150) ) qplot(date, price

Re: [R] Error in Cut command - 'x' must be numeric?

2008-09-26 Thread Uwe Ligges
a is a data.frame that contains a numeric vector "tot_rdm_amt", hence you want to use cut(a$tot_rdm_amt,10), I guess Uwe Ligges Mackay Peter wrote: Hi Everyone I have a data set I want to bucket into deciles. Have been trying (without) success to use cut and using online help to understand

Re: [R] Date Time conversion

2008-09-26 Thread Gabor Grothendieck
chron uses: - separate arguments for date and time -- not a single one as you have - a separate system for the codes, not the % codes of Date and POSIXt classes If you want to specify the date and time all as one string rather than two arguments, use as.chron instead of chron -- as.chron does use

[R] Odp: Date Time conversion

2008-09-26 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 26.09.2008 16:18:33: > what am I doing wrong? > > chron(as.character(f), format=c(dates="%m/%d/%y", times="%h:%m")) Not sure about chron as I do not use it but this strptime(f, format="%m/%d/%y %H:%M") works OK. So maybe chron(as.character(f), format=c(dates=

[R] Odp: Regression and data types

2008-09-26 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 26.09.2008 14:17:59: > Dear All > I have three data sets, X1, X2 and Y. X1 is data, X2 and Y were > generated in (different) R programs. All three vectors have one column > of 60 data points. > I am using the code lm(Y~X1)$coef and lm(Y~X2)$coef. The first returns

[R] Date Time conversion

2008-09-26 Thread stephen sefick
what am I doing wrong? chron(as.character(f), format=c(dates="%m/%d/%y", times="%h:%m")) f <- structure(c(51L, 60L, 66L, 87L, 90L, 115L, 23L, 35L, 37L, 6L, 12L, 55L, 84L, 96L, 109L, 17L, 29L, 41L, 3L, 74L, 94L, 102L, 30L, 8L, 46L, 69L, 107L, 15L, 25L, 39L, 1L, 71L, 95L, 19L, 56L, 62L, 76L, 85L, 9

Re: [R] Question about --internet2 on Windows

2008-09-26 Thread Prof Brian Ripley
On Fri, 26 Sep 2008, Erich Neuwirth wrote: Is there a way tell R that it should use --internet2 from within a running R process? Not without changing the source code. If you read the sources, you will see that you need to set the C variable UseInternet2 *before* the ftp/http functions are c

Re: [R] auto.arima help

2008-09-26 Thread rkevinburton
Yes, sorry it auto.arima is in the 'forecast' package. The following produces the problem: auto.arima(ts(c(rep(0,104), rep(143, 52), rep(260,33)), frequency=52)) Kevin Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Thu, 25 Sep 2008, [EMAIL PROTECTED] wrote: > > > I am calling auto.ar

[R] Question about --internet2 on Windows

2008-09-26 Thread Erich Neuwirth
Is there a way tell R that it should use --internet2 from within a running R process? -- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-39464 Fax: +43-1-4277-39459 ___

Re: [R] R on Mandriva

2008-09-26 Thread Abdel
Dear Paul, Thanks for your help. I did not have a go yet at installing R, but will do it shortly. I have another related query, and your help is greatly appreciated. Eventually I am going to read netcdf files in R, do I need other packages and/or softwares beside R-base (e.g. fortran compiler

[R] looking for a better way to code a bar graph

2008-09-26 Thread Rubin, Norman
I've just used r a little, so this might be a trivial question but I have a small data file part, vs/total ,ps/total,gpgpu, date ... ... ... ... .. that contains the percent that certain features contribute to a part and the dat

Re: [R] include scripts into main file (the LaTeX way)

2008-09-26 Thread Michael Schulte
source() does the trick thanks to you all! m baptiste auguie wrote: you mean like ?source ? On 26 Sep 2008, at 13:49, Michael Schulte wrote: Dear R-people, I want to use an idea from LaTeX in the work flow with R. It is possible in LaTeX to have a main file from which other files are called

Re: [R] include scripts into main file (the LaTeX way)

2008-09-26 Thread Prof Brian Ripley
This is hardly original to LaTeX (in fact even TeX has a way), and most programming languages have such a mechanism (e.g. #include in C). R's nearest equivalent is source(), but that does not have a mechanism like TEXINPUTS to search for files (but then neither does MikTeX). I believe I have

[R] cca constraining variables table

2008-09-26 Thread glaporta
I performed canonical correspondence analysis (cca) with the example data of vegan, but I'm not able to obtain a table like scores() for the constraining variables. I can see them in the summary() mode, but it would be great to have in a separate table. Any suggestion?, thanx Gianandrea require(v

Re: [R] include scripts into main file (the LaTeX way)

2008-09-26 Thread baptiste auguie
you mean like ?source ? On 26 Sep 2008, at 13:49, Michael Schulte wrote: Dear R-people, I want to use an idea from LaTeX in the work flow with R. It is possible in LaTeX to have a main file from which other files are called (ie included). So for example if you have book, the main index file

Re: [R] include scripts into main file (the LaTeX way)

2008-09-26 Thread Marianne Promberger
Hi, On Friday, 26 September 2008, 14:49 (UTC+0200), Michael Schulte wrote: [...] > So for example if you have book, the main index file would call each > chapter separately. > > Is there something comparable in R that follows the above 'include' idea > from LaTeX? I've used source() for that.

Re: [R] Bug in "is" ?

2008-09-26 Thread Michael Dewey
At 02:02 26/09/2008, Rolf Turner wrote: On 26/09/2008, at 12:34 PM, jim holtman wrote: The nice thing about R is if you don't like something, then get create your own function (is.Integer?) that does what you want without asking to have the base code changed and therefore impact a lot of progr

Re: [R] include scripts into main file (the LaTeX way)

2008-09-26 Thread Gábor Csárdi
Perhaps ?source. Gabor On Fri, Sep 26, 2008 at 2:49 PM, Michael Schulte <[EMAIL PROTECTED]> wrote: > Dear R-people, > > I want to use an idea from LaTeX in the work flow with R. > It is possible in LaTeX to have a main file from which other files are > called (ie included). > So for example if yo

Re: [R] Type I and Type III SS in anova

2008-09-26 Thread John Fox
Dear Stefan, One place is my Applied Regression text (Sage, 1997 or 2008). Regards, John -- John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario, Canada web: socserv.mcmaster.ca/jfox > -Original Message- > From: [EMAIL PROTECTED

[R] include scripts into main file (the LaTeX way)

2008-09-26 Thread Michael Schulte
Dear R-people, I want to use an idea from LaTeX in the work flow with R. It is possible in LaTeX to have a main file from which other files are called (ie included). So for example if you have book, the main index file would call each chapter separately. Is there something comparable in R tha

Re: [R] axis in a normal plot

2008-09-26 Thread Marianne Promberger
On Friday, 26 September 2008, 10:49 (UTC+0200), Silje-Kristin Jensen wrote: > Hi > I have a small problem, I'm new in using R, so I hope you can help me... > I'm running a logistic regression model and want to do a nice plot. > The plot I have made is done a plot with the command jitter: > > plot

Re: [R] Type I and Type III SS in anova

2008-09-26 Thread Prof Brian Ripley
Try library(fortunes); fortune("Type III") (Try it multiple times as there are two relevant quotes: one is to http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf) I would not expect modern statistics courses to discuss this issue (or even ANOVA except for historical information), as with an inter

Re: [R] Dot plot - equivalent of MINITAB

2008-09-26 Thread Dr. S. B. Nguah
Paul, Have you tried the dotplot() function in the package epicalc? I think it does what you want. Sammy kerfuffle wrote: > > hi folks, > > Bit of a newbie, but I've spent a fair bit of time looking for an answer > on this, with no joy. Can anyone help me? > > Dataset: A single column of

Re: [R] Type I and Type III SS in anova

2008-09-26 Thread Stefan Uhmann
Dear list, slightly OT: can you recommend me any sources where I can find more about this Type I - II - III anova problem? It seems as my statistics courses did not cover this issue, so I feel rather naive and have this sort of feeling that some of my analyses might be complete nonsense. Reg

[R] Regression and data types

2008-09-26 Thread GRANT Lewis
Dear All I have three data sets, X1, X2 and Y. X1 is data, X2 and Y were generated in (different) R programs. All three vectors have one column of 60 data points. I am using the code lm(Y~X1)$coef and lm(Y~X2)$coef. The first returns two values, an intercept and a slope, but the second returns 60 v

[R] adjusting textsize and spacing in mosaic (vcd package)

2008-09-26 Thread Richard . Cotton
I'm trying to find a way to change the font size in a mosaic plot (the grid version, not the base graphics one). Here's an example to demonstrate: #Basic plot library(vcd) mosaic(HairEyeColor, shade = TRUE) #Bad first guess: this stops the default cell colouring, and doesn't change the font siz

Re: [R] Does R have an "inverse empirical cumulative distribution" function ?

2008-09-26 Thread tolga . i . uzuner
Daft of me. Yes. Many thanks, Tolga Peter Dalgaard <[EMAIL PROTECTED]> 26/09/2008 12:14 To [EMAIL PROTECTED] cc r-help@r-project.org Subject Re: [R] Does R have an "inverse empirical cumulative distribution" function ? [EMAIL PROTECTED] wrote: > Dear R Users, > > Does R have an "invers

Re: [R] Does R have an "inverse empirical cumulative distribution" function ?

2008-09-26 Thread Yihui Xie
Isn't the "inverse" ECDF just the quantile function?... Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beiji

Re: [R] Does R have an "inverse empirical cumulative distribution" function ?

2008-09-26 Thread Peter Dalgaard
[EMAIL PROTECTED] wrote: > Dear R Users, > > Does R have an "inverse empirical cumulative distribution" function, > something one can use to invert ecdf ? > > Thanks in advance, > Tolga > quantile(, type=1) (Actually you can't invert a piecewise constant function...) -- O__ Pete

  1   2   >