Re: [R] Uncorrelated random vectors - Thank you!

2009-07-08 Thread Stein, Luba (AIM SE)
Thanks to all for the answers! I solved my problem now by sufficient iteration! Have a nice day! Luba __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Thanks: Mathematical annotation axis in lattice

2009-07-08 Thread Coster, Albart
Hello, thanks for the two replies. The following code worked as expected: pos - 1:10 lab - letters[pos] ll - parse(text = paste(pos,*phi[,lab,],sep = )) xyplot(1:10~1:10,scales = list(x = list(labels = ll,at = 1:10))) Best regards, Albart -Original Message- From: Coster, Albart

[R] Rdsm, a DSM package for parallel R programming

2009-07-08 Thread Norm Matloff
As I mentioned last week, I've been developing a package that I call Rdsm (R distributed shared memory), modeled after a similar package, PerlDSM, I wrote for Perl some years ago. It is now in alpha form, so I'm not uploading to CRAN yet, but it is definitely usable, and I am releasing it at

Re: [R] can't get rJava to install on Linux

2009-07-08 Thread Dirk Eddelbuettel
On 7 July 2009 at 21:28, Mark Kimpel wrote: | Having difficulties getting rJava to install on my Debian Squeeze box. Did you try the binary package? A simple sudo apt-get install r-cran-rjava should do; if not you can at least use its Build-Depeds via sudo apt-get build-depends

[R] clogit comparison between Stata and R

