Re: [R] Lattice: barchart, error bars and grouped data

2010-03-10 Thread Johannes Graumann
Thanks. I switched to ggplot2 which offers error bars. Joh Dieter Menne wrote: Johannes wrote: How can I, given the code snippet below, draw the error bars in the center of each grouped bar rather than in the center of the group? http://markmail.org/message/oljgimkav2qcdyre

Re: [R] How to take out the content of character string

2010-03-10 Thread baptiste auguie
Hi, it's generally considered a bad practice but try this, eval(parse(text=AA)) library(fortunes) fortune(106) HTH, baptiste On 10 March 2010 07:46, jq81 jingqia...@gmail.com wrote: My question is represented by the following example. For example, I have a character string a, which is

Re: [R] ncdf installation

2010-03-10 Thread Prof Brian Ripley
To include code in a shared object on x86_64 Linux it must be compiled with -fPIC (or -fpic), as the error message said quite explicitly. You seem only to have static netlib libraries: you need dynamic ones if you installed these from a binary package. However, '/apps/netcdf/4.0.1/gcc/lib'

Re: [R] Transfer R workspace on another PC

2010-03-10 Thread Eleni Christodoulou
Hi all and thanks for your answers. It is my first attempt to do this kind of transfer and oth machines are 32 bit. The size of my data is 92,3 Mb and I did not try to restart. However, Steve you are right, I have not installed the same packages in both computers. Moreoer, I have not used the

[R] Odp: Transfer R workspace on another PC

2010-03-10 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.03.2010 22:44:31: Hi list! I have recently tried to take my office work home, meaning that I tried to transfer my ... .RData workspace from my PC on my laptop. The office PC runs on Windows XP and my laptop runs on Windows Vista. I have

