[R] Fw: Problems with old version of R

2009-04-22 Thread Stefan Grosse
On Wed, 22 Apr 2009 11:18:17 -0400 Dimitri Liakhovitski wrote: DL> You don't have to uninstall the old version. Just install the new DL> version. What I do then - I manually copy (in Windows Explorer) all DL> the packages from the folder library that is under your old R DL> version into the folde

Re: [R] fitting assimptotic decaing with - and + on X

2009-04-22 Thread Christian Ritz
Hi Milton, you're right that most of the functions in the package "drc" are suited for sigmoidal/s-shaped curves defined on the positive axis. However, there is one exception: the logistic model: library(drc) sp.coredep.attr.m1 <- drm(preference~dst, data=sp.coredep.attr, fct=L.4()) plot(sp.co

[R] ggplot2/aesthetic plotting advice

2009-04-22 Thread Ben Bolker
Consider the following situation: we have quantified algal concentrations for a variety of species using many samples at each of three years. It seems to make sense to generate a line plot (matplot-like), with each species plotted as a separate line, with the points connected to emphasize th

Re: [R] fitting assimptotic decaing with - and + on X

2009-04-22 Thread milton ruser
Dear Relper, I still need some help with this issue. I am very thanks for the suggestions. Bests milton On Tue, Apr 21, 2009 at 11:51 AM, milton ruser wrote: > Dear all, > > I need to adjust a decaing function between "preference" as function > of "distance" (dst). As you can see below, the X

Re: [R] large factorials

2009-04-22 Thread Ben Bolker
J Dougherty wrote: > > If you need an open source arbitrary precision calculator, you might want > to > look at Octave which is OS and works similarly to Mathematica - up to a > point > books for Mathematica will be a significant help with Octave. > > JDougherty > > ??? octave is a Ma

Re: [R] converting histogram to barchart

2009-04-22 Thread Kingsford Jones
Hi Thomas, Here's a simple example of adding a KDE line to a plotted histogram: set.seed(222) x <- rnorm(100) hist(x, freq=FALSE) lines(density(x), lty=2, col=2, lwd=2) Note the need to set the freq to FALSE -- otherwise hist will calculate counts within bins rather than probability densities.

Re: [R] rbind data frames stored in a list

2009-04-22 Thread Dimitri Liakhovitski
Thank you very much, do.call is, of course, much more elegant! Dimitri On Wed, Apr 22, 2009 at 9:58 PM, jim holtman wrote: > 'do.call' is your friend:: > >> a<-data.frame(a=1,b=2,c=3) >> b<-data.frame(a=c(4,7),b=c(5,8),c=c(6,9)) >> c<-data.frame(a=c(10,13,16),b=c(11,14,17),c=c(12,15,18)) >> X<-li

Re: [R] rbind data frames stored in a list

2009-04-22 Thread Dimitri Liakhovitski
Replying to my own post. I found the following solution: full.frame<-as.data.frame(matrix(nrow=0,ncol=3)) names(full.frame)<-c("a","b","c") for(j in 1:length(X)) {full.frame<-rbind(full.frame,X[[j]])} (full.frame) Is there a more elegant solution? Thank you! Dimitri On Wed, Apr 22, 2009 at 9:36

Re: [R] rbind data frames stored in a list

2009-04-22 Thread jim holtman
'do.call' is your friend:: > a<-data.frame(a=1,b=2,c=3) > b<-data.frame(a=c(4,7),b=c(5,8),c=c(6,9)) > c<-data.frame(a=c(10,13,16),b=c(11,14,17),c=c(12,15,18)) > X<-list() > X[[1]]<-a > X[[2]]<-b > X[[3]]<-c > do.call(rbind, X) a b c 1 1 2 3 2 4 5 6 3 7 8 9 4 10 11 12 5 13 14 15 6 16

Re: [R] rbind data frames stored in a list