2009-07-08 Thread David Hugh-Jones
Hello all I'm moving back and forth between stata and R at the moment - of course, using R whenever possible :-) I'm running conditional logits on some panel data and I get slightly different results and different N in the two programs. In R I run clogit(trans.dem ~ I(avg.gle_rgdp.500/gle_rgdp)

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

2009-07-08 Thread David Hugh-Jones
You might also find the R wiki useful: http://wiki.r-project.org/rwiki/doku.php?id=tips:spatial-data http://wiki.r-project.org/rwiki/doku.php?id=tips:stats-spatial David Hugh-Jones Post-doctoral Researcher Max Planck Institute of Economics, Jena http://davidhughjones.googlepages.com 2009/7/7

[R] R 2.9.0 plot still forcing current time zone

2009-07-08 Thread Britton Stephens
the help page for plot.POSIXct says As from R 2.9.0 the date-times for a 'POSIXct' input are interpreted in the timwzonw give by the 'tzone' attribute it there is one, otherwise the current timezone. (Earlier vrsions always used the current timezone.) however I am using 2.9.0 on

Re: [R] Dump plots to powerpoint?

2009-07-08 Thread Barry Rowlingson
On Tue, Jul 7, 2009 at 11:32 PM, Ben Bolkerbol...@ufl.edu wrote:  Why not directly generate a large PNG file (which will be much better for line art than JPG anyway)?  Or EMF?  See http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export  [Of course, this doesn't answer the

[R] Help resolving error in quantcut

2009-07-08 Thread Chris Anderson
I am trying to use the quantcut function to create deciles, but I am getting the error below. I am new to using this function and do not know how to properly use the options or some other conversion that is necessary. #initial summary using describe function in Hmisc library DegreeBurn4th

[R] Odp: error: no such index at level 2

2009-07-08 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 07.07.2009 19:06:17: Hi, I am confused about how to select elements from a list. I'm trying to select all rows of a table 'crossRsorted' such that the mean of a related vector is 0. The related vector is accessible as a list element l[[i]]

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

2009-07-08 Thread utkarshsinghal
Hi Greg, Many thanks for your precious time. Here is a workable code: set.seed(1) xx = data.frame(x1=runif(1,0,10), x2=runif(1,0,10), x3=runif(1,0,10)) xx$y = 3 + xx$x1 + 2*xx$x2 + 3*xx$x3 + rnorm(1) chunksize = 500 fit = biglm(y~x1+x2+x3, data=xx[1:chunksize,]) for(i in

[R] Plotting the PDF and the Cumulative Probability

2009-07-08 Thread aledanda
Hallo, I have to fit my distribution with Beta-prime. I found the parameters now I need to plot the Cumulative probability and the Probability density of my fitted data. With gamma for exemple is easy: PDF: plot(x,dgamma(x, shape,rate)) Cumulative probability: plot(x,pgamma(x, shape,rate))

Re: [R] Dump plots to powerpoint?

2009-07-08 Thread T . Zumbrunn
Another suggestion: Create your presentation with an OpenDocument Presentation format compatible application (e.g. OpenOffice Impress), create the plots with Sweave chunks, and process the file with odfWeave() (package odfWeave). If necessary, you can export to other formats such as

Re: [R] How to separate the string?

2009-07-08 Thread Hemavathi Ramulu
Hi everyone, Thanks alot. Its work with help of you all. regards, Hema On Tue, Jul 7, 2009 at 5:00 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi If you have data frame like this test=data.frame(x=c(abcd, abc, abcde)) than strsplit(as.matrix(test), ) makes a list with splitted

[R] Fitting a trend-line

2009-07-08 Thread anupam sinha
Hi all, I am new to R. How does one go about fitting a trend-line to a scatter plot? Any help is appreciated. Thanks and regards, Anupam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Odp: Fitting a trend-line

2009-07-08 Thread Petr PIKAL
Hi see ?lm and ?abline Regards Petr r-help-boun...@r-project.org napsal dne 08.07.2009 11:31:19: Hi all, I am new to R. How does one go about fitting a trend-line to a scatter plot? Any help is appreciated. Thanks and regards, Anupam [[alternative HTML version deleted]]

Re: [R] Fitting a trend-line

2009-07-08 Thread wapita wapita
Why dont you do a linear regression? Date: Wed, 8 Jul 2009 15:01:19 +0530 From: anupam.cont...@gmail.com To: r-help@r-project.org Subject: [R] Fitting a trend-line Hi all, I am new to R. How does one go about fitting a trend-line to a scatter plot? Any help is appreciated.

[R] system() how to make a program run a specific file

2009-07-08 Thread Paulo E. Cardoso
I'd like to know how to call a program to run or open a specific file. something like this: system('C:\\Program Files (x86)\\IrfanView\\i_view32.exe','-A:\\ teste.jpg') is not working. any help will be appreciated Paulo E. Cardoso [[alternative HTML version

Re: [R] Dump plots to powerpoint?

2009-07-08 Thread Gabor Grothendieck
Check out the R2PPT package on CRAN. On Tue, Jul 7, 2009 at 4:38 PM, Thomasaikto...@yahoo.com wrote: Hi, Is it possible to dump a series of plots directly into a powerpoint presentation (as is possible in Splus)? Thank you, Thomas        [[alternative HTML version deleted]]

[R] RODBC and sqlSave issue

2009-07-08 Thread wapita wapita
Hello, I contact you after having unsuccessfully asked my question to R mailing list. I use the package RODBC to connect to a MS-SQL server. I am able to getQuery from the database. I am now studying the sqlSave some data into the database. Unfortunetly, I meet some issues relating to

Re: [R] Dump plots to powerpoint?

2009-07-08 Thread SIES 73
Hi, On windows, you can use a COM client (with packages like rcom or RDCOMClient) to control powerpoint from R and insert the generated image using powerpoint's object model. You can either use the clipboard or an intermediate image file saved to disk. Not hard to do, but this seems to be

Re: [R] system() how to make a program run a specific file

2009-07-08 Thread Paulo E. Cardoso
After all it's very easy: system(paste('C:\\Program Files (x86)\\IrfanView\\i_view32.exe','A:\\test.jpg')) Paulo E. Cardoso -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Paulo E. Cardoso Enviada: quarta-feira, 8

Re: [R] Fitting a trend-line

2009-07-08 Thread Jim Lemon
anupam sinha wrote: Hi all, I am new to R. How does one go about fitting a trend-line to a scatter plot? Any help is appreciated. Hi Anupam, Have a look at the help page for the abline function in the graphics package. Jim __

[R] stats::decompose - Problem finding seasonal component without trend

2009-07-08 Thread Mike HC
Hi R-help, I'd like to extract the seasonal component of a short timeseries, and was hoping to use stats::decompose. I don't want to decompose the 'trend' component so I thought I should call decompose(x,filter=0). I think I've either misunderstood the filter argument or come upon a

[R] Import xlsx file in Ubuntu 9.04

2009-07-08 Thread Rodrigo Aluizio
Hi list, By the entire last 2 weeks I was looking for a way to directly import xlsx files to R in a Linux OS (Ubuntu 9.04). I already read the R Import/Export guide, and I know how to use gdata to import xls files and read.table to import .csv. My problem is that all data that I receive is in the

Re: [R] R 2.9.0 plot still forcing current time zone

2009-07-08 Thread jim holtman
Try this: set the timezone to what you want before plotting: tzsave - Sys.getenv(TZ) # save current Sys.setenv(TZ=GMT) # set to whatever plot(x,rep(1,11)) # plot Sys.setenv(TZ=tzsave) # restore plot(x,rep(1,11)) # plot in original time zone On Wed, Jul 8, 2009 at 2:21 AM, Britton

[R] linear regression and testing the slope

2009-07-08 Thread evrim akar
Dear All, First of all I would like to say I do not have much knowledge about this subject, so most of you can find it really easy. I am doing a linear regression and I want to test if the slope of the curve is 0. R gives the summary statistics: Call: lm(formula = x ~ s) Residuals: Min

[R] transform multi skew-t to uniform distribution

2009-07-08 Thread Adelchi Azzalini
RHRPO RHRPO Hi R-users, RHRPO _I have a data from multi skew t and would like to transform each of the data to uniform data._ I tried using 'pmst' but only got one output: RHRPO _ RHRPO rr1 - as.vector(r1);rr1 RHRPO _[1]_ 0.7207582_ 5.2250906_ 1.7422237_ 0.5677233_ 0.7473555 -0.6020626

Re: [R] ReShape to create Time from Observations?

2009-07-08 Thread Mark Knecht
On Tue, Jul 7, 2009 at 4:22 PM, jim holtmanjholt...@gmail.com wrote: Does something like this work for you;  it uses the reshape package: X-data.frame(A=1:10, B=0, C=1, Ob1=1:10, Ob2=2:11, Ob3=3:12, + Ob4=4:13, Ob5=3:12, Ob6=2:11) Y-data.frame(A=1:20, B=0, C=1, D=5, Ob1=1:10, Ob2=2:11,

[R] RDCOMClient: how to close Excel process?

2009-07-08 Thread Lauri Nikkinen
Hi, I’m using R package RDCOMClient (http://www.omegahat.org/RDCOMClient/) to retrieve data from MS Excel workbook. I’m using the code below to count the number of sheets in the workbook and then loop the data from sheets in to a list. # R code ### library(gdata)

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

2009-07-08 Thread Praveen Surendran
Hi, Is there a way in R to get the string which matches the expression, where the expression is a substring of the parent string. Lets say, I have $i - transcript:ENST112334 pid:ENSP12345 What I need is the string pid:ENSP12345 from $i using the query ENSP. Appreciate your

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

2009-07-08 Thread Paulo E. Cardoso
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? Paulo E. Cardoso -Mensagem original- De: r-help-boun...@r-project.org

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

2009-07-08 Thread Henrique Dallazuanna
Try this: xl$Quit() On Wed, Jul 8, 2009 at 10:06 AM, Lauri Nikkinen lauri.nikki...@iki.fiwrote: Hi, I’m using R package RDCOMClient (http://www.omegahat.org/RDCOMClient/) to retrieve data from MS Excel workbook. I’m using the code below to count the number of sheets in the workbook and

Re: [R] linear regression and testing the slope

2009-07-08 Thread Ted Harding
On 08-Jul-09 12:29:40, evrim akar wrote: Dear All, First of all I would like to say I do not have much knowledge about this subject, so most of you can find it really easy. I am doing a linear regression and I want to test if the slope of the curve is 0. R gives the summary statistics:

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

2009-07-08 Thread Henrique Dallazuanna
Try this: sapply(strsplit(i, ' '), grep, pattern='ENSP', value = T) On Wed, Jul 8, 2009 at 10:04 AM, Praveen Surendran praveen.surend...@ucd.ie wrote: Hi, Is there a way in R to get the string which matches the expression, where the expression is a substring of the parent string.

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

2009-07-08 Thread Henrique Dallazuanna
Then, you can try this: xl - COMCreate(Excel.Application) wk - xl$Workbooks() sh - wk$Open(normalizePath(sample_file.xls))$Sheets()$Count() wk$Close() xl$Quit() On Wed, Jul 8, 2009 at 10:19 AM, Lauri Nikkinen lauri.nikki...@iki.fiwrote: Thanks but that did not work. xl$Quit() does not kill

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

2009-07-08 Thread Lauri Nikkinen
Thanks but that did not work. xl$Quit() does not kill the Excel process and sample_file.xls will not open. I'm using Windows XP SP2 and R 2.8.1 -L 2009/7/8 Henrique Dallazuanna www...@gmail.com: Try this: xl$Quit() On Wed, Jul 8, 2009 at 10:06 AM, Lauri Nikkinen lauri.nikki...@iki.fi

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

2009-07-08 Thread Praveen Surendran
Thanks Henrique. This is indeed short and quite simple compared to what I was using which goes like... unlist(strsplit(i,split= ))[grep(ENSP,unlist(strsplit(i,split= )))] J Cheers, Praveen. From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: 08 July 2009 14:18 To:

Re: [R] error: no such index at level 2

2009-07-08 Thread Godmar Back
On Wed, Jul 8, 2009 at 4:22 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi r-help-boun...@r-project.org napsal dne 07.07.2009 19:06:17: Hi, I am confused about how to select elements from a list. I'm trying to select all rows of a table 'crossRsorted' such that the mean of a

Re: [R] error: no such index at level 2

2009-07-08 Thread Henrique Dallazuanna
Its because '[[' accept only element, so you need use '[': q[crossRsorted[,1]] On Wed, Jul 8, 2009 at 10:28 AM, Godmar Back god...@gmail.com wrote: On Wed, Jul 8, 2009 at 4:22 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi r-help-boun...@r-project.org napsal dne 07.07.2009 19:06:17:

[R] functions to calculate t-stats, etc. for lm.fit objects?

2009-07-08 Thread Whit Armstrong
I'm running a huge number of regressions in a loop, so I tried lm.fit for a speedup. However, I would like to be able to calculate the t-stats for the coefficients. Does anyone have some functions for calculating the regression summary stats of an lm.fit object? Thanks, Whit

Re: [R] error: no such index at level 2

2009-07-08 Thread Godmar Back
On Wed, Jul 8, 2009 at 9:40 AM, Henrique Dallazuanna www...@gmail.comwrote: Its because '[[' accept only element, so you need use '[': q[crossRsorted[,1]] This appears to be doing something different. For instance, my 'q' has 165 components, but what you suggest has 15750: length(q) [1] 165

Re: [R] Import xlsx file in Ubuntu 9.04

2009-07-08 Thread Marc Schwartz
On Jul 8, 2009, at 6:56 AM, Rodrigo Aluizio wrote: Hi list, By the entire last 2 weeks I was looking for a way to directly import xlsx files to R in a Linux OS (Ubuntu 9.04). I already read the R Import/ Export guide, and I know how to use gdata to import xls files and read.table to

Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
I have previously read R Installation and Administration. I read it again. It does not help me The relevant paragraph is below. But I need lower level instructions. Where can I find them. R CMD INSTALL works in Windows to install source packages if you have the source-code package files (option

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

2009-07-08 Thread Jorge Ivan Velez
Dear Praveen, Try also: strsplit(i,' ')[[1]][2] # [1] pid:ENSP12345 HTH, Jorge On Wed, Jul 8, 2009 at 9:04 AM, Praveen Surendran praveen.surend...@ucd.iewrote: Hi, Is there a way in R to get the string which matches the expression, where the expression is a substring of the parent

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

2009-07-08 Thread Gabor Grothendieck
Try this: library(gsubfn) i - transcript:ENST112334 pid:ENSP12345 strapply(i, paste(\\w*, ENSP, \\w*, sep = ), c, simplify = unlist) This says to match any number (possibly zero) of word characters followed by ENSP followed by more word characters. c just returns the match without

Re: [R] Reading from Google Docs

2009-07-08 Thread Duncan Murdoch
On 08/07/2009 10:02 AM, Farrel Buchinsky wrote: I have previously read R Installation and Administration. I read it again. It does not help me The relevant paragraph is below. But I need lower level instructions. Where can I find them. Follow the link. If Windows can't find tar, your toolset

Re: [R] Reading from Google Docs

2009-07-08 Thread Farrel Buchinsky
Forgive my naivte, but how do I make windows find tar. In other words from where do I issue the command and what is the command. Farrel Buchinsky Google Voice Tel: (412) 567-7870 On Wed, Jul 8, 2009 at 10:09, Duncan Murdoch murd...@stats.uwo.ca wrote: On 08/07/2009 10:02 AM, Farrel Buchinsky

Re: [R] Fitting a trend-line

2009-07-08 Thread anupam sinha
Thanks a lot for all your suggestions. Regards, Anupam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[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 mn observations, how do I get fitted values for all n observations, instead of for m observations, which is what the command fitted returns; I

[R] recoding strings containing colons

2009-07-08 Thread Donald Braman
Curious to know if recode can work with strings containing colons. I haven't gotten it to work yet, but perhaps there is a way? Donald Braman http://www.culturalcognition.com/braman/ __ R-help@r-project.org mailing list

Re: [R] error: no such index at level 2

2009-07-08 Thread Godmar Back
On Wed, Jul 8, 2009 at 9:40 AM, Henrique Dallazuanna www...@gmail.comwrote: Its because '[[' accept only element, so you need use '[': q[crossRsorted[,1]] Henrique, I figured out what q[crossRsorted[,1]] does - it produces q[i] for all i in crossRsorted[,1]. Ok. Since a given index 'k' of

[R] please remove me from this list

2009-07-08 Thread Curley, Jane
[[alternative HTML version deleted]] __ 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, minimal,

Re: [R] functions to calculate t-stats, etc. for lm.fit objects?

2009-07-08 Thread Marc Schwartz
On Jul 8, 2009, at 8:51 AM, Whit Armstrong wrote: I'm running a huge number of regressions in a loop, so I tried lm.fit for a speedup. However, I would like to be able to calculate the t-stats for the coefficients. Does anyone have some functions for calculating the regression summary stats

[R] Passing arguments to with()

2009-07-08 Thread Tymek Wołodźko
Hi, I've been wondering how to write a function that will produce results from multiple tests (eg. paired t-tests) for all or several variables in some data frame. I'd like it to do t-test for each variable ('x') in 'data' by 'y'. I'm stuck in here: function(data,y) { for (x in names(data)) {

[R] Formatting a Table

2009-07-08 Thread cvandy
I've created a short program to print a table of learning curve factors. However, I cannot figure out how to format the table to: 1) Get rid of the [1]s in the first column and replace it with the values of N. 2) Line up the first row with the factors (decimal fractions). Thanks for any help.

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

2009-07-08 Thread Lars Bergemann
Hey! Could you please take a quick look at what I have done? Somehow I get wrong results using the anova(lm()) combination compared to doing a two way ANOVA by hand. Running: Data-read.table(Data.txt); g-lm(ExM~S1*S2,Data); anova(g); Gives: Analysis of Variance Table

Re: [R] functions to calculate t-stats, etc. for lm.fit objects?

2009-07-08 Thread Whit Armstrong
Marc, Thanks very much for your detailed reply. I'll give your code a try and post back the time difference. Cheers, Whit On Wed, Jul 8, 2009 at 10:50 AM, Marc Schwartzmarc_schwa...@me.com wrote: On Jul 8, 2009, at 8:51 AM, Whit Armstrong wrote: I'm running a huge number of regressions in

[R] #INCLUDE

2009-07-08 Thread Idgarad
What is R's equivalent to a C-like #include to incorporate external files. I have a 2k line function that is generated and need to include it at runtime but not manage it as a package (as it changes hourly.) Any ideas? [[alternative HTML version deleted]]

Re: [R] Reading from Google Docs

2009-07-08 Thread Duncan Murdoch
On 08/07/2009 10:13 AM, Farrel Buchinsky wrote: Forgive my naivte, but how do I make windows find tar. In other words from where do I issue the command and what is the command. You need to install the toolset, and let the installer set your path. Duncan Murdoch Farrel Buchinsky Google Voice

Re: [R] #INCLUDE

2009-07-08 Thread Godmar Back
?source ? On Wed, Jul 8, 2009 at 11:16 AM, Idgaradidga...@gmail.com wrote: What is R's equivalent to a C-like #include to incorporate external files. I have a 2k line function that is generated and need to include it at runtime but not manage it as a package (as it changes hourly.) Any ideas?

[R] Comparing GAMMs

2009-07-08 Thread Paul Simonin
Greetings! I am looking for advice regarding the best way to compare GAMMs. I know other model outputs return enough information for R's AIC, ANOVA, etc. commands to function, but this is not the case with GAMM unless one specifies the gam or lme portion. I know these parts of the gamm

Re: [R] Passing arguments to with()

2009-07-08 Thread Duncan Murdoch
On 08/07/2009 10:01 AM, Tymek Wo?odz'ko wrote: Hi, I've been wondering how to write a function that will produce results from multiple tests (eg. paired t-tests) for all or several variables in some data frame. I'd like it to do t-test for each variable ('x') in 'data' by 'y'. I'm stuck in

Re: [R] Formatting a Table

2009-07-08 Thread Godmar Back
You could use 'cat(sprintf())', C-style: for (N in seq(2,10,2)) + {if (N==2){cat(sprintf(%5d, T(N,Lc)*100),\n)}else{cat(sprintf(%5.3f, T(N,Lc)), \n)}} 707580858995 0.490 0.562 0.640 0.722 0.810 0.902 0.398 0.475 0.562 0.657 0.762 0.876 0.343 0.422 0.512 0.614 0.729 0.857

Re: [R] Formatting a Table

2009-07-08 Thread David Huffer
Cvandy, is this close to what you need: printT - function ( .seq = seq ( 2 , 10 , 2 ) ) { + x - t ( sapply ( .seq , T , Lc ) ) + x - cbind ( + .seq + , rbind ( + format ( x [ 1 , ] * 100 ) + , format ( x [ -1 , ] , digits = 3 ) + ) + ) +

Re: [R] Comparing GAMMs

2009-07-08 Thread Gavin Simpson
On Wed, 2009-07-08 at 11:24 -0400, Paul Simonin wrote: Greetings! I am looking for advice regarding the best way to compare GAMMs. I know other model outputs return enough information for R's AIC, ANOVA, etc. commands to function, but this is not the case with GAMM unless one specifies

[R] Randomizing a dataframe

2009-07-08 Thread Mark Na
Hi R-helpers, I have a dataframe (called data) with trees in rows (n=100) and insect species (n=10) in columns. My tree IDs are in a column called TREE and each species has a column labeled SPEC1, SPEC2, SPEC3, etc... I wish to randomize the values in my dataframe such that row and column totals

Re: [R] error: no such index at level 2

2009-07-08 Thread David Huffer
Godmar, I don't follow... q - list ( ) q [[ 105 ]] - as.numeric ( c ( 0 , 0 , 1 ) ) q [[ 104 ]] - as.numeric ( c ( 1 , 1 , 1 ) ) q [[ 10 ]] - as.integer ( c ( 3 , 3 , 1 ) ) crossRsorted - data.frame ( i = c ( 105 , 104 , 10 ) ) q [ crossRsorted [ , 1 ] ] [[1]] [1] 0 0 1

Re: [R] error: no such index at level 2

2009-07-08 Thread Godmar Back
Sorry, I mixed my toy example to recreate the problem with the actual data set. The 'crossRsorted' in the toy and in the actual are different. See my latest posting in this thread. - Godmar On Wed, Jul 8, 2009 at 11:55 AM, David Hufferdavid.huf...@csosa.gov wrote: Godmar, I don't follow...

Re: [R] Reading from Google Docs

2009-07-08 Thread Gabor Grothendieck
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 working. That actually happened to me once and it

Re: [R] Uncorrelated random vectors

2009-07-08 Thread Greg Snow
The mvrnorm function in the MASS package has an argument to force the generated data to have the exact mean/variance structure as specified which when used with a diagonal variance matrix will generate data that has a 0 (within round off error) correlation in the data. No post processing by

Re: [R] Import xlsx file in Ubuntu 9.04

2009-07-08 Thread Duncan Temple Lang
I did some preliminary work on xslx (and docx and pptx) files some time ago and will hopefully finish things off by the end of summer. We can read these with a combination of the Rcompression and XML package. I have put versions of two packages (ROOXML and RExcelXML) at

Re: [R] Randomizing a dataframe

2009-07-08 Thread Mark Knecht
On Wed, Jul 8, 2009 at 8:54 AM, Mark Namtb...@gmail.com wrote: Hi R-helpers, I have a dataframe (called data) with trees in rows (n=100) and insect species (n=10) in columns. My tree IDs are in a column called TREE and each species has a column labeled SPEC1, SPEC2, SPEC3, etc... I wish to

Re: [R] Reading from Google Docs

2009-07-08 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gabor Grothendieck Sent: Wednesday, July 08, 2009 9:04 AM To: Duncan Murdoch Cc: R; Uwe Ligges; Farrel Buchinsky Subject: Re: [R] Reading from Google Docs Its safer just to

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

2009-07-08 Thread Greg Snow
OK, it appears that the problem is the df.resid component of the biglm object. Everything else is being updated by the update function except the df.resid piece, so it is based solely on the initial fit and the chunksize used there. The df.resid piece is then used in the computation of the

[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) )

[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

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

2009-07-08 Thread Mark Knecht
On Wed, Jul 8, 2009 at 8:41 AM, mister_bluesmanmister_blues...@hotmail.com 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

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

[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

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 ggrothendi...@gmail.comwrote: Its safer just to temporarily add it to

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

Re: [R] #INCLUDE

2009-07-08 Thread John Kane
?source perhaps? --- On Wed, 7/8/09, Idgarad idga...@gmail.com wrote: From: Idgarad idga...@gmail.com 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

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

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] 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).

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

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

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 I

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 says the

[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 +

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

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

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. Millermmill...@iupui.edu 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

[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] 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 mn observations, how do I get fitted values for all n observations, instead of for m observations, which is what the command fitted returns; I

[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

[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:

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: dataA -

[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 -

  1   2   >