Re: [R] growing a list sequentially -- memory management

2008-11-14 Thread erwann rogard
icious that you are fragmenting memory > in other ways as well. > > Patrick Burns > [EMAIL PROTECTED] > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of S Poetry and "A Guide for the Unwilling S User") > > > erwann rogard wrote: > >> hell

[R] growing a list sequentially -- memory management

2008-11-13 Thread erwann rogard
hello, i have something like: out<-list() for(i in 1:n){ data<-gen(...) #fixed size data out[[i]]<- fun(data) } > object.size(out[[1]]) 6824 In principle 1 GB should allow n = 1024^3/6824 = 157347? i have about 2GB are not taken by other processes. however, I can see the memory shrinking q

[R] trellis: conditional statements within a panel function

2008-10-31 Thread erwann rogard
hello, what i'm trying to achieve is shown in the comment (# ...) below, which is surely very wrong, but probably intuitively more meaningful that i can provide in words. xyplot(y~x2|x1+which,data=make.groups( "a"=data.a, "b"=data.b, "c"=data.c ), panel=function(...){ panel.abline(a=0,b

Re: [R] Arrays of Trellis plots

2008-10-29 Thread erwann rogard
hi, xyplot(y~x2|x1+which,data= > > make.groups(dataframe1, dataframe2)) > > i'd like to replace the labels for dataframe1 and dataframe2 say with c("A","B"). is there a way? thanks! On Mon, Oct 27, 2008 at 2:23 PM, Deepayan Sarkar <[EMAIL PROTECTED]>w

Re: [R] Arrays of Trellis plots

2008-10-27 Thread erwann rogard
Thank you all, I've got everything I need now. On Mon, Oct 27, 2008 at 2:29 PM, <[EMAIL PROTECTED]> wrote: > > the example below does not work. (i know it's not supposed, but it makes > it > > clear what i'm trying to achieve) > > > > par(mfrow=c(2,1)) > > xyplot(y~x2|x1,data=dataframe1,pch=20) >

[R] Arrays of Trellis plots

2008-10-27 Thread erwann rogard
hello, the example below does not work. (i know it's not supposed, but it makes it clear what i'm trying to achieve) par(mfrow=c(2,1)) xyplot(y~x2|x1,data=dataframe1,pch=20) xyplot(y~x2|x1,data=dataframe2,pch=20) i know i could probably merge the two datasets and do something like xyplot(y~x2|x1

Re: [R] Extracting variables with a given prefix in the parent environment

2008-10-20 Thread erwann rogard
result<-list() >len<-nchar(prefix) >var.names<-ls(envir = envir,pattern=prefix) >print(var.names) >for(i in 1:length(var.names)){ > name<-var.names[i] > field<-substr(name,len+1,nchar(name)) > result[[field]]<-get(name, envir = envir) &g

[R] Extracting variables with a given prefix in the parent environment

2008-10-19 Thread erwann rogard
hi, get.vars.name.prefix<-function(prefix){ result<-list() len<-nchar(prefix) var.names<-ls(name=1,pattern=prefix) #name=1 probably wrong option print(var.names) for(i in 1:length(var.names)){ name<-var.names[i] field<-substr(name,len+1,nchar(name)) result[[field]]<-get(name) } result

Re: [R] passing a list where names arguments are expected

2008-10-19 Thread erwann rogard
Indeed, that's all I need. Thanks! On Sun, Oct 19, 2008 at 11:09 PM, Kaom Te <[EMAIL PROTECTED]> wrote: > I believe you want > > do.call(f, list(a =..., b=...)) > > ?do.call > -Kaom > > On Oct 19, 2008, at 7:55 PM, erwann rogard wrote: > > hi, >>

[R] passing a list where names arguments are expected

2008-10-19 Thread erwann rogard
hi, say i have a function f and i'd like to to call it like this: 1) f(list(a=...,b=...)) but i can't do it, because f is defined as: 2) f<-function(a=NULL,b=NULL){...} is there a way that i can approximate 1), such as mapping list(a=,...b=...) to "list(a=,...b=...)" and then replacing "list"

Re: [R] R-code in Latex --- $ sign causes error

2008-10-18 Thread erwann rogard
ite flexible and I > wouldn't be surprised if it can help you. Make sure to read the docs > (fancyvrb.pdf). > > /H > > On Fri, Oct 17, 2008 at 8:37 PM, erwann rogard <[EMAIL PROTECTED]> > wrote: > > Thanks for clarifying. Yes, \$ works in latex, but not *within* th

Re: [R] R-code in Latex --- $ sign causes error

2008-10-17 Thread erwann rogard
e output from R which in turn would be fed into latex or > Sweave > and then latex. Google this: special characters in latex > > On Fri, Oct 17, 2008 at 11:23 PM, erwann rogard <[EMAIL PROTECTED]> > wrote: > > Thanks, but unfortunately > > > > \begin{lstlisting

Re: [R] R-code in Latex --- $ sign causes error

2008-10-17 Thread erwann rogard
w Ph.D. > Statistical Data Center > Intermountain Healthcare > [EMAIL PROTECTED] > 801.408.8111 > > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > project.org] On Behalf Of erwann rogard > > Sent: Friday, October 17, 2008 5:18

[R] R-code in Latex --- $ sign causes error

2008-10-17 Thread erwann rogard
hi, here's what i have: \lstset{ basicstyle=\ttfamily, keywordstyle=\bfseries, showstringspaces=false, columns = fullflexible, mathescape = true, language=R } \begin{lstlisting} lst$val<-val \end{lstlisting} ./software.tex:16:Extra }, or forgotten \endgroup. lst$ the culprit here is

[R] Trellis, conditioning on more than 2 variables,

2008-10-13 Thread erwann rogard
hello, i need help with: data$f1<-as.factor(data$f1) data$f2<-as.factor(data$f2) s3<-equal.count(data$s2,number=3) densityplot(~y| f1 + f2 + s3, data=mydata ) this produces 3 plots, *successively*, one for each value of s3. i was hoping it would produce one plot. is trellis limited to 2 condi