2009-04-22 Thread Bert Gunter
?do.call ... as in do.call(rbind,X) (A very useful and powerful feature os the S language: Computing on the language. See V&R's "S Programming" for an informative discussion (there may well be others, of course). -- Bert -Original Message- From: r-help-boun...@r-project.org [mailto:r-h

Re: [R] rbind data frames stored in a list

2009-04-22 Thread Marc Schwartz
On Apr 22, 2009, at 8:36 PM, Dimitri Liakhovitski wrote: Hello everyone! I have a list X with 3 elements, each of which is a data frame, for example: a<-data.frame(a=1,b=2,c=3) b<-data.frame(a=c(4,7),b=c(5,8),c=c(6,9)) c<-data.frame(a=c(10,13,16),b=c(11,14,17),c=c(12,15,18)) X<-list() X[[1

[R] rbind data frames stored in a list

2009-04-22 Thread Dimitri Liakhovitski
Hello everyone! I have a list X with 3 elements, each of which is a data frame, for example: a<-data.frame(a=1,b=2,c=3) b<-data.frame(a=c(4,7),b=c(5,8),c=c(6,9)) c<-data.frame(a=c(10,13,16),b=c(11,14,17),c=c(12,15,18)) X<-list() X[[1]]<-a X[[2]]<-b X[[3]]<-c (X) How can I most effectively transf

Re: [R] large factorials

2009-04-22 Thread J Dougherty
On Wednesday 22 April 2009 12:21:41 pm molinar wrote: > I am working on a project that requires me to do very large factorial > evaluations. On R the built in factorial function and the one I created > both are not able to do factorials over 170. The first gives an error and > mine return Inf. >

[R] RWeka: How to access AttributeEvaluators

2009-04-22 Thread Michael Olschimke
Hi, I'm trying to use Information Gain for feature selection. There is a InfoGain implementation in Weka: *weka.attributeSelection.InfoGainAttributeEval* Is it possible to use this function with RWeka? If yes how? list_Weka_interfaces doesn't show it and there is no make function for AttributeE

[R] RWeka: How to access AttributeEvaluators

2009-04-22 Thread Michael Olschimke
Hi, I'm trying to use Information Gain for feature selection. There is a InfoGain implementation in Weka: *weka.attributeSelection.InfoGainAttributeEval* Is it possible to use this function with RWeka? If yes how? list_Weka_interfaces doesn't show it and there is no make function for AttributeE

Re: [R] RES: How to force axis to have the same range

2009-04-22 Thread Greg Snow
For variables named my.x and my.y try: > plot( my.x, my.y, xlim=range(my.x,my.y), ylim=range(my.x,my.y) ) If all you want is to have the same range of values on both the x and y axes. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.81

[R] Multiple imputations : wicked dataset ? Wicked computers ? Am I cursed ? (or stupid ?)

2009-04-22 Thread Emmanuel Charpentier
Dear list, I'd like to use multiple imputations to try and save a somewhat badly mangled dataset (lousy data collection, worse than lousy monitoring, you know that drill... especially when I am consulted for the first time about one year *after* data collection). My dataset has 231 observations o

Re: [R] Subsetting a vector of numerics such that standard deviation is less than 0.5 ?

2009-04-22 Thread Dimitri Liakhovitski
Daren, what are you trying to achieve? Why don't you want any negative numbers? Anyway, if you only need positive values, why not: set.seed(999) v<-rnorm(20,mean=2,sd=0.5) (v) (sd(v)) Dimitri On Wed, Apr 22, 2009 at 1:26 AM, Daren Tan wrote: >> set.seed(999) >> abs(rnorm(20)) >  [1] 0.28174016 1

Re: [R] large factorials

2009-04-22 Thread Wacek Kusnierczyk
if you really really need to have it done from within r, you may want to use an external facility such as bc, the 'basic calculator' [1,2]. for example, use the (experimental!) r-bc: source('http://r-bc.googlecode.com/svn/trunk/R/bc.R') (you can also download the zipped package which will in

Re: [R] My surprising experience in trying out REvolution's R

2009-04-22 Thread Carl Witthoft
> First, the regular R 1.9. It takes 2 minutes and 6 seconds, CPU usage > 50% > > Next, REvolution's R. It takes 2 minutes and 10 seconds, CPU usage 100%. > > In other words, REvolution's R consumes double the CPU with slightly > less speed. The fact that it is the same time with only the 50%/10

Re: [R] Rhelp

2009-04-22 Thread David Winsemius
The box referred to is probably the little blue box on the left hand side of the Package Manager that the Mac GUI offers for loading packages. One possible cause for that behavior in my experience is working with a 64 bit GUI when the package was installed from binary. This occurs because m

Re: [R] lmer() function

2009-04-22 Thread Ben Bolker
Ali Mahani wrote: > > I'm trying to estimate a two-tier model with varying intercepts and slopes > across 20 groups, with each group having about 50 observations and with no > group predictor. I use the command lmer(y~x+(1+x | group)). But the result > is a constant intercept (zero standard dev

Re: [R] large factorials

2009-04-22 Thread Murray Cooper
You don't say what the error was, for the R factorial function, but it is probably irrelevant for your question. Factorials get to be big numbers rather quickly and unless you are using a program that does arbitrary precission arithmetic you will quickly exceed the precission limits, for storing

Re: [R] How do I loop through strings?

2009-04-22 Thread Jorge Ivan Velez
Hi dre968. Take a look at this: > strings <- c('ABC','DFC','AWS','','ABC','POK','MKL') > strings [1] "ABC" "DFC" "AWS" """ABC" "POK" "MKL" > strings=='ABC' [1] TRUE FALSE FALSE FALSE TRUE FALSE FALSE > sapply(strings, function(x) x=='ABC') ABC DFC AWS ABC POK MKL TRUE FA

Re: [R] Count Code

2009-04-22 Thread Peter Dalgaard
David Winsemius wrote: On Apr 22, 2009, at 3:42 PM, Bronagh Grimes wrote: Hi there, I am interested in converting SAS code to R & I wondered if anyone had any quick R code/tips for the following piece of test SAS code? Any feedback greatly appreciated. data A1; set A1; count + 1; by subj

Re: [R] Rhelp

2009-04-22 Thread Sarah Goslee
Well, I personally have no idea what "the box" might be, but I've sent this back to the list (you sent it just to me), and maybe someone else will know. On Wed, Apr 22, 2009 at 4:56 PM, Slusher, Nicole wrote: > When I tried to load the package by checking on the box, the box wouldn't > check and

Re: [R] Rhelp

2009-04-22 Thread Richardson, Patrick
Please read the posting guide at http://www.R-project.org/posting-guide.html and repost your question. You have not provided the information need to properly address your difficulties. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf

Re: [R] Rhelp

2009-04-22 Thread Sarah Goslee
You might be better off asking on the Bioconductor list. But in general, we need to know _what_ went wrong. What did you do, what happened, what error messages did you get? Those messages are given for a reason, you know... Sarah On Wed, Apr 22, 2009 at 3:48 PM, Slusher, Nicole wrote: > Hello,

[R] lmer() function

2009-04-22 Thread Ali Mahani
I'm trying to estimate a two-tier model with varying intercepts and slopes across 20 groups, with each group having about 50 observations and with no group predictor. I use the command lmer(y~x+(1+x | group)). But the result is a constant intercept (zero standard deviation, all 20 intercept values

Re: [R] function output with for loop and if statement

2009-04-22 Thread aaron wells
Mark, thanks for the suggestions. Unfortunately that did not fix the problem. I have experimented (with no success) with placing braces in different locations around the if/else statements and removing them all together. Thanks again, Aaron Date: Wed, 22 Apr 2009

[R] Rhelp

2009-04-22 Thread Slusher, Nicole
Hello, I am trying to run R on my Mac (OS10.5.6) and am having trouble installing and running packages (genefilter in particular in Bioconductor) I've tried re-installing R and it hasn't solved the issue. Thanks, ~Nicole Slusher __ R-help@r-project.

Re: [R] plot.logistic.fit.fnc

2009-04-22 Thread David Winsemius
On Apr 22, 2009, at 2:37 PM, Sarah Foster wrote: Hello, I can not get the function plot.logistic.fit.fnc() workingit returns "Error: could not find function "plot.logistic.fit.fnc"". Do I need to upload as specific package first? Yes: http://search.r-project.org/cgi-bin/namazu.cgi?query

[R] [R-pkgs] EVER_1.1

2009-04-22 Thread Diego Zardetto
Dear R users, Version 1.1 of the EVER package is on CRAN. EVER (the acronym stands for Estimation of Variance by Efficient Replication) is mainly intended for calculating estimates and standard errors from complex surveys. Variance estimation is based on the extended Delete-A-group Jackknife te

Re: [R] Count Code

2009-04-22 Thread David Winsemius
On Apr 22, 2009, at 3:42 PM, Bronagh Grimes wrote: Hi there, I am interested in converting SAS code to R & I wondered if anyone had any quick R code/tips for the following piece of test SAS code? Any feedback greatly appreciated. data A1; set A1; count + 1; by subject_id; if first.subjec

Re: [R] memory.limit

2009-04-22 Thread Francisco J. Zagmutt
Hello Stephen, I can confirm that I get the same behavior in my Windows machine. Here is a summary: > memory.limit() [1] 2046 > memory.limit(2092) Error in trunc(.Internal(memory.size(size))) : Non-numeric argument to mathematical function > memory.limit() [1] 2092 As you described, the fu

Re: [R] generate multipe output .csv files in a loop

2009-04-22 Thread Gabriel R. Rodriguez
What you can do is to name the file outside the write.csv statement file <- as.character(paste("file", i, ".csv", sep="")) write.csv(tempo, file) Gabriel Ing. Agr. Gabriel R. Rodriguez Inst. de Clima y Agua - CNIA INTA Castelar Las Cabañas y Los Reseros SN (1686) Hurlingham - Argentina

[R] function output with for loop and if statement

2009-04-22 Thread aaron wells
Hello all, turns out i'm having a bad R week. I am at my wits end with a function that I am trying to write. When I run the lines of code outside of a function, I get the desired output. When I wrap the lines of code into a function it doesn't work as expected. Not sure what is going on her

[R] How do I loop through strings?

2009-04-22 Thread dre968
I read in a CSV file with Data <- read.csv(file="FileName.csv",head=TRUE,sep=",") the file containts strings in the 2nd and 3rd columns and each has about 1000 rows. I need to either loop through the strings there looking for strings that would trigger other logic or remove those rows and put th

Re: [R] bladder1 dataset in survival library

2009-04-22 Thread Petra Buzkova
Petra, try either running update.packages() or installing R 2.9.0. Thanks Mark, I got it now. Thanks, Petra Petra Buzkova, PhD Department of Biostatistics University of Washington 206-897-1962 (phone) 206-616-4075 (fax) Marc Schwartz wrote: On Apr 2

[R] [R-pkgs] Sequence analysis with TraMineR 1.2

2009-04-22 Thread Alexis Gabadinho
Dear R users, The TraMineR package for mining, describing and visualizing sequences of states or events, and more generally discrete sequential data has been updated to version 1.2. Its primary aim is the analysis of biographical longitudinal data in the social sciences, such as data describin

[R] generate multipe output .csv files in a loop

2009-04-22 Thread Gator Connection
I need to generate output files as .csv file in a loop: let's say, I want to generate a sequence of files according to the loop number "i". the first file genearted should be file1.csv the second should be file2.csv I use: write.csv(temp, "file$i$.csv") in the loop but it did not work. can

[R] large factorials

2009-04-22 Thread molinar
I am working on a project that requires me to do very large factorial evaluations. On R the built in factorial function and the one I created both are not able to do factorials over 170. The first gives an error and mine return Inf. Is there a way to have R do these larger calculations (the c

[R] plot.logistic.fit.fnc

2009-04-22 Thread Sarah Foster
Hello, I can not get the function plot.logistic.fit.fnc() workingit returns "Error: could not find function "plot.logistic.fit.fnc"". Do I need to upload as specific package first? I am trying to check the fit of a mixed logistic model. Also, any advice for checking the assumption of inde

Re: [R] how to inspect content of save() file

2009-04-22 Thread Duncan Temple Lang
Hi Benno et al. I have had some code for reading RDA files via R functions and binary connections. It is available from http://www.omegahat.org/RDA or install.packages("RDA", repos = "http://www.omegahat.org/R";, dep = TRUE) It could be made faster if there is inte

[R] Count Code

2009-04-22 Thread Bronagh Grimes
Hi there, I am interested in converting SAS code to R & I wondered if anyone had any quick R code/tips for the following piece of test SAS code? Any feedback greatly appreciated. data A1; set A1; count + 1; by subject_id; if first.subject_id then count = 1; run;

Re: [R] R-User groups in North America (SF, LA, NYC, Ottawa)

2009-04-22 Thread Seeliger . Curt
Correction: > University of Oregon > http://www.fsl.orst.edu/R_users - (unknown if currently active) > Kenneth B. Pierce Jr. > ken.pierce oregonstate edu That's not University of Oregon, it's Oregon State University. U of O is in Eugene. They don't seem to be recently active in any cas

Re: [R] how to inspect content of save() file

2009-04-22 Thread MPI
Duncan Murdoch wrote: On 4/22/2009 12:59 PM, Benno Pütz wrote: Am 22.Apr.2009 um 17:21 schrieb Dimitri Liakhovitski: Why do you use save()? Can't you write out data frame(s) with your variables in a .txt or a .csv file and then read in just the variable names? I could, but ... As save()

Re: [R] Problem with "apply"

2009-04-22 Thread Tobias Verbeke
Marc Schwartz wrote: The cut() function will do what you want in a vectorized fashion. See ?cut However, that being said, I would strongly advise that you read Frank's page on the categorizing of continuous variables: http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/CatContinuous befo

Re: [R] Problem with "apply"

2009-04-22 Thread Marc Schwartz
The cut() function will do what you want in a vectorized fashion. See ? cut However, that being said, I would strongly advise that you read Frank's page on the categorizing of continuous variables: http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/CatContinuous before you proceed. HTH

Re: [R] Problem with "apply"

2009-04-22 Thread Jorge Ivan Velez
Hi Alan, You can avoid the if() else() you're using in your function by replacing it with the recode() function in the car package. I'm pretty sure it will speed up your function. See ?recode after loading the car package: require(car) ?recode HTH, Jorge On Wed, Apr 22, 2009 at 2:56 PM, Alan

Re: [R] Problem with "apply"

2009-04-22 Thread Erik Iverson
I'm not sure, but I think that using the "cut" function would solve your problem? ?cut On Wed, 22 Apr 2009 14:56:10 -0400, "Alan Cohen" wrote: > Hi R users, > > I am trying to assign ages to age classes for a large data set (123,000 > records), and using a for-loop was too slow, so I wrote a fu

[R] R-User groups in North America (SF, LA, NYC, Ottawa)

2009-04-22 Thread Michael E. Driscoll
Hi R folks, I'd like to announce several new R users groups here in SF, LA, NYC, and Ottawa - as well as their next scheduled event. The goal of these user groups, besides gently explaining 'drop=TRUE' to the uninitiated, is to exchange knowledge, promote best practices, and spur the adoption of

[R] Problem with "apply"

2009-04-22 Thread Alan Cohen
Hi R users, I am trying to assign ages to age classes for a large data set (123,000 records), and using a for-loop was too slow, so I wrote a function and used apply. However, the function does not properly assign the first two classes (the rest are fine). It appears that when age is one digi

Re: [R] How to make a time series object from a data frame containing dates.

2009-04-22 Thread Gabor Grothendieck
In particular, library(zoo) z <- zoo(x$alloc_gb, x$month) plot(z) See the three zoo vignettes vignette(package = zoo) # to list them vignette("zoo") # to show first one and the help files library(help = zoo) ?zoo On Wed, Apr 22, 2009 at 1:07 PM, stephen sefick wrote: > look at the zoo packag

[R] Returning Variables in R to Linux Shell

2009-04-22 Thread Bierbryer, Andrew
If I have an R script that I am executing from a command line in linux, do you know how I can return the value of the variable in my R script to the linux environment without writing it to a file in my R script and then reading the file through cat? For example, if I had a simple one line R

Re: [R] Deleting rows that contain certain characters...or deleting ANOVA factors

2009-04-22 Thread K. Elo
Hi, Crosby, Jacy R wrote: > > i.e. I'd like to have aov(Phen1~L1) use only Pat1-Pat4,and Pat 10. > Similarly, aov(Phen1~L2) should use Pat1, 6, and 10. > Etc. > > Is this something I can do in the aov function, or do I need to modify my > dataset before running aov? In either case, I

Re: [R] how to inspect content of save() file

2009-04-22 Thread Duncan Murdoch
On 4/22/2009 12:59 PM, Benno Pütz wrote: Am 22.Apr.2009 um 17:21 schrieb Dimitri Liakhovitski: Why do you use save()? Can't you write out data frame(s) with your variables in a .txt or a .csv file and then read in just the variable names? I could, but ... As save() writes a binary (and b

Re: [R] How to make a time series object from a data frame containing dates.

2009-04-22 Thread stephen sefick
look at the zoo package where there are quite a few functions to help with this. Stephen Sefick On Wed, Apr 22, 2009 at 11:09 AM, Lane, Jim wrote: > Hi, All > > I have a data frame like this. > >> names(x) > [1] "month"    "alloc_gb" > > One of the columns contains the dates I want to use: > >>

Re: [R] how to inspect content of save() file

2009-04-22 Thread Benno Pütz
Am 22.Apr.2009 um 17:21 schrieb Dimitri Liakhovitski: Why do you use save()? Can't you write out data frame(s) with your variables in a .txt or a .csv file and then read in just the variable names? I could, but ... As save() writes a binary (and by default compressed) format that is no

Re: [R] Help using spg optimization in BB package

2009-04-22 Thread Ravi Varadhan
Here is another approach using an augmented penalty lagragian method. The same example: fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 } fr.pen <- function(x, k=1e05) { fr(x) + k * ( 1 - sum(x))^2 } require(BB) spg(par=c(0,

Re: [R] Matrix package,solve() errors and crashes

2009-04-22 Thread Surendar Swaminathan
Hello Martin, Thanks for looking in to the problem. My mistake, I pasted the code for sparse matrix for the graph that was created by test.g <- simplify(ba.game(1000,m=2)) What I was intending to show was I have a graph object "g" created by IGRPAH. Please find the link that has the graph objec

[R] Deleting rows that contain certain characters...or deleting ANOVA factors

2009-04-22 Thread Crosby, Jacy R
I'm hoping there's an easier way to do this... I have a large matrix which looks like this (data=REG, rownames are the Pat1, Pat2,...): L1 L2 L3 Phen1 Phen2 Phen3 Pat1AA TT A? 143 143 143 Pat2AT ?A AT 256 256 NA Pat

Re: [R] Exporting objects plotted with plot3d() - rgl package

2009-04-22 Thread Duncan Murdoch
On 4/22/2009 12:18 PM, Alejandro González wrote: Dear all, Can anybody tell me how to export a 3d figure made with the plot3d function? I'm careless about whether it's still interactive or not in another format, as long I can get it out of R. snapshot3d() gets a bitmap in .png format. rgl.po

Re: [R] Exporting objects plotted with plot3d() - rgl package

2009-04-22 Thread David Winsemius
Pretty sure this question has been asked in the recent past and the answer was movie3d. -- David Winsemius On Apr 22, 2009, at 12:18 PM, Alejandro González wrote: Dear all, Can anybody tell me how to export a 3d figure made with the plot3d function? I'm careless about whether it's still int

[R] Exporting objects plotted with plot3d() - rgl package

2009-04-22 Thread Alejandro González
Dear all, Can anybody tell me how to export a 3d figure made with the plot3d function? I'm careless about whether it's still interactive or not in another format, as long I can get it out of R. Thanks! Alejandro González Departamento de Biodiversidad y Conservación Real Jardín Botánico Consejo

Re: [R] RES: How to force axis to have the same range

2009-04-22 Thread Deepayan Sarkar
On 4/22/09, Sebastien Bihorel wrote: > Thanks to all the people who answer my question. It is know clear to know > how to produce a square shape graph... but I guess there is no easy way to > force the x and the y axis to have the same limits. If you mean the general case where you don't want to

Re: [R] Returning Variables in R to Linux Shell

2009-04-22 Thread Barry Rowlingson
On Wed, Apr 22, 2009 at 3:48 PM, Bierbryer, Andrew wrote: > For example, if I had a simple one line R script that just did > >            string <- 'TEST', > > > > when I call > > /usr/local/bin/R -no-save < MY_R_FILE, > > > > how can I put the value TEST into a shell variable? You can use back

Re: [R] plot confidence intervals as shaded band

2009-04-22 Thread Bert Gunter
... or ?polygon in base graphics -- Bert Gunter -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dieter Menne Sent: Wednesday, April 22, 2009 8:23 AM To: r-h...@stat.math.ethz.ch Subject: Re: [R] plot confidence intervals as shaded

Re: [R] Returning Variables in R to Linux Shell

2009-04-22 Thread Whit Armstrong
try littler: warmstr...@linuxsvr2:/tmp$ export MYVALUE=`r -e 'cat(10)'` warmstr...@linuxsvr2:/tmp$ env|grep MYVALUE MYVALUE=10 warmstr...@linuxsvr2:/tmp$ On Wed, Apr 22, 2009 at 10:48 AM, Bierbryer, Andrew wrote: > If I have an R script that I am executing from a command line in linux, > do y

Re: [R] drawing a plot with SEM

2009-04-22 Thread David Winsemius
I realized after looking again that you asked for plotting. Since you only have two points per row, it would be more honest statistically to plot the values rather than mean and sem. > dm <-read.table(textConnection(" repeat1repeat2 + 13034 + 212

Re: [R] Help using spg optimization in BB package

2009-04-22 Thread Ravi Varadhan
Hi, Here is an example, with a correction to my previous email. fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 } require(BB) proj <- function(x, lower, upper) x / sum(x) # note: you need to specify "lower" and "upper" as argu

Re: [R] plot confidence intervals as shaded band

2009-04-22 Thread Dieter Menne
BARRES-DE-ALMEIDA U. durham.ac.uk> writes: > does anyone know how do I plot confidence intervals as a shaded band around a curve, rather than as errors bars? > http://had.co.nz/ggplot2/geom_smooth.html Dieter __ R-help@r-project.org mailing list htt

Re: [R] how to inspect content of save file

2009-04-22 Thread Dimitri Liakhovitski
Why do you use save()? Can't you write out data frame(s) with your variables in a .txt or a .csv file and then read in just the variable names? On Wed, Apr 22, 2009 at 5:12 AM, Benno Pütz wrote: > > Am 21.Apr.2009 um 19:16 schrieb Dimitri Liakhovitski: > > Can't you just read in the very first li

Re: [R] Problems with old version of R

2009-04-22 Thread Dimitri Liakhovitski
You don't have to uninstall the old version. Just install the new version. What I do then - I manually copy (in Windows Explorer) all the packages from the folder library that is under your old R version into the folder library under the new R version. And then I open the new R version and run upda

Re: [R] drawing a plot with SEM

2009-04-22 Thread David Winsemius
Assume the object in question is a dataframe named "dm": apply(dm, 1, mean) It worries me that you are asking for the sem's of two element objects, but if you really want it, the obvious modification to the above should work. On Apr 22, 2009, at 10:26 AM, ANJAN PURKAYASTHA wrote: I have

[R] How to make a time series object from a data frame containing dates.

2009-04-22 Thread Lane, Jim
Hi, All I have a data frame like this. > names(x) [1] "month""alloc_gb" One of the columns contains the dates I want to use: > data.class(x$month) [1] "yearmon" I would like to make a time series object out of this. However the ts function seems to require me to spell out the starting date

Re: [R] Help using spg optimization in BB package

2009-04-22 Thread Ravi Varadhan
You can try defining a "projection" function as follows: project <- function(x) x / sum(x) This should work fine. Let me know if you have any trouble. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professo

[R] Problems with old version of R

2009-04-22 Thread anupam sinha
Hi all, Presently I have R-2.6 version installed on my system. Because of this I am unable to install certain packages.Will an "updatepackages()" command help or would I have to uninstall the older version of R and then install the newer versions ? Can anyone help me out ? Thanks in adva

[R] drawing a plot with SEM

2009-04-22 Thread ANJAN PURKAYASTHA
I have a data matrix: repeat1repeat2 13034 21223 3 50 13 4 5698 . . . I would like to plot for the mean and standard error of mean of repeat 1 and repeat2 for each row. Any pointers on how to do this in R? T

[R] Garchoxfit output

2009-04-22 Thread Vasileios Ismyrlis
To whom it may concern, I have a problem with the garchOxFit function I use. I run it and I want to know if the Hessian matrix is computed. I attach a file with the output. Best regards, Vasileios Ismyrlis __ R-help@r-project.org mailing list https://stat

[R] plot confidence intervals as shaded band

2009-04-22 Thread BARRES-DE-ALMEIDA U.
Hi, does anyone know how do I plot confidence intervals as a shaded band around a curve, rather than as errors bars? many thanks, ulisses. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] RES: How to force axis to have the same range

2009-04-22 Thread Sebastien Bihorel
Thanks to all the people who answer my question. It is know clear to know how to produce a square shape graph... but I guess there is no easy way to force the x and the y axis to have the same limits. *Sebastien* Rodrigo Aluizio wrote: Hi Sebastien, take a look at the par(pty='s') argument.

[R] Help using spg optimization in BB package

2009-04-22 Thread dre968
i'm trying to use the BB package to minimize the sum of the squared deviations for 2 vectors. The only thing am having trouble with is defining the project constraint. I got the upper and lower bounds to work but i am not sure how to create a constraint that the sum of x must be 1. Any help wou

[R] Rép : How to compare parameters of non li near fitting curves - COMPLETE REPLY -

2009-04-22 Thread Etienne Toffin
Oups, I sent the email by error, as I was still writing my reply… Spencer, Le 22-avr.-09 à 03:33, spencerg a écrit : >Is your first model a special case of the second with eta1 = 0? > If yes, what about using 2*log(likelihood ratio) being approximately > chi-square? Yes, the firs

Re: [R] How to compare parameters of non linear fitting curves

2009-04-22 Thread Etienne Toffin
Spencer, Le 22-avr.-09 à 03:33, spencerg a écrit : Is your first model a special case of the second with eta1 = 0? If yes, what about using 2*log(likelihood ratio) being approximately chi-square? Yes, the first model is a special case of the second with eta1=0… Could you give me more e

Re: [R] Discover significant change in sorted vector

2009-04-22 Thread Gabor Grothendieck
Or just take every 10th point. On Wed, Apr 22, 2009 at 10:15 AM, Gabor Grothendieck wrote: > Try playing with the h= argument of breakpoints.  Another possibility > is to average each non-overlapping set of 10 points to reduce the > problem size to 80 and run breakpoints on that.  Might not be 1

Re: [R] read.table or read.csv without row index?

2009-04-22 Thread jim holtman
You need to convert to a matrix and remove names: > x <- read.table(textConnection("M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 + 1 9 11 14 15 18 20 20 20 20 20 + 2 3 4 8 9 11 12 14 15 15 15 + 3 4 5 8 8 9 9 9 9 9 9 + 4 4 5 7 8 8 8 8 8 8 9"), header=TRUE) > closeAllConnections() > y

Re: [R] Append to a csv file

2009-04-22 Thread Carlos Cuartas
Maybe each dataframe you are adding during the loop include the column name. I would add write.csv(mydata, file= “data.csv”=F, append=T,col.names=F) Hope that help Carlos To: r-help@r-project.org Sent: Monday, April 20, 2009 4:39:48 PM Subject: [R] Append

Re: [R] Discover significant change in sorted vector

2009-04-22 Thread Gabor Grothendieck
Try playing with the h= argument of breakpoints. Another possibility is to average each non-overlapping set of 10 points to reduce the problem size to 80 and run breakpoints on that. Might not be 1 sec but would likely be much faster. On Wed, Apr 22, 2009 at 9:45 AM, Hans-Henning Gabriel wrote:

Re: [R] read.table or read.csv without row index?

2009-04-22 Thread Sarah Goslee
Really, this depends on what you are trying to do. What's the underlying problem you are solving? You can save a data frame to a file without the names, if that's the real question, but I can't think of any reason to not want names within R. A matrix does not have to have row and column names, but

Re: [R] read.table or read.csv without row index?

2009-04-22 Thread Henrique Dallazuanna
Try this: unname(as.matrix(read.table('your_file.txt'))) On Wed, Apr 22, 2009 at 11:00 AM, tsunhin wong wrote: > Hello all, > > Probably my concepts about the data.frame and matrix and array in R > are not clear, I need some clarification to help me understand them > better. > > >M <- read.tabl

[R] read.table or read.csv without row index?

2009-04-22 Thread tsunhin wong
Hello all, Probably my concepts about the data.frame and matrix and array in R are not clear, I need some clarification to help me understand them better. >M <- read.table("test1.csv",sep=",",row.names=NULL,header=T) gives me: M as M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 1 9 11 14 15 18 20 20 20 20

Re: [R] Discover significant change in sorted vector

2009-04-22 Thread Hans-Henning Gabriel
Gabor, initially this looked like the perfect solution, exactly what I need. Unfortunately it is too expensive/costly. I have vectors of length 800 and more, my machine needs > 5 minutes (I aborted) to compute the breakpoints. Required is computation time < 1 sec. :) Any other suggestions

Re: [R] Merging data frames, or one column/vector with a data frame filling out empty rows with NA's

2009-04-22 Thread Sarah Goslee
Hi, How about this: > SNP5 <- merge(SNP4, SNP1[,2:3], all.x=TRUE) > SNP5 MarkerAnimal Y x 1 P1001 194073197 0.021088 2 2 P1002 194073197 0.021088 1 3 P1004 194073197 0.021088 2 4 P1005 194073197 0.021088 0 5 P1006 194073197 0.021088 2 6 P1007 194073197 0.021088 0 Thi

Re: [R] plotting with R

2009-04-22 Thread stephen sefick
check out ggplot2 there is an entire website devoted to the package (and a book also). The R graph gallery has graphs and the code to produce the graphs. hope this helps Stephen Sefick On Wed, Apr 22, 2009 at 9:01 AM, Christof Winter wrote: > Bala subramanian wrote, On 04/21/09 17:07: >> >> Fri

Re: [R] plotting with R

2009-04-22 Thread Christof Winter
Bala subramanian wrote, On 04/21/09 17:07: Friends, i) I am new to R. Kindly suggest some resources that has examples of plotting with R. I really like: http://zoonek2.free.fr/UNIX/48_R/03.html Cheers, Christof -- Christof Winter Bioinformatics Group Biotechnologisches Zentrum Technische Uni

Re: [R] Discover significant change in sorted vector

2009-04-22 Thread Charles Annis, P.E.
Please excuse my nit-picking: In physicists the third and fourth derivative of position are jerk (or jolt) and jounce, respectively. Impulse is the integral of force with respect to time. Charles Annis, P.E. charles.an...@statisticalengineering.com phone: 561-352-9699 eFax: 614-455-3265 http:/

Re: [R] Discover significant change in sorted vector

2009-04-22 Thread Gabor Grothendieck
Try this: > a <- c(2,3,3,5,6,8,8,9,15, 25, 34,36,36,38,41,43,44,44,46); > ix <- seq_along(a) > library(strucchange) > bp <- breakpoints(a ~ ix, h = 4) > bp Optimal 3-segment partition: Call: breakpoints.formula(formula = a ~ ix, h = 4) Breakpoints at observation number: 7 11 Correspon

Re: [R] Discover significant change in sorted vector

2009-04-22 Thread David Winsemius
On Apr 22, 2009, at 8:06 AM, Hans-Henning Gabriel wrote: Hans-Henning Gabriel wrote: Hi, suppose I have a simple sorted vector like this: a <- c(2,3,3,5,6,8,8,9,15, 25, 34,36,36,38,41,43,44,44,46); Is there a function in R, I can use to discover that from index 8 to index 11 the values ar

Re: [R] Discover significant change in sorted vector

2009-04-22 Thread Hans-Henning Gabriel
Hans-Henning Gabriel wrote: Hi, suppose I have a simple sorted vector like this: a <- c(2,3,3,5,6,8,8,9,15, 25, 34,36,36,38,41,43,44,44,46); Is there a function in R, I can use to discover that from index 8 to index 11 the values are changing significantly? The function should return a value

  1   2   >