[R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-10 Thread Johannes Graumann
Hello, I'd like to sitch to a monochrome/bw color-palette for the filling of geom_bar-bars (produced via qplot as in the example below). Hours of googling didn't yield anything useful, so I thought, I'd just ask ... Thanks, Joh library(ggplot2) qplot(factor(cyl), data=mtcars, geom=bar,

[R] cut.POSIXt misconception/feature/bug?

2010-03-10 Thread Petr PIKAL
Dear all recently I tried to split vector of dates according to some particular date to 2 (more) chunks, but I was not able to perform correct setting. When I want split to 3 chunks it partially works however from help page I supposed to get result without NA. Details: Using both ‘right

Re: [R] using near-zero probabilities in optimization

2010-03-10 Thread Benedikt Gehr, Institut für Evolutionsbiologie und Umweltwissenschaften
Dear Ben I haven't looked at the profiles yet, I'm not sure how to. I'm doing population reconstruction from age-at-harvest data. I'm using a multinomial distribution to model the observed harvest numbers. But I didn't know about the Dirichlet-Multinomial so far. I think that might really be a

[R] write.fortran

2010-03-10 Thread baptiste auguie
Dear all, I'm trying to write tabular data to a text file, these data will be the input of a Fortran program. The format needs to be (i7,2x,7(e15.7,2x)). I have not been able to find a clean way of producing this output with write.table. I searched for a write.fortran function similar to

Re: [R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-10 Thread baptiste auguie
Hi, last_plot() + scale_fill_grey() should do it HTH, baptiste On 10 March 2010 09:46, Johannes Graumann johannes_graum...@web.de wrote: Hello, I'd like to sitch to a monochrome/bw color-palette for the filling of geom_bar-bars (produced via qplot as in the example below). Hours of

Re: [R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-10 Thread Johannes Graumann
Indeed. Thank you. Is there a global switch analogous to theme_set(theme_bw())? thanks for your help, Joh On Wednesday 10 March 2010 10:29:05 baptiste auguie wrote: Hi, last_plot() + scale_fill_grey() should do it HTH, baptiste On 10 March 2010 09:46, Johannes Graumann

Re: [R] Transfer R workspace on another PC

2010-03-10 Thread Eleni Christodoulou
It worked with the installation of the proper packages!!! Thanks a lot! Eleni On Wed, Mar 10, 2010 at 10:48 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi r-help-boun...@r-project.org napsal dne 09.03.2010 22:44:31: Hi list! I have recently tried to take my office work home, meaning

Re: [R] Executable for Production Use

2010-03-10 Thread Erich Neuwirth
On Windows, you also could consider installing a statconnDCOM server on one Windows machine and have the users access this server (e.g. from within Excel). You would need to set up the correct (D)COM configuration, which is not trivial. On 3/9/2010 8:24 PM, Uwe Ligges wrote: On 08.03.2010

[R] Tinn-R RGui Send problem

2010-03-10 Thread Rubén Roa
ComRades, On a recent Windows XP system that I have to use at work, I installed Tinn-R 2.3.4.4 and R 2.10.1 When I mark-select a piece of code, say summary(x) written in Tinn-R and send it to the RGui using the send button, the RGui console instead of showing me my piece of code, it shows

Re: [R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-10 Thread baptiste auguie
not with the theme, as far as I know, but you can do: set_default_scale(fill, discrete,grey) baptiste On 10 March 2010 10:31, Johannes Graumann johannes_graum...@web.de wrote: Indeed. Thank you. Is there a global switch analogous to theme_set(theme_bw())? thanks for your help, Joh On

[R] Dealing with an argument missing in ...

2010-03-10 Thread Christophe Genolini
Hi the list I define a S3 function that can have a various number of argument using '...' When some arguments are missing, I would like to give them some default value: func.numeric - function(x,...){ if(missing(y)){y-3} } But it does not works... I precise that I can not put 'y'

Re: [R] Dealing with an argument missing in ...

2010-03-10 Thread Achim Zeileis
On Wed, 10 Mar 2010, Christophe Genolini wrote: Hi the list I define a S3 function that can have a various number of argument using '...' When some arguments are missing, I would like to give them some default value: func.numeric - function(x,...){ if(missing(y)){y-3} } But it does not

[R] see the example and help me

2010-03-10 Thread chinna
sample report data that i want to forecast quarter quarter_index Revenue 2007 Q1 1 $3,856,799 2007 Q2 2 $4,243,328 2007 Q3 3 $4,930,369 2007 Q4 4 $5,443,579 2008 Q1

Re: [R] r code to generate interaction columns

2010-03-10 Thread Martin Maechler
k == kMan kchambe...@gmail.com on Tue, 9 Mar 2010 19:52:40 -0700 writes: k Dear Dhruv, Your clarification helps, and I'm k stumped. Sorry I cannot be of more help. k Sincerely, KeithC. I'd say *The* answer is to use model.matrix() This allows to use R's powerful model

Re: [R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-10 Thread Johannes Graumann
Works. Thank you! Joh On Wednesday 10 March 2010 11:13:09 you wrote: not with the theme, as far as I know, but you can do: set_default_scale(fill, discrete,grey) baptiste On 10 March 2010 10:31, Johannes Graumann johannes_graum...@web.de wrote: Indeed. Thank you. Is there a global

Re: [R] see the example and help me

2010-03-10 Thread Peter Konings
Sure. Say your sample data is a dataframe called sampledata: sampledata$revenuePredictor - 4032525 You might want to use a different model to predict revenue, though. On Wed, Mar 10, 2010 at 11:59 AM, chinna durgache...@gmail.com wrote: sample report data that i want to forecast quarter

Re: [R] Help with aggregate and cor

2010-03-10 Thread Gabor Grothendieck
The sqldf package can be used to manipulate R data frames with SQL statements. See http://sqldf.googlecode.com On Tue, Mar 9, 2010 at 9:36 PM, James Marca jma...@translab.its.uci.edu wrote: Hello, I do not understand the correct way to approach the following problem in R. I have

[R] Displaying political boundaries

2010-03-10 Thread Arlindo Meque
  Dear all,      I am new in the R environment. How can I enable political boundaries in R? I want plot a variable (e.g., temperature) only for Mozambique.    Sincerely,   Arlindo       Arlindo Veja

Re: [R] write.fortran

2010-03-10 Thread Berend Hasselman
baptiste auguie-5 wrote: I'm trying to write tabular data to a text file, these data will be the input of a Fortran program. The format needs to be (i7,2x,7(e15.7,2x)). I have not been able to find a clean way of producing this output with write.table. I searched for a write.fortran

[R] Joining elements of an array into a single element

2010-03-10 Thread vega_l
Dear forum: I've been trying like for hours but I cannot solve this. I wonder if you could give me a hand. I would like to combine the following elements of an array which I must generate in order to get the syntax I need for another software, lets say: c-c(1:7) zest-c(12,34,45,132,56,23,6)

Re: [R] write.fortran

2010-03-10 Thread Berend Hasselman
baptiste auguie-5 wrote: This is a lot easier for(k in seq(1,nrow(m))){cat(c(sprintf(%7d,m[k,1]),sprintf(%16.7e,m[k,2:8]),\n)) Berend Oops. Missing sep= and closing }. The correct line is for(k in seq(1,nrow(m))){cat(c(sprintf(%7d,m[k,1]),sprintf(%16.7e,m[k,2:8]),\n),sep=)}

Re: [R] Scripts from The Elements of Statistical Learning book

2010-03-10 Thread Gavin Simpson
On Tue, 2010-03-09 at 15:59 -0800, mramon wrote: Anyone know if it is possible to get the R scripts used in the The Elements of Statistical Learning book? It is a great book but sometimes some help would be useful to replicate the results presented in the book and so, understood things

Re: [R] Joining elements of an array into a single element

2010-03-10 Thread Miguel Porto
Hello, If you do this after the for loop, you'll get what you want: paste(tre,collapse=) (you can use whatever separator you want in the collapse argument) But you don't even need the for loop, just do this instead of the for loop: paste(con(,p, == ,c,, ,zest,, ,sep=,collapse=) Best, Miguel

Re: [R] Dealing with an argument missing in ...

2010-03-10 Thread Gavin Simpson
On Wed, 2010-03-10 at 11:28 +0100, Christophe Genolini wrote: Hi the list I define a S3 function that can have a various number of argument using '...' When some arguments are missing, I would like to give them some default value: func.numeric - function(x,...){

Re: [R] using sprintf to pass a variable to a RMySQL query

2010-03-10 Thread Gabor Grothendieck
There is likely something wrong with your R installation. tcltk is a recommended package and normally comes bundled with R. You should not have to install it separately. Try reinstalling R. Alternately, try the older version of gsubfn at:

Re: [R] Dealing with an argument missing in ...

2010-03-10 Thread David Winsemius
On Mar 10, 2010, at 5:43 AM, Achim Zeileis wrote: On Wed, 10 Mar 2010, Christophe Genolini wrote: Hi the list I define a S3 function that can have a various number of argument using '...' When some arguments are missing, I would like to give them some default value: func.numeric -

[R] ordering columns in a data frame

2010-03-10 Thread Newbie19_02
Dear R users, I have the following data frame: PROCHIdate_admission 2 CAO713 1999-12-11 4 CAO713 1999-10-25 21 CAO0001743 1989-05-04 25 CAO0001743 1996-09-12 26 CAO0001743 1989-05-17 27 CAO0001743 1987-09-17 28 CAO0001743 1987-09-19

[R] passing a function as an argument using lazy loading

2010-03-10 Thread Mark Heckmann
I have the following function that makes use of lazy loading. foo - function(x=2*y, y=x/2) cat(x,y) Now I want to be able to modify it like below: foo(y=x/3) Of course, this does not work as the object x is not known. Still I would like to be able to pass a function as an argument that is

Re: [R] Extract values of a two-factor table and duplicate them into a three-factor table

2010-03-10 Thread Ista Zahn
Hi Melanie, I think you just need merge(TABLE1, TABLE2) see ?merge for details. -Ista On Wed, Mar 10, 2010 at 12:47 AM, Melanie HAMEL melanie.ha...@ird.fr wrote: Dear all, I would like to solve a trivial problem (I guess it is) but can't find the right way. Maybe someone can help me ?

Re: [R] ordering columns in a data frame

2010-03-10 Thread David Freedman
I'm not sure what's incorrect about your result, but the following works: d=data.frame(a=sample(letters[1:5],10,rep=T),b=rnorm(10),c=sample(1:10,10)); d d[order(d$a,d$c),] or, you can use orderBy: lib(doBy) orderBy(~a+b,data=d) #use a - sign to sort in descending sequence Did you leave off the

Re: [R] write.fortran

2010-03-10 Thread baptiste auguie
Thanks, it is indeed a bit cleaner. I was hoping for a more generic solution but I guess people use cat() and sprintf() in such cases. Thanks, baptiste On 10 March 2010 12:46, Berend Hasselman b...@xs4all.nl wrote: baptiste auguie-5 wrote: This is a lot easier  for(k in

Re: [R] see the example and help me

2010-03-10 Thread chinna
Hi, can u please elaborate your answer. using the first report i have to generate second report for the year 2010 quarterly forecasted results. Thanks in advance. -- View this message in context: http://n4.nabble.com/see-the-example-and-help-me-tp1587229p1587386.html Sent from the R help

Re: [R] speed

2010-03-10 Thread jim holtman
Hard to say. You might want to run a profile of each set of code and see where it is spending its time. It looks like from the R code that they are using vectorized operations and depending on how some of them are implemented, they might be calling C code to do most of the work. With the proper

Re: [R] Displaying political boundaries

2010-03-10 Thread Corey Sparks
You probably need a shapefile, or other geographic representation for the administrative boundaries, you can find a shapefile here: http://www.maplibrary.org/stacks/Africa/Mozambique/index.php?language=german use the readShapePoly () function in the maptools library to read it in, and spplot in

Re: [R] write.fortran

2010-03-10 Thread Gabor Grothendieck
Try this. It takes a matrix or data.frame, codes= which is a vector of % codes and other text and file= and other cat arguments. If no ... args are given it outputs the character string that it would have handed to cat. write.mat - function(mat, codes, sep = , ...) { s - do.call(sprintf,

[R] expression(), mixed symbols and evaluated objects

2010-03-10 Thread Markus Loecher
Is it possible to mix symbols and evaluated objects inside the expression() function ? The following example shows what I am trying to achieve: for (m in 1:3) { plot(1:10); #just a place holder for the real plots title(expression(y = m * lambda)); } I want to actually evaluate the

[R] ggplot2: varwidth-equivalent for geom_boxplot?

2010-03-10 Thread Johannes Graumann
Hi, Is there such a thing? If no: is it easily simulated? thanks, Joh __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented,

Re: [R] ggplot2 rose diagram

2010-03-10 Thread Tim Howard
To answer two of my own questions to get them into the archives (I am slowly getting the hang of ggplot): Q1. use opts(axis.text.x = theme_text(size=xx)) to change font size of the bar labels: library(ggplot2) set.seed(5) dat - sample(1:8,100,replace=TRUE) smp - ggplot(data.frame(dat),

Re: [R] write.fortran

2010-03-10 Thread baptiste auguie
That's perfect, thanks! baptiste On 10 March 2010 14:47, Gabor Grothendieck ggrothendi...@gmail.com wrote: Try this.  It takes a matrix or data.frame, codes= which is a vector of % codes and other text and file= and other cat arguments.  If no ... args are given it outputs the character

Re: [R] expression(), mixed symbols and evaluated objects

2010-03-10 Thread Duncan Murdoch
On 10/03/2010 8:52 AM, Markus Loecher wrote: Is it possible to mix symbols and evaluated objects inside the expression() function ? The following example shows what I am trying to achieve: for (m in 1:3) { plot(1:10); #just a place holder for the real plots title(expression(y = m *

Re: [R] ggplot2 rose diagram

2010-03-10 Thread hadley wickham
For Q2 you can use opts(legend.position = c(0.9, 0.9)). For Q3, you can also use scale_y_sqrt(). Hadley On Wed, Mar 10, 2010 at 2:05 PM, Tim Howard tghow...@gw.dec.state.ny.us wrote: To answer two of my own questions to get them into the archives (I am slowly getting the hang of ggplot):

Re: [R] Installing mgarch package for Mac

2010-03-10 Thread Marc Schwartz
On Mar 10, 2010, at 1:38 AM, mjlee818 wrote: Hi, I am a novice in R. I would like to use a package called mgarch, but I have trouble installing it. It is not available on CRAN servers. I downloaded the tar.gz file online. (mgarch_0.00-1.tar.gz) I have tried to install it using the

Re: [R] ordering columns in a data frame

2010-03-10 Thread Newbie19_02
Thanks David. Leaving off the tilde was the problem. -- View this message in context: http://n4.nabble.com/ordering-columns-in-a-data-frame-tp1587294p1587491.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] Placing the legend 'dynamically'

2010-03-10 Thread T . Wunder
Hello, does anybody know which command to consider when I'm trying to plot a stacked barplot with a legend at the most empty portion of the graphic? I've searched for it, and somebody stated to use the labcurve-command, but I don't know how to produce stacked barplots with it. Is there any

Re: [R] Odp: Loop overwrite and data output problems

2010-03-10 Thread RCulloch
Hi Petr, Thanks again for your post the problem is now solved - thank you so much for trying and trying to get this to work. So the final script that actually worked was: ##ALL SUBSET DATA #Create vector to put data in mod - vector(1000,mode=list) #first order your data according to ID2

Re: [R] r code to generate interaction columns

2010-03-10 Thread Sharma, Dhruv
Thanks Martin for the lead. A new avenue to explore. Dhruv -Original Message- From: Martin Maechler [mailto:maech...@stat.math.ethz.ch] Sent: Wednesday, March 10, 2010 6:18 AM To: kMan Cc: Sharma, Dhruv; r-help@r-project.org Subject: Re: [R] r code to generate interaction columns k

Re: [R] Placing the legend 'dynamically'

2010-03-10 Thread Eik Vettorazzi
Hi tom, have a look at the emptyspace-function from the plotrix package. Looks like it does what you want?! Hth. t.wun...@stud.uni-heidelberg.de schrieb: Hello, does anybody know which command to consider when I'm trying to plot a stacked barplot with a legend at the most empty portion of

Re: [R] speed

2010-03-10 Thread Matthew Dowle
Your choice of subject line alone shows some people that you missed some small details from the posting guide. The ability to notice small details may be important for you to demonstrate in future. Any answer in this thread is unlikely to be found by a topic search on subject lines alone

Re: [R] cut.POSIXt misconception/feature/bug?

2010-03-10 Thread jim holtman
In the first case you did not look far enough into the data: dat - seq(c(ISOdate(2000,3,20)), by = day, length.out = 60) br-dat[c(23, 42)] cut(dat, breaks=br, right=T, include.lowest=T) [1] NANANA NANANA [7] NANA

Re: [R] ggplot2: varwidth-equivalent for geom_boxplot?

2010-03-10 Thread Johannes Graumann
Apologies. from the boxplot documentation: ... if varwidth is TRUE, the boxes are drawn with widths proportional to the square-roots of the number of observations in the groups. I find this option often very useful. Thanks for any insight into how to achieve this with geom_boxplot. Joh On

[R] nested subset for a dataframe

2010-03-10 Thread arnaud chozo
Hi, I've a beginner question. I'm trying to extract data in my dataframe according to some nested rules. I have something like the dataframe test.df: test.df = data.frame(V1=c(rep(A,10), rep(B,10), rep(C,5)), V2=c(rep(1,5), rep(2,5), rep(1,5), rep(2,5), rep(1,5))) V1 V2 1 A 1 2 A 1 3

[R] trouble calculating rates--sometimes the denominator is missing

2010-03-10 Thread Christopher W. Ryan
Every day I get a csv file containing the names of the 64 schools in our county, the number of students sent home ill, and the number of students absent (plus lots of other variables). The file is cumulative since fall of 2009. It is in long format: one line per school per day. Each line is

Re: [R] Random Forest

2010-03-10 Thread Dror
Hi, Thank you for your replies as for the prediction length, i run this code: library(arules) data(AdultUCI) AdultUCI$workclass-factor(AdultUCI$workclass, levels = c(levels(AdultUCI$workclass), UNKNOWN)) AdultUCI$workclass[is.na(AdultUCI$workclass)]-UNKNOWN

[R] How to sum a list of matrices ?

2010-03-10 Thread Carlos Petti
Dear list, I have a list of three matrices : i = list(matrix(1:4,2,2), matrix(3:6,2,2), matrix(9:12,2,2)) I would like to sum the matrices, as follows : [,1] [,2] [1,] 13 19 [2,] 16 22 I used this code : k - i[[1]] for (j in (2:length(i))) { k - k + i[[j]]} But, is it possible to sum

[R] trouble calculating rates--sometimes the denominator is missing

2010-03-10 Thread Christopher W. Ryan
One more bit: I got as far as this, thinking it might help: Using a data file that I know has all the necessary denominators, I created a dataframe of school names (as factor) and TotalStudentsEnrolled. data.frame(data$School[!duplicated(data$School)],

Re: [R] How to sum a list of matrices ?

2010-03-10 Thread Alain Guillet
Hi, Look at the R News 8/1 in the R Help Desk. Alain On 10-Mar-10 16:34, Carlos Petti wrote: Dear list, I have a list of three matrices : i = list(matrix(1:4,2,2), matrix(3:6,2,2), matrix(9:12,2,2)) I would like to sum the matrices, as follows : [,1] [,2] [1,] 13 19 [2,] 16 22 I used

Re: [R] nested subset for a dataframe

2010-03-10 Thread David Winsemius
On Mar 10, 2010, at 10:30 AM, arnaud chozo wrote: Hi, I've a beginner question. I'm trying to extract data in my dataframe according to some nested rules. I have something like the dataframe test.df: test.df = data.frame(V1=c(rep(A,10), rep(B,10), rep(C,5)), V2=c(rep(1,5), rep(2,5),

Re: [R] How to sum a list of matrices ?

2010-03-10 Thread David Winsemius
On Mar 10, 2010, at 10:34 AM, Carlos Petti wrote: Dear list, I have a list of three matrices : i = list(matrix(1:4,2,2), matrix(3:6,2,2), matrix(9:12,2,2)) I would like to sum the matrices, as follows : [,1] [,2] [1,] 13 19 [2,] 16 22 Reduce(+, i) [,1] [,2] [1,] 13 19 [2,] 16

Re: [R] Fine Tuning Plotrix

2010-03-10 Thread Lorenzo Isella
Hi Jim, And thanks for helping. My (hopefully) last question concerns the use of a non-gray color scale. How do I use e.g. a rainbow colorscale? This issue has already been raised http://tinyurl.com/ylhcbra and over there it is dealt with by hand. I just wonder whether anything similar is

Re: [R] Fine Tuning Plotrix

2010-03-10 Thread Lorenzo Isella
Apologies for the previous email, I think I got it sorted out now. Lorenzo rm(list=ls()) library(Cairo) set.seed(1234) trivial_matrix-matrix(rnorm(25),nrow=5) CairoPDF(matrix2D.pdf) oldpar-par( mar = c(4.5,5, 2, 1) + 0.1, cex.axis=1.4,cex.lab=1.6,cex.main=1.6)

[R] ifelse logic and multiple assignments

2010-03-10 Thread David Young
I'm a fairly new R user and while I have a solution to my problem I'm wondering if there is a better one. In SAS it's common to use if/then logic along with a do statement to make several things happen. While I could do the same thing in R using a for loop, and if and {}, I've read that loops

[R] R Graphic output files on Solaris 5.10

2010-03-10 Thread Alex Bryant
Hello Folks, I have a need to generate Graphic output files (gif, jpeg, pdf, etc..) on a Solaris Environment, however this environment does not have X11 setup and setting up X11 would be a last resort if required. I have attempted to install GDD and Cairo without success up to this point. Is

[R] function to create multiple matrices

2010-03-10 Thread Lanna Jin
Hi All, If given a dataframe (long form) with Year, Species, and Location, How would I write a function that would create a unique matrix of Species Location for each Year? What I've tried doing is the following: data #dataframe dataT-table(data$Species,data$Location,data$Year) #creates tables

Re: [R] trouble calculating rates--sometimes the denominator is missing

2010-03-10 Thread jim holtman
Here is how you can do the lookup: # lookup up the school lkup - read.table(textConnection(1'BENJAMIN FRANKLIN ES' 465 + 2'CALVIN COOLIDGE SCHL'379 + 3'EAST MS' 590 + 4'HORACE MANN SCHL'374 + 5'MAC ARTHUR SCHL'

Re: [R] function to create multiple matrices

2010-03-10 Thread jim holtman
Is this what you want: yrData - data.frame(year=sample(1990:2000, 100, TRUE), + species=sample(1:3,100,TRUE), loc=sample(1:2,100,TRUE)) byYear - split(yrData, yrData$year) byYear[1:3] $`1990` year species loc 39 1990 3 2 57 1990 3 1 62 1990 1 1 68 1990 2

Re: [R] ifelse logic and multiple assignments

2010-03-10 Thread David Winsemius
On Mar 10, 2010, at 11:47 AM, David Young wrote: I'm a fairly new R user and while I have a solution to my problem I'm wondering if there is a better one. In SAS it's common to use if/then logic along with a do statement to make several things happen. While I could do the same thing in R

Re: [R] Help with ANOVA in R

2010-03-10 Thread Vokey, John
Your line of code: zzz.aov - aov(Intensity ~ Group + Error(Sample), data = zzzanova) indicates that you are trying to do a repeated measures ANOVA, not just an ANOVA. The Error(Sample) term in your expression indicates that Sample is a within subjects factor, which I presume is not the

Re: [R] Random Forest

2010-03-10 Thread Liaw, Andy
Thanks for providing the code that allows me to reproduce the problem. It looks like the prediction routine for some reason returns 0 as prediction for some trees, thus causing the problem observed. I'll look into it. Andy From: Dror Hi, Thank you for your replies as for the prediction

Re: [R] ifelse logic and multiple assignments

2010-03-10 Thread Bert Gunter
David: The best advice I can give is: read An Introduction to R carefully, taking particular note of the examples and the ideas of vectorization, factors, lists, etc The bottom line is: yes, you can mimic the way SAS or other ancient procedural languages do things in R (e.g. using nested ifelse()

[R] Using R in a corporate envinronment

2010-03-10 Thread Fernando Henrique Ferraz Pereira da Rosa
Dear r-useRs, After a couple of years in a 'R exile' of sorts, I've recently changed jobs and my current employer (an American multinational in the food manufacturing industry) is much more open than my past employer (which wouldn't even want to hear about anything that didn't begin with SAS...).

[R] Strange result in survey package: svyvar

2010-03-10 Thread Corey Sparks
Hi R users, I'm using the survey package to calculate summary statistics for a large health survey (the Demographic and Health Survey for Honduras, 2006), and when I try to calculate the variances for several variables, I get negative numbers. I thought it may be my data, so I ran the example on

Re: [R] Strange result in survey package: svyvar

2010-03-10 Thread Matthew Dowle
This list is the wrong place for that question. The posting guide tells you, in bold, to contact the package maintainer first. If you had already done that, and didn't hear back from him, then you should tell us, so that we know you followed the guide. Corey Sparks corey.spa...@utsa.edu

Re: [R] Strange result in survey package: svyvar

2010-03-10 Thread Corey Sparks
Fair enough. CS - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at' utsa.edu

Re: [R] Using R in a corporate envinronment

2010-03-10 Thread Liviu Andronic
On Wed, Mar 10, 2010 at 6:07 PM, Fernando Henrique Ferraz Pereira da Rosa pess...@fernandohrosa.com.br wrote: reason I'm writing you. If you have any examples (preferably with references) and/or experience in a similar scenario please do write me. I've There is a recent reference in The

Re: [R] Help with aggregate and cor

2010-03-10 Thread James Marca
Hi Ista, Many thanks, the plyr package was just what I needed. Because I did such a bad job with my question (no data, etc etc), here is my current solution: First, I grabbed my data from PostgreSQL as follows: library('RPostgreSQL') m - dbDriver(PostgreSQL) con -

Re: [R] ggplot2 rose diagram

2010-03-10 Thread Tim Howard
Hadley, Thanks for chiming in. By Q2 I was trying to refer to the Y-axis labels. For the polar plot, the Y-axis labels reside left of the panel. I was looking for a way to get the Y-axis labels to radiate out from the center so it would be clear which line each label refers to. I still can't

Re: [R] Using R in a corporate envinronment

2010-03-10 Thread David M Smith
If you're looking for business and technical justifications for a business to adopt R, I wrote some up last year: http://blog.revolution-computing.com/2009/02/how-to-get-it-to-accept-and-love-r.html In summary: R is mainstream R is supported R is high-quality R leads commercial packages in

Re: [R] sorting data whilst ignoring NA's

2010-03-10 Thread emwater
Thanks for these suggestions. I tried them out and I get the error message: Error in qdata$flow : $ operator is invalid for atomic vectors Can anyone offer further suggestions on how to extract the values from atomic vectors? Thanks again Emma -- View this message in context:

Re: [R] Help with aggregate and cor

2010-03-10 Thread hvollmeier
James, you may post your question to the R-SIG finance group with a small example. If I understand your problem correctly it's like converting tick data of financial time series into aggregates. (to 1-minute, hourly, daily ... data sets ). There are packages available for this kind of task

Re: [R] using sprintf to pass a variable to a RMySQL query

2010-03-10 Thread alison waller
Thanks Gabor, As I said I would like to use gsubfn, but I am having problems installing it, which I assume are due to some conflict with the current tcltk package Below is the error I got after issuing install.packages(gsubfn) Any advice? ### * Installing *source* package

Re: [R] Scripts from The Elements of Statistical Learning book

2010-03-10 Thread mramon
Thank you Gavin for your help. David, maybe I am not so clear on my question, sorry. My problem was that when I wanted to reproduce results (or graphs) present in the book, sometimes my results were quite different or I don not know how to repuduce them. I will have a look to the documentation

[R] Forecasting with Panel Data

2010-03-10 Thread Ricardo Gonçalves Silva
Dear Users, Can I perform panel data (fixed effects model) out of sample forecasts using R? Thanks in advance, Ricardo. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Obtaining the true aspect ratio for a lattice plot

2010-03-10 Thread Ryan Hafen
Thanks much - very nice. I hadn't thought of that approach. I dug around in the lattice source and found another way to do it so for what it's worth, I'll post it - maybe it will be useful to someone. Basically, I made a function from code found in plot.trellis() that gets the grid

Re: [R] Deltas or changes

2010-03-10 Thread ManInMoon
Hi, I am new to R. What does a negative amount in an index do? i.e. x[-lenght[x]] -- View this message in context: http://n4.nabble.com/Deltas-or-changes-tp1585960p1587408.html Sent from the R help mailing list archive at Nabble.com. __

[R] ifelse logic and multiple assignments

2010-03-10 Thread David Young
I'm a fairly new R user and while I have a solution to my problem I'm wondering if there is a better one. In SAS it's common to use if/then logic along with a do statement to make several things happen. While I could do the same thing in R using a for loop, and if and {}, I've read that loops

Re: [R] Scripts from The Elements of Statistical Learning book

2010-03-10 Thread Ralf B
If you are interested in machine learning in general, you might also want to have a look at the CRAN Task View on Machine Learning Statistical Learning that contains this package, as well as others: http://cran.r-project.org/web/views/MachineLearning.html Best, --- Ralf Bierig Post-Doctoral

Re: [R] Deltas or changes

2010-03-10 Thread Ista Zahn
Please learn to Read The Fine Manual: ?[ will give you the answer. -Ista On Wed, Mar 10, 2010 at 8:43 AM, ManInMoon xmoon2...@googlemail.com wrote: Hi, I am new to R. What does a negative amount in an index do? i.e. x[-lenght[x]] -- View this message in context:

Re: [R] ggplot2 rose diagram

2010-03-10 Thread hadley wickham
By Q2 I was trying to refer to the Y-axis labels. For the polar plot, the Y-axis labels reside left of the panel. I was looking for a way to get the Y-axis labels to radiate out from the center so it would be clear which line each label refers to. I still can't find any reference to moving

Re: [R] cut.POSIXt misconception/feature/bug?

2010-03-10 Thread Brian Diggs
On 3/10/2010 1:01 AM, Petr PIKAL wrote: Dear all recently I tried to split vector of dates according to some particular date to 2 (more) chunks, but I was not able to perform correct setting. When I want split to 3 chunks it partially works however from help page I supposed to get result

Re: [R] sorting data whilst ignoring NA's

2010-03-10 Thread William Dunlap
Peter's suggestion qdata[order(qdata$flow, decreasing=TRUE), ] would work if qdata were a data.frame, where the $column syntax picks out a column. You probably have a matrix so use [,flow] instead of $flow to extract the column called flow. qdata[order(qdata[,flow], decreasing=TRUE), ] (Both

Re: [R] Help with aggregate and cor

2010-03-10 Thread hadley wickham
Run that function hourly with plyr output.hourly - dlply(df.i1,tshour,cor.dat) Why not output.hourly - ddply(df.i1,tshour,cor.dat) ? Generally you want to work with data frames in R, if at all possible. Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics

Re: [R] ggplot2 rose diagram

2010-03-10 Thread Tim Howard
Got it. Thanks again so much for the help. Best, Tim hadley wickham h.wick...@gmail.com 3/10/2010 2:46 PM By Q2 I was trying to refer to the Y-axis labels. For the polar plot, the Y-axis labels reside left of the panel. I was looking for a way to get the Y-axis labels to radiate out

Re: [R] help R non-parametric IRT simulation

2010-03-10 Thread Helen Lisman
Hello R, I am looking for non-parametric simulation in IRT. Is there any IRT package that does non-parametric simulation? helen L [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] help R non-parametric IRT simulation

2010-03-10 Thread Doran, Harold
There is no function in R AFAIK, where an IRT model is estimated using the NPMML method (non-parametric marginal maximum likelihood). All MML methods in R assume the population distribution is normal. Now, the jml function in the MiscPsycho package uses joint maximum likelihood for estimating

Re: [R] Deltas or changes

2010-03-10 Thread Kevin E. Thorpe
ManInMoon wrote: Hi, I am new to R. What does a negative amount in an index do? i.e. x[-lenght[x]] Why don't you try it and see for yourself? -- Kevin E. Thorpe Biostatistician/Trialist, Knowledge Translation Program Assistant Professor, Dalla Lana School of Public Health University of

  1   2   >