Re: [R] Extracting a column name in loop?

2009-07-08 Thread Moshe Olshansky
If df is your dataframe then names(df) contains the column names and so names(df)[i] is the name of i-th column. --- On Thu, 9/7/09, mister_bluesman wrote: > From: mister_bluesman > Subject: [R] Extracting a column name in loop? > To: r-help@r-project.org > Received: Thursday, 9 July, 2009,

Re: [R] bigglm() results different from glm()+Another question

2009-07-08 Thread utkarshsinghal
That was definitely helpful. "if you change your seq to: seq(chunksize, 1-chunksize, chunksize) then you won't get the error messages" Even previously, I was not getting any error messages or warnings at all, i.e., "update" removes the extra NA rows silently, for example: set.seed(1) xx =

Re: [R] Population pyramids

2009-07-08 Thread Victor Manuel Garcia Guerrero
Yes the code is the next: par(mfrow=c(1,2),bty="n",mai=c(0.5, 0.25, 0.25, 0.25)) barplot(height=t(icNM2005.dat), width = 0.825, space = NULL, names.arg = NULL, legend.text = NULL, beside = FALSE, horiz = TRUE, density = NULL, angle = 0, col = c("yellow","Blue","orange"), b

Re: [R] RDCOMClient: how to close Excel process?

2009-07-08 Thread Lauri Nikkinen
Thanks again. That did not work either. I get > library(RDCOMClient) > xl <- COMCreate("Excel.Application") > wk <- xl$Workbooks() > sh <- wk$Open(normalizePath("sample_file.xls"))$Sheets()$Count() > > wk$Close() [1] TRUE > xl$Quit() NULL > and there is still Excel process open in the Task manag

Re: [R] Population pyramids

2009-07-08 Thread Daniel Malter
Can you provide a self-contained example of what you did so far (i.e. code for simulating some data and code for the plot)? That would greatly help to help you find a solution. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht---

Re: [R] Population pyramids

2009-07-08 Thread Victor Manuel Garcia Guerrero
Yes, but my issue is because I need to plot a pop pyramid with confidence intervals, and the pyramid function does not work in that way. Thanks Daniel. -Mensaje original- De: Daniel Malter [mailto:dan...@umd.edu] Enviado el: mié 08/07/2009 11:36 Para: Victor Manuel Garcia Guerrero; r-hel

[R] Converting indices of a matrix subset

2009-07-08 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have two matrices: > m1 <- matrix(1,4,4) > m1 [,1] [,2] [,3] [,4] [1,]1111 [2,]1111 [3,]1111 [4,]1111 > m2 <- matrix(0,3,3) > diag(m2) <- 1 > m2 [,1] [,2] [,3] [1,]10

Re: [R] Population pyramids

2009-07-08 Thread Victor Manuel Garcia Guerrero
Thanks Jorge, this is a very good library, but I have been trying with barplot because I am doing population pyramids with confidence intervals. So, the pyramid function does not work with more than two colum matrix. -Mensaje original- De: Jorge Ivan Velez [mailto:jorgeivanve...@gmail.c

Re: [R] Population pyramids

2009-07-08 Thread Daniel Malter
have you tried the pyramid function in the epicalc package? best, daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Victor Manuel Garcia

Re: [R] Population pyramids

2009-07-08 Thread Jorge Ivan Velez
Hi Victor, See http://bm2.genes.nig.ac.jp/RGM2/R_current/library/plotrix/man/pyramid.plot.html HTH, Jorge On Thu, Jul 9, 2009 at 12:24 AM, Victor Manuel Garcia Guerrero < vmgar...@colmex.mx> wrote: > Hi, I hope s

[R] Population pyramids

2009-07-08 Thread Victor Manuel Garcia Guerrero
Hi, I hope somebody can help me with this issue: I am doing population pyramids using the barplot command, so in the left side I have male age structure and in the right side the female age structure. To plot the male age structure I put the data in negative numbers. Now, I want to change the si

[R] Save rgl plot3d Graph as Image

2009-07-08 Thread Patrick Gedeon
Dear Users: I wish to save 3d scatter plots I have generated using the plot3d command in the rgl package. Any image format such as .tiff would work. Can anyone tell me how to do this? Thank you [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
Dear Duncan On my home computer I was able to use install.packages("RGoogleDocs", repos = "http://www.omegahat.org/R";) But, alas it would not read the data in the spreadsheet. It went back to its nasty ways Error in !includeEmpty : invalid argument type That is what I was getting with version 0

Re: [R] R Help Question

2009-07-08 Thread Gabor Grothendieck
You could try something like this: library(sqldf) DF <- read.csv.sql("myfile.txt", sep = "|", header = FALSE) or possibly this, which is the same except instead of using an "in memory" database it uses an external database: DF <- read.csv.sql("myfile.txt", sep = "|", header = FALSE, dbname = "te

[R] splint

2009-07-08 Thread jlfmssm
I am trying to understand idea for splint, but it use Fortran code. Does anyone know how to see that Fortran code? Is splint a not-knot spline method? Thanks, jfm [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] R regular expression to extract words with the query string.

2009-07-08 Thread Gabor Grothendieck
The solution below does not include the pid: string before it. This modification works: > strapply(i, paste("[^ ]*", "ENSP", "[^ ]*", sep = ""), c, simplify = unlist) [1] "pid:ENSP12345" On Wed, Jul 8, 2009 at 10:08 AM, Gabor Grothendieck wrote: > Try this: > > library(gsubfn) > i <- "transcr

Re: [R] change capital to small letters?

2009-07-08 Thread wapita wapita
ok, find! ?toupper ?tolower sorry!!! (but you have perhaps learned something...) From: wap...@hotmail.com To: r-help@r-project.org Subject: change capital to small letters? Date: Thu, 9 Jul 2009 03:07:35 + Hello R users, I have a string of characters in capital letters and I

[R] change capital to small letters?

2009-07-08 Thread wapita wapita
Hello R users, I have a string of characters in capital letters and I need to convert it in small letters, is there an easy way to do it? Thanks a lot Wapita _ Découvrez toutes les possibilités de communication avec vos

Re: [R] Best way to export values from a function?

2009-07-08 Thread Steve Lianoglou
Hi, On Jul 8, 2009, at 8:34 PM, Jason Rupert wrote: Maybe there is a great website out there or white paper that discusses this but again my Google skills (or lack there of) let me down. I would like to know the best way to export several doubles from a function, where the doubles are

Re: [R] Best way to export values from a function?

2009-07-08 Thread William Revelle
Mark and Jason, At 7:23 PM -0700 7/8/09, Mark Knecht wrote: On Wed, Jul 8, 2009 at 5:55 PM, Mark Knecht wrote: On Wed, Jul 8, 2009 at 5:34 PM, Jason Rupert wrote: Maybe there is a great website out there or white paper that discusses this but again my Google skills (or lack there of) le

Re: [R] Reading from Google Docs

2009-07-08 Thread Duncan Temple Lang
Farrel Buchinsky wrote: > Boy oh boy that process of getting source to binary was super painful. Now that I have the package as binary I can share the whole folder with my coworker and she is able to use RGoogleDocs. I intend to use the same process for the other two windows machines

Re: [R] Substituting numerical values using `apply'

2009-07-08 Thread Henrique Dallazuanna
Try this: sapply(names(DF), function(n)ifelse(DF[,n] %in% c(1, 2), n, NA)) Where DF is your data.frame On Wed, Jul 8, 2009 at 5:25 PM, Olivella wrote: > > Hello, > > I wish to perform a substitution of certain numerical values in a data > matrix with the corresponding column name. For instance

Re: [R] Mysteriously vanishing LD_LIBRARY_PATH

2009-07-08 Thread p_connolly
Quoting Godmar Back : R respects LD_LIBRARY_PATH, see /usr/lib/R/etc/ldpaths where it prepends its own path to any value in the environment when R is invoked: if test -z "${LD_LIBRARY_PATH}"; then LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}" else LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY

Re: [R] Mysteriously vanishing LD_LIBRARY_PATH

2009-07-08 Thread Marc Schwartz
On Jul 8, 2009, at 8:45 PM, p_conno...@slingshot.co.nz wrote: Using R-2.8.0 and R-2.8.1, I get behaviour like this: R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 [] Sys.getenv("LD_LIBRARY_PATH") LD_LIBRARY_PATH "/

Re: [R] Mysteriously vanishing LD_LIBRARY_PATH

2009-07-08 Thread Godmar Back
R respects LD_LIBRARY_PATH, see /usr/lib/R/etc/ldpaths where it prepends its own path to any value in the environment when R is invoked: if test -z "${LD_LIBRARY_PATH}"; then LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}" else LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}" fi export LD_LIBR

Re: [R] Best way to export values from a function?

2009-07-08 Thread Mark Knecht
On Wed, Jul 8, 2009 at 5:55 PM, Mark Knecht wrote: > On Wed, Jul 8, 2009 at 5:34 PM, Jason Rupert wrote: >> >> Maybe there is a great website out there or white paper that discusses this >> but again my Google skills (or lack there of) let me down. >> >> I would like to know the best way to export

[R] Mysteriously vanishing LD_LIBRARY_PATH

2009-07-08 Thread p_connolly
Using R-2.8.0 and R-2.8.1, I get behaviour like this: R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 [] > Sys.getenv("LD_LIBRARY_PATH") LD

Re: [R] \dQuote in packages

2009-07-08 Thread Rebecca Sela
That's good to know. I have attached three Rd files that gave errors (others gave identical errors). I would love to know what is wrong with them. I'm using 2.1.1 because that is what is installed on the Linux computer I have access to. (I haven't bothered figuring out how to assemble a packa

[R] Sampling a dataframe based on the length of a subset of observations within

2009-07-08 Thread Eric Vander Wal
Thank you in advance for your consideration. I have a dataframe of 2000+ observations with repeated measures across approximately 300 unique individuals An event either does or does not happen (1,0) and there is a suit of independent variables associated with the event. A simplified represen

[R] Picante package 0.7 on mac

2009-07-08 Thread Alfonso Rojas
Hello, I tried to run the package but it shows me the following error: In addition: Warning message: package 'picante' was built under R version 2.10.0 Error in library(picante) : .First.lib failed for 'picante' What could I do to run picante in mac R version? ___

[R] Dantzig Selector

2009-07-08 Thread tzygmund mcfarlane
Hi, I was wondering if there was an R package or routines for the Dantzig Selector (Candes & Tao, 2007). I know Emmanuel Candes has Matlab routines to do this but I was wondering if someone had ported those to R. Thanks, T ---Reference--- @article{candes2007dantzig, title={{The Dantzig selec

Re: [R] Best way to export values from a function?

2009-07-08 Thread Mark Knecht
On Wed, Jul 8, 2009 at 5:34 PM, Jason Rupert wrote: > > Maybe there is a great website out there or white paper that discusses this > but again my Google skills (or lack there of) let me down. > > I would like to know the best way to export several doubles from a function, > where the doubles are

Re: [R] Best way to export values from a function?

2009-07-08 Thread Godmar Back
On Wed, Jul 8, 2009 at 8:34 PM, Jason Rupert wrote: > > Maybe there is a great website out there or white paper that discusses this > but again my Google skills (or lack there of) let me down. Yeah, R is difficult to search for - I've had partial success with rseek.org, though. > > I would like

Re: [R] Best way to export values from a function?

2009-07-08 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Jason Rupert > Sent: Wednesday, July 08, 2009 5:35 PM > To: R-help@r-project.org > Subject: [R] Best way to export values from a function? > > > Maybe there is a great website o

Re: [R] Best way to export values from a function?

2009-07-08 Thread jim holtman
You can return a list, vector, or any other object: The last value is the return value unless you do an explicit return() On Wed, Jul 8, 2009 at 8:34 PM, Jason Rupert wrote: > > Maybe there is a great website out there or white paper that discusses this > but again my Google skills (or lack ther

[R] Best way to export values from a function?

2009-07-08 Thread Jason Rupert
Maybe there is a great website out there or white paper that discusses this but again my Google skills (or lack there of) let me down. I would like to know the best way to export several doubles from a function, where the doubles are not an array. Here is a contrived function similar to my n

[R] tkrplot installation problems

2009-07-08 Thread Jason Lessels
Hello, I'm running R 2.8.1 on Ubuntu Hardy. I'm trying to install tkrplot. Using r-cran-tkrplot from the repository, I'm getting the following error: > library(tkrplot) Loading required package: tcltk Loading Tcl/Tk interface ... done Error in structure(.External("dotTcl", ..., PACKAGE = "tcltk")

Re: [R] R Help Question

2009-07-08 Thread jim holtman
How big is the entire text file? What is the length of an average line? Have you tried to use 'scan' to read in the data? How much memory do you have? Are you paging? Here was a quick test I did with a file with about 5M lines (12|this is some text|12345|more test): > system.time(x <- scan('/

Re: [R] nested model with random factors

2009-07-08 Thread Ben Bolker
Jeff DaCosta wrote: > > I am really having trouble with getting the right syntax for my > model. Here is a truncated version of my data: > > > data > Ind Treatment Order DatePC1 > 1 PER14SC 3rd 4-May-09 0.5704611 > 2 PER14SH 1st 26-Apr-09 0.5329025

Re: [R] subsetting a dataframe with a string logical expression

2009-07-08 Thread Henrique Dallazuanna
Try this: subset(x, eval(parse(text=filter))) On Wed, Jul 8, 2009 at 4:46 PM, Tracey Frescino wrote: > Hi, > > I am trying to subset a dataset based on a filter defined by a user... > I prompt the user for input.. resulting in a string logical expression > ("X1 < 3"). > > I have tried using su

Re: [R] Getting value rather than formula in RGoogleDocs

2009-07-08 Thread Duncan Temple Lang
Farrel Buchinsky wrote: Is there an easy way to read the value of the cells rather than the formula?So for instance in a cell whose value was created by simply using the value from the cell immediately to the left in the Google spreadsheet I would prefer to get the value rather than =RC[-1] W

Re: [R] Substituting numerical values using `apply'

2009-07-08 Thread Jorge Ivan Velez
Arggg! Forgot to add "cls" before the code. Here is the (hopefully) complete version: # column names cls <- colnames(x) # Transformation res <- t( apply(x, 1, function(x){ index <- x %in% c(1,2) x[index] <- cls[index]

Re: [R] Substituting numerical values using `apply'

2009-07-08 Thread Jorge Ivan Velez
Dear Olivella, Assuming that x is your data, here is one possible way to do what you want: t( apply(x, 1, function(x){ index <- x %in% c(1,2) x[index] <- cls[index] x[!index] <- NA x

[R] Getting value rather than formula in RGoogleDocs

2009-07-08 Thread Farrel Buchinsky
Is there an easy way to read the value of the cells rather than the formula?So for instance in a cell whose value was created by simply using the value from the cell immediately to the left in the Google spreadsheet I would prefer to get the value rather than =RC[-1] When one exports with Google

Re: [R] Tex fonts in R plots

2009-07-08 Thread Paul Murrell
Hi KARAVASILIS GEORGE wrote: Hello, R users. I would like to display the font of Math Mode of MikTex 2.3, WinEdt 5.4 in R plots, e.g. in xlab, ylab or legend. How can I do that? Thank you in advance. See http://www.stat.auckland.ac.nz/~paul/R/CM/CMR.html and "Non-standard fonts in PostScript

[R] How to deploy statistical models built in R in real-time?

2009-07-08 Thread Guazzelli, Alex
I am framing this as a question since I would like to know how folks are currently deploying the models they build in R. Say, you want to use the results of your model inside another application in real-time or on-demand, how do you do it? How do you use the decisions you get back from your

[R] Substituting numerical values using `apply'

2009-07-08 Thread Olivella
Hello, I wish to perform a substitution of certain numerical values in a data matrix with the corresponding column name. For instance, if I have a data matrix V1 V2 V3 201 012 150 500 I want to substitute the `1' and the `2' for the corresponding column name,

Re: [R] Two-way ANOVA gives different results using anova(lm()) than doing it by hand

2009-07-08 Thread Zhiliang Ma
the following works. i don't exactly what happens here. I guess "lm" might treat S1 and S2 as quantitative variables, not qualitative variables. cheers, Zhiliang S1 <- as.character(Data[,1]) S1 <- as.factor(S1) S2 <- as.character(Data[,2]) S2 <- as.factor(S2) data <- data.frame(S1=S1, S2=S2, ExM=

[R] subsetting a dataframe with a string logical expression

2009-07-08 Thread Tracey Frescino
Hi, I am trying to subset a dataset based on a filter defined by a user... I prompt the user for input.. resulting in a string logical expression ("X1 < 3"). I have tried using subset, but it is looking for a logical expression, not a character string. I keep getting the error: 'subset' must

Re: [R] Unix commands on R

2009-07-08 Thread Zhiliang Ma
?system On Wed, Jul 8, 2009 at 4:36 PM, suman Duvvuru wrote: > I am using R on unix. While in R how do I execute the unix shell commands? > Is there a way to do it? I am executing a function in R and the matrix > resulting from the function has to be passed on as an input to unix command. > > > An

[R] R Help Question

2009-07-08 Thread Amy Wesolowski
Hi, I am currently working on reading large files into R. My files are text documents with four columns and around 10 million lines. Each line is set up as: string|integer|string|integer I have been trying to use read.table to read in the file, but I think I am reading too much into memory and t

[R] A Lattice Question

2009-07-08 Thread Haoda Fu
To the Lattice expert - I am new to the lattice package and I would like to add a curve to the xyplot(). I know that I need to use panel function to add it. But it doesn't work. Is there anyone can help me out on how to transfer the data into the function? The following is my code and I would

Re: [R] \dQuote in packages

2009-07-08 Thread Uwe Ligges
The difference you are experiencing is the new Rd2 parser that is more picky now (but also prevents to produce wrong documentation files). If you make the code of the Rd available, someone might be able to help. Are you really under R-2.1.1 ??? That is really ancient! Best, Uwe Ligges Rebe

Re: [R] R2WinBUGS under Linux/WINE fails

2009-07-08 Thread Uwe Ligges
Harlan Harris wrote: Uwe, thanks for helping! After some poking around, I realized that the problem was that I had installed OpenBUGS instead of WinBUGS. I did an additional installation of WinBUGS, which also runs fine under Wine, and now everything seems to work! Thanks! To clarify: both the

Re: [R] R2WinBUGS under Linux/WINE fails

2009-07-08 Thread Harlan Harris
Uwe, thanks for helping! After some poking around, I realized that the problem was that I had installed OpenBUGS instead of WinBUGS. I did an additional installation of WinBUGS, which also runs fine under Wine, and now everything seems to work! Thanks! To clarify: both the OpenBUGS and WinBUGS dis

[R] truncated regression out-of-sample predictions

2009-07-08 Thread Wouterse, Fleur (IFPRI-Senegal)
Dear all, I am trying to implement Simar & Wilson's (2007) second algorithm and have the following question: If I use a truncated regression on the mmailto:r-help-boun...@r-project.org] On Behalf Of Karina Boege Sent: Wednesday, July 08, 2009 11:18 AM To: r-help@r-project.org Subject: [R] bootstr

Re: [R] how to read point shp file to R?

2009-07-08 Thread Rolf Turner
On 8/07/2009, at 6:28 AM, Sunny wrote: I am new with R and want do some analysis with a point vector data file. Any help is appreciate. Sunny See the vignette ``Handling shapefiles in the spatstat package'' from the spatstat package on CRAN. cheers, Rolf Turne

Re: [R] system() how to make a program run a specific file - RUN and Output directory issues

2009-07-08 Thread Uwe Ligges
Paulo E. Cardoso wrote: I have a particular case where the program I'm calling needs a additional instructions, to click a RUN button and set a output directory. Could these options be controlled with system() function? system() just calls the program as started from the operating system's

Re: [R] Unix commands on R

2009-07-08 Thread Emmanuel Charpentier
Le mercredi 08 juillet 2009 à 16:36 -0400, suman Duvvuru a écrit : > I am using R on unix. While in R how do I execute the unix shell commands? > Is there a way to do it? I am executing a function in R and the matrix > resulting from the function has to be passed on as an input to unix command. >

Re: [R] Unix commands on R

2009-07-08 Thread Godmar Back
?system ?shQuote On Wed, Jul 8, 2009 at 4:36 PM, suman Duvvuru wrote: > I am using R on unix. While in R how do I execute the unix shell commands? > Is there a way to do it? I am executing a function in R and the matrix > resulting from the function has to be passed on as an input to unix command.

Re: [R] R2WinBUGS under Linux/WINE fails

2009-07-08 Thread Uwe Ligges
Harlan Harris wrote: Hi, I'm running wine-1.0.1, OpenBUGS 3.0.3, R 2.9.0, and R2WinBUGS on a Redhat Enterprise Linux machine. Following various peoples' suggestions... This works perfectly (yay!): wine Z:/opt/OpenBUGS/winbugs.exe Within R, however, I get this: (setup the example from ?bugs

[R] rgtk2 colorbutton

2009-07-08 Thread Justin Donaldson
How do you retrieve the color from a GtkColorButton in rgtk2? There seems to be a promising function gtkColorButtonGetColor However, the function doesn't return the current color, instead it *sets* a color that you pass to it. The function header looks like gtkColorButtonGetColor(color_button, c

[R] Unix commands on R

2009-07-08 Thread suman Duvvuru
I am using R on unix. While in R how do I execute the unix shell commands? Is there a way to do it? I am executing a function in R and the matrix resulting from the function has to be passed on as an input to unix command. Any directions will be helpful. Thanks, Suman [[alternative HTML

Re: [R] Reading from Google Docs

2009-07-08 Thread Gabor Grothendieck
No one really knows how many people are being affected. Also one can minimize the impact like this: 1. In Rtools, change find.exe to find2.exe. 2. In R, create a 'find' a variable in any script using find and at the top check for find2 and if found set the find variable to find2 otherwise set it

Re: [R] What is cast telling me?

2009-07-08 Thread Mark Knecht
On Wed, Jul 8, 2009 at 12:58 PM, wrote: > > That you have non-unique rows in your data (as identified by the identifying > variables). > Humm...OK - so I cast it with PL_Pos which has (in this data subset) a unique value for each experiment in this set. there are 25 experiments and there are 25

Re: [R] heatmap.2: question regarding the "raw z-score"

2009-07-08 Thread James W. MacDonald
Hi Chrysanthi, Chrysanthi A. wrote: Hi, I am analysing gene expression data using the heatmap.2 function in R and I was wondering what is the formula of the "raw z-score" bar which shows the colors for each pixel. According to that post: https://mailman.stat.ethz.ch/pipermail/r-help/2006-Septem

Re: [R] What is cast telling me?

2009-07-08 Thread rmailbox
That you have non-unique rows in your data (as identified by the identifying variables). - Original message - From: "Mark Knecht" To: "r-help" Date: Wed, 8 Jul 2009 12:41:28 -0700 Subject: [R] What is cast telling me? Hi, What is cast telling me when it says the following? Aggre

Re: [R] matching each row

2009-07-08 Thread Marc Schwartz
On Jul 8, 2009, at 12:17 PM, tathta wrote: From an email suggestion, here are two sample datasets, and my ideal output: dataA <- data.frame(unique.id=c("A","B","C","B"),x=11:14,y=5:2) dataB <- data .frame(unique.id=c("A","B","A","B","A","C","D","A"),x=27:20,y=22:29) ## mystery operation(

Re: [R] Reading from Google Docs

2009-07-08 Thread Duncan Murdoch
On 7/8/2009 3:39 PM, Gabor Grothendieck wrote: I understand what you wrote. Its just that I don't agree that that is a reasonable solution. What is wanted is something that works safely out of the box, not something with a built in danger that every single person that uses it must fix (and know

[R] What is cast telling me?

2009-07-08 Thread Mark Knecht
Hi, What is cast telling me when it says the following? Aggregation requires fun.aggregate: length used as default What is 'length'? I've taken a small subset of data and wondered what EnTime vs ExTime might look like. cast is kind enough to give me a table but I don't understand the value

[R] nested model with random factors

2009-07-08 Thread Jeff DaCosta
I am really having trouble with getting the right syntax for my model. Here is a truncated version of my data: > data Ind Treatment Order DatePC1 1 PER14SC 3rd 4-May-09 0.5704611 2 PER14SH 1st 26-Apr-09 0.5329025 3 PER14AC 2nd 29-Apr-09 2.139

Re: [R] Reading from Google Docs

2009-07-08 Thread Gabor Grothendieck
I understand what you wrote. Its just that I don't agree that that is a reasonable solution. What is wanted is something that works safely out of the box, not something with a built in danger that every single person that uses it must fix (and know about it to fix) in order to maintain the integri

Re: [R] Reading from Google Docs

2009-07-08 Thread Duncan Murdoch
On 7/8/2009 3:18 PM, Gabor Grothendieck wrote: To my mind its pretty serious that Rtools can make other software not work and the importance of using the word find in the tools is close to zero. Most people never even look at the scripts. You didn't read what I wrote. It could be called anyth

[R] bootstrapping error message "Error in t.star[r, ] <- statistic(data, i[r, ], ...) : number of items to replace is not a multiple of replacement length"

2009-07-08 Thread Karina Boege
Hi, I am trying to run some bootstraps with the boot package. When I run it with 400 replicates it does it ok, but then I need to run the same analysis but with 89, 86, 102 and 106 samples (for four different environments), and then is when I get the error message: > mybootstrap <- boot(Da

Re: [R] matching each row

2009-07-08 Thread tathta
>From an email suggestion, here are two sample datasets, and my ideal output: dataA <- data.frame(unique.id=c("A","B","C","B"),x=11:14,y=5:2) dataB <- data.frame(unique.id=c("A","B","A","B","A","C","D","A"),x=27:20,y=22:29) ## mystery operation(s) happen here ## ideal output would be: dat

Re: [R] Reading from Google Docs

2009-07-08 Thread Gabor Grothendieck
To my mind its pretty serious that Rtools can make other software not work and the importance of using the word find in the tools is close to zero. Most people never even look at the scripts. Why don't you just rename find.exe to find2.exe, say, in Rtools and adjust the other files accordingly. F

Re: [R] print() to file?

2009-07-08 Thread Greg Snow
?sink -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Steve Jaffe > Sent: Wednesday, July 08, 2009 1:03 PM >

[R] print() to file?

2009-07-08 Thread Steve Jaffe
I'd like to write some objects (eg arrays) to a log file. cat() flattens them out. I'd like them formatted as in 'print' but print only writes to stdout. Is there a simple way to achieve this result? Thanks -- View this message in context: http://www.nabble.com/print%28%29-to-file--tp24397445

[R] heatmap.2: question regarding the "raw z-score"

2009-07-08 Thread Chrysanthi A.
Hi, I am analysing gene expression data using the heatmap.2 function in R and I was wondering what is the formula of the "raw z-score" bar which shows the colors for each pixel. According to that post: https://mailman.stat.ethz.ch/pipermail/r-help/2006-September/113598.html, it is the (actual val

Re: [R] truncated regression out-of-sample predictions

2009-07-08 Thread Wouterse, Fleur (IFPRI-Senegal)
Dear all, I am trying to implement Simar & Wilson's (2007) second algorithm and have the following question: If I use a truncated regression on the mhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented,

[R] \dQuote in packages

2009-07-08 Thread Rebecca Sela
I am in the process of submitting a package to CRAN. R CMD check ran successfully on the package on my local computer, using R version 2.1.1. However, on the computers for CRAN (with version 2.10.0), the following errors occurred: Warning in parse_Rd("./man/predict.Rd", encoding = "unknown")

Re: [R] OK - I got the data - now what? :-)

2009-07-08 Thread Mark Knecht
On Wed, Jul 8, 2009 at 10:51 AM, Michael A. Miller wrote: >> Mark wrote: > >    > Currently my data is one experiment per row, but that's >    > wasting space as most experiments only take 20% of the row >    > and 80% of the row is filled with 0's. I might want to make >    > the array more na

Re: [R] matching each row

2009-07-08 Thread Marc Schwartz
On Jul 8, 2009, at 10:09 AM, tathta wrote: I have two dataframes, the first column of each dataframe is a unique id number (the rest of the columns are data variables). I would like to figure out how many times each id number appears in each dataframe. So far I can use: length( match (da

Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
Hooray! I got it to work. Here is what I think happened.My hold up was that the tar command was not working. If you recall, when I issued the command: tar xvfz RgoogleDocs_0.2.2-src.tar.gz cmd.exe told me it could not be found I reran Rtools29.exe which is the Rtools setup program which offered to

[R] typo in ts detrending implementation in spec.pgram?

2009-07-08 Thread Mikhail Titov
Hello! I wonder if there is a typo in detrending code of spec.pgram in spectrum.R from stats package. One can see in the code https://svn.r-project.org/R/trunk/src/library/stats/R/spectrum.R . I am afraid there is a typo and the code should look like if (detrend) { t <- 1L:N - (N + 1)

Re: [R] OK - I got the data - now what? :-)

2009-07-08 Thread Michael A. Miller
> Mark wrote: > Currently my data is one experiment per row, but that's > wasting space as most experiments only take 20% of the row > and 80% of the row is filled with 0's. I might want to make > the array more narrow and have a flag somewhere in the 1st > 10 columns that

Re: [R] matching each row

2009-07-08 Thread tathta
Close... The output I'm looking for is more like this: output <- data.frame(unique.id=c(1,3,5,7,9),N.in.x=c(2,3,1,2,1),N.in.y=c(0,1,3,1,1)) The first column can be gotten using a small change to the first table line: table ( x [ which ( x %in% x ) ] ) ##the 3rd "x" used to be a "y" but

Re: [R] Simple monovariate classification?

2009-07-08 Thread Greg Hirson
Richard, More specifically, x = c(0,10,5,1,9,6) cut(x, breaks = c(-Inf, 2.5,7.5, Inf), labels = c(1, 2, 3)) #[1] 1 3 2 1 3 2 Hope that helps, Greg rgun...@dijon.inra.fr wrote: I'm looking for an R function that simply recodes a quantitative variable into a number of classes according to s

Re: [R] Simple monovariate classification?

2009-07-08 Thread Greg Hirson
Try ?cut Greg rgun...@dijon.inra.fr wrote: I'm looking for an R function that simply recodes a quantitative variable into a number of classes according to specified break-points. Obviously I can do this using nested ifelse() commands, but I want to write it into a function where I can't pr

Re: [R] Randomizing a dataframe

2009-07-08 Thread Greg Snow
Here is one approach (there are others, some that are probably better, but this can get you started): 1. rearrange your data so that every insect is a single row with 2 columns: the tree id and the species (this new dataset will have as many rows as the sum of the values in the old dataset). T

Re: [R] matching each row

2009-07-08 Thread David Huffer
Something like this? > dataframeA <- data.frame ( + unique.id= c(1,1,3,3,3,5,7,7, 9) + , x1=rnorm(9) + , x2=rnorm(9) + , x3=rnorm(9) + ) > dataframeB <- data.frame ( + unique.id= c(2,3,4,5,5,5,6,7,9,10,10) + , x4=rnorm(11) + , x5=rnorm(11) + , x6=rnorm(11)

Re: [R] Two-way ANOVA gives different results using anova(lm()) than doing it by hand

2009-07-08 Thread Marc Schwartz
On Jul 8, 2009, at 12:11 PM, Greg Snow wrote: Well, since we don't have Data.txt it is kind of hard for us to replicate what you have done. Here goes a guess as to what the problem may be. Have you told R anywhere that S1 and S2 are factors with 6 levels rather than numeric vectors? Or are

Re: [R] #INCLUDE

2009-07-08 Thread John Kane
?source perhaps? --- On Wed, 7/8/09, Idgarad wrote: > From: Idgarad > Subject: [R] #INCLUDE > To: r-help@r-project.org > Received: Wednesday, July 8, 2009, 11:16 AM > What is R's equivalent to a C-like > #include to incorporate external files. I > have a 2k line function that is generated and

Re: [R] Two-way ANOVA gives different results using anova(lm()) than doing it by hand

2009-07-08 Thread Greg Snow
Well, since we don't have Data.txt it is kind of hard for us to replicate what you have done. Here goes a guess as to what the problem may be. Have you told R anywhere that S1 and S2 are factors with 6 levels rather than numeric vectors? Or are you just hoping that the computer can read your mi

Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
Does changing the path in Windows work in real time or does one need to restart the computer for the changes to take effect. Farrel Buchinsky Google Voice Tel: (412) 567-7870 On Wed, Jul 8, 2009 at 12:04, Gabor Grothendieck wrote: > Its safer just to temporarily add it to your path. > > Unfortu

[R] Simple monovariate classification?

2009-07-08 Thread rgunton
I'm looking for an R function that simply recodes a quantitative variable into a number of classes according to specified break-points. Obviously I can do this using nested ifelse() commands, but I want to write it into a function where I can't pre-specify the number of classes. Is ther

Re: [R] Reading from Google Docs

2009-07-08 Thread Duncan Murdoch
On 08/07/2009 12:04 PM, Gabor Grothendieck wrote: Its safer just to temporarily add it to your path. Unfortunately Rtools has a find command that conflicts with the find command in Windows so if you add the Rtools bin directory to your path permanently then you could find other programs stop wor

Re: [R] Extracting a column name in loop?

2009-07-08 Thread Mark Knecht
On Wed, Jul 8, 2009 at 8:41 AM, mister_bluesman wrote: > > Hi, > > I am writing a script that will address columns using syntax like: > > data_set[,1] > > to extract the data from the first column of my data set, for example. This > code will be placed in a loop (where the column reference will be

[R] Extracting a column name in loop?

2009-07-08 Thread mister_bluesman
Hi, I am writing a script that will address columns using syntax like: data_set[,1] to extract the data from the first column of my data set, for example. This code will be placed in a loop (where the column reference will be placed by a variable). What I also need to do is extract the colu

[R] matching each row

2009-07-08 Thread tathta
I have two dataframes, the first column of each dataframe is a unique id number (the rest of the columns are data variables). I would like to figure out how many times each id number appears in each dataframe. So far I can use: length( match (dataframeA$unique.id[1], dataframeB$unique.id) )

  1   2   >