Re: [R] plot() > point names ?

2009-10-12 Thread Daniel Malter
I think you are looking for this: x=rnorm(6,10,1) e=rnorm(6,0,1) y=x+e plot(y~x,xlim=c(min(x)-2,max(x)+2),ylim=c(min(y)-2,max(y)+2)) text(x,y,pos=1,labels=c("Prof","CEO","Janitor","Admin","Farmer","Fire Chief")) HTH, Daniel - cuncta stricte discussurus

[R] plot() > point names ?

2009-10-12 Thread Robert U
Dear R-users, I am using the simple plot() function and i cannot find a way to add the point label (i would like to plot the points and up to each point the point name). I found a way to do it with n.plot but then the point is not plotted, only the label. Do you know if there is a parameter for

Re: [R] Binding objects with a similar name

2009-10-12 Thread jimdare
Thanks Jim, Further from this; the data I have doen't appear to be that complete for some species e.g result$MOO 1992 2000 2002 3060 1300 1300 How can I change this list into a time series so that I can create a meaningful plot e.g. 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2

Re: [R] Kolmogorov smirnov test

2009-10-12 Thread Moshe Olshansky
Hi Roslina, I believe that you can ignore the warning. Alternatively, you may add a very small random noise to pairs with ties, i.e. something like xobs[which(duplicated(xobs))] <- xobs[which(duplicated(xobs))] + 1.0e-6*sd(xobs)*rnorm(length(which(duplicated(xobs Regards, Moshe. --- On Tu

Re: [R] How to choose a proper smoothing spline in GAM of mgcv package?

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 10:10 PM, Yan Li wrote: Hi, there, I have 5 datasets. I would like to choose a basis spline with same knots in GAM function in order to obtain same basis function for 5 datasets. Moreover, the basis spline is used to for an interaction of two covarites. It is possibl

[R] appending to a file with R CMD batch and chron

2009-10-12 Thread stephen sefick
I am sure that there is a much easier way of doing this, but this is what I have figured out so far. I would like to run a script that downloads USGS data and parses it, and run this with as a cron process every night at x o'clock and append the output to a file. Can I run it like the following:

Re: [R] gee: suppress printout

2009-10-12 Thread Rolf Turner
On 13/10/2009, at 2:55 PM, joshua wells wrote: I'm using the function gee from the library(gee) gee(Y~X,id=clust.id,corstr="exchangeable",b=tmc$coef,family=binomial (link=logit),silent=T) Every time it runs, it dutifully prints out Beginning Cgee S-function, @(#) geeformula.q 4.13 9

Re: [R] gee: suppress printout

2009-10-12 Thread cls59
joshua wells wrote: > > > Unfortunately, i run thousands of these and the output gets extremely > lengthy. Is there any way to suppress this printout in R? > > Thank you, > > Josh > > One function that comes to mind is sink() which allows you to red

Re: [R] vis.gam() contour plots

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 8:20 PM, Jason Gasper wrote: Greetings, I have what I hope is a simple question. I would like to change my contour interval on the vis.gam( plot.type="contour") in the mgcv package. Is this a situation where I need to modify the function or is there a default value

[R] How to choose a proper smoothing spline in GAM of mgcv package?

2009-10-12 Thread Yan Li
Hi, there, I have 5 datasets. I would like to choose a basis spline with same knots in GAM function in order to obtain same basis function for 5 datasets. Moreover, the basis spline is used to for an interaction of two covarites. I used "cr" in one covariate, but it can only smooth w.r.t 1 covari

Re: [R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-12 Thread cls59
wk yeo wrote: > > > Hi, all, > > My objective is to split a dataframe named "cmbine" according to the value > of "classes". After the split, I will take the first instance from each > class and bin them into a new dataframe, "df1". In the 2nd iteration, I > will take the 2nd available instanc

Re: [R] Re use objects from within a custom made function

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 7:06 PM, Stropharia wrote: Hi everyone, i'm having a problem extracting objects out of functions i've created, so i can use them for further analysis. Here's a small example: # --- test <- function(i, j){ x <- i:j y <- i*j

Re: [R] Re use objects from within a custom made function

2009-10-12 Thread Stropharia
Thanks a lot Tony and Daniel for making that clear. best, Steve Stropharia wrote: > > Hi everyone, > > i'm having a problem extracting objects out of functions i've created, so > i can use them for further analysis. Here's a small example: > > # --- > test <- functi

[R] variable selection

2009-10-12 Thread Weiwei Shi
Hi there, Can anyone suggest some packages in R doing variable selections in predictive modeling besides randomForest? Faster, better. Any also in clustering analysis? Thanks, Weiwei -- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. "Did you always know?" "No, I did not. But I believed..."

[R] gee: suppress printout

2009-10-12 Thread joshua wells
I'm using the function gee from the library(gee) gee(Y~X,id=clust.id,corstr="exchangeable",b=tmc$coef,family=binomial(link=logit),silent=T) Every time it runs, it dutifully prints out Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 user's initial regression estimate

Re: [R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-12 Thread cls59
wk yeo wrote: > > > Hi, all, > > My objective is to split a dataframe named "cmbine" according to the value > of "classes". After the split, I will take the first instance from each > class and bin them into a new dataframe, "df1". In the 2nd iteration, I > will take the 2nd available instanc

[R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-12 Thread wk y
Hi, all, My objective is to split a dataframe named "cmbine" according to the value of "classes". After the split, I will take the first instance from each class and bin them into a new dataframe, "df1". In the 2nd iteration, I will take the 2nd available instance and bin them into another new

[R] vis.gam() contour plots

2009-10-12 Thread Jason Gasper
Greetings, I have what I hope is a simple question. I would like to change my contour interval on the vis.gam( plot.type="contour") in the mgcv package. Is this a situation where I need to modify the function or is there a default value I can change? Thanks _

[R] Lattice barchart-reordered

2009-10-12 Thread Veerappa Chetty
Hi,Can I use "reorder" function with barchart as in dotchart? Here are some codes which do not work for me. Thanks Chetty ___ a1c.cast$bmi.cat.reordered[a1c.cast$eth!="Other"] <-with(a1c.cast[a1c.cast$eth!="Other",],reorder(bmi.cat.ordered[a1c.cast$eth!="Other"], BP.FN.RATE

Re: [R] Re use objects from within a custom made function

2009-10-12 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Stropharia > Sent: Monday, October 12, 2009 4:07 PM > To: r-help@r-project.org > Subject: [R] Re use objects from within a custom made function > > > Hi everyone, > > i'm havin

Re: [R] Re use objects from within a custom made function

2009-10-12 Thread Tony Plate
test$x doesn't evaluate the function, you want something like test(1,2)$x, e.g.: test <- function(i, j){ x <- i:j y <- i*j z <- i/j return(list(x=x,y=y,z=z)) } test(1,2)$x [1] 1 2 test(1,2)$y [1] 2 test(1,2)$z [1] 0.5 Or if you want to avoid evaluating y

[R] Re use objects from within a custom made function

2009-10-12 Thread Stropharia
Hi everyone, i'm having a problem extracting objects out of functions i've created, so i can use them for further analysis. Here's a small example: # --- test <- function(i, j){ x <- i:j y <- i*j z <- i/j return(x,y,z) } # -

[R] Kolmogorov smirnov test

2009-10-12 Thread Roslina Zakaria
Hi r-users,   I would like to use Kolmogorov smirnov test but in my observed data(xobs) there are ties.  I got the warning message.  My question is can I do something about it?   ks.test(xobs, xsyn)       Two-sample Kolmogorov-Smirnov test data:  xobs and xsyn D = 0.0502, p-value = 0.924 al

Re: [R] How to hide tick lines behind the "box-and-whisker" 's in a boxplot

2009-10-12 Thread Peter Ehlers
Helmer, You can just place another boxplot on top of the first like this: boxplot(x) axis(2,tck=1,col.ticks='grey',lty=5 ) boxplot(x, col="white", add=TRUE) -Peter Ehlers Helmer Belbo wrote: Dear R people, I wonder how to hide tick lines behind other figures in a plot, e.g. in a boxpl

[R] Invoking par(mfrow...) on an already subdivided plot

2009-10-12 Thread Maxwell Reback
I'd like to generate on a single device multiple plots, each of which contains two plots. Essentially, I've got sub-plots which consist of two tracks, the upper one displaying gene expression data, and the lower one mapping position. I'd like to display four of these two-track sub-plots on one devi

Re: [R] What is the correct way to define __hash__?

2009-10-12 Thread Peng Yu
On Mon, Oct 12, 2009 at 4:03 PM, Robert Kern wrote: > On 2009-10-12 15:45 PM, Peng Yu wrote: >> >> Hi, >> >> I'm wondering what is the general way to define __hash__. I could add >> up all the members. But I am wondering if this would cause a >> performance issue for certain classes. > > Unless if

Re: [R] how to output profile plots for groups using lattice package

2009-10-12 Thread Peter Ehlers
Hi George, Your problem is not with xyplot, but with the NA occurrences in your data. Try adding subset = {!is.na(MSE)}, to your xyplot call, or (better), subset the data before calling xyplot. -Peter Ehlers George Kalema wrote: Hi Peter (and anyone else willing to help me out), Many than

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Peter Ehlers
One other way that is sometimes useful is to use the tick.number argument as in: xyplot(yield ~ nitro, data=Oats, scales=list(x=list(tick.number=4)), subset=Variety=="Victory" ) This is especially handy if you want to just tick/label every other value. -Peter Ehlers Jacob Wegelin wrote:

Re: [R] lapply / mapply and assignments

2009-10-12 Thread Gabor Grothendieck
Try: mapply(..., SIMPLIFY = FALSE) On Mon, Oct 12, 2009 at 5:25 PM, Magnus Torfason wrote: > I have a list of isometric structures, and I want to change the same part of > each structure in the list, assigning one element of a vector to each of > these parts. > > In other words, I want to achiev

Re: [R] lapply / mapply and assignments

2009-10-12 Thread Charles C. Berry
Hmmm, after thinking about it, better see ?mapply SIMPLIFY logical; attempt to reduce the result to a vector or matrix? Try mapply( ..., SIMPLIFY=FALSE ) HTH, Chuck On Mon, 12 Oct 2009, Magnus Torfason wrote: I have a list of isometric structures, and I wan

Re: [R] lapply / mapply and assignments

2009-10-12 Thread Charles C. Berry
On Mon, 12 Oct 2009, Magnus Torfason wrote: I have a list of isometric structures, and I want to change the same part of each structure in the list, assigning one element of a vector to each of these parts. In other words, I want to achieve the following: l <- list( list(a=1,b=2), list(a=3

[R] lapply / mapply and assignments

2009-10-12 Thread Magnus Torfason
I have a list of isometric structures, and I want to change the same part of each structure in the list, assigning one element of a vector to each of these parts. In other words, I want to achieve the following: > l <- list( list(a=1,b=2), list(a=3,b=4)) > unlist(lapply(l, "[[", "a")) [1] 1 3

Re: [R] how to plot a data by different group

2009-10-12 Thread Ista Zahn
Hi Catherine, Assuming your variables are in a dataframe called myData, some variation of the following may be what you want: library(ggplot2) myData.m <- melt(myData, measure.vars=c("Y1", "Y2")) qplot(X, value, colour=variable, shape=groupf3, facets=groupf1~groupf2, geom="point", data=myData.m)

Re: [R] crosstabulation and unlist function

2009-10-12 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of eugen pircalabelu > Sent: Monday, October 12, 2009 1:06 PM > To: David Winsemius > Cc: R-help > Subject: Re: [R] crosstabulation and unlist function > > Hello, > First of all, th

Re: [R] Binding objects with a similar name

2009-10-12 Thread jim holtman
Instead of creating a lot of variables, work with a list. Since you did not supply any test data, I will make a guess at the code would be like: result <- lapply(split(newdataset, newdataset$target_species), function(.spec){ tappy(.spec$total_hook_num, .spec$year, sum) }) You can summarize f

[R] how to plot a data by different group

2009-10-12 Thread catherineLF
Dear everyone, sorry to bother you. I have a big data, suppose it has 200 groups and each group has 100 data. So the data have 2 observations in total. The variables are groupf1 groupf2 groupf3 X Y1 Y2 1 11 1 0.5 0.5 groupf1, groupf2 and groupf3 are

[R] Binding objects with a similar name

2009-10-12 Thread jimdare
Dear R users, The code below splits a dataset by "target_species" and then further splits each target species group by year. Finally the sum of a variable called "total_hook_num" is calculated and then assigned a name based on (paste(a$target_species[1],a$year[1],sep=""). newsplit<-split(newd

Re: [R] crosstabulation and unlist function

2009-10-12 Thread rmailbox
What you're really saying is that you don't care about the distinction between "aa", "bb" and "cc". In that case, a different arrangement of the data will be more useful: library (reshape ) df.melt <- melt ( df, id.var = "dd") with ( df.melt, table ( dd, value ) ) Eric - Original messag

Re: [R] Creating object referant from argument name

2009-10-12 Thread jim holtman
try this: (?get) j<- get(paste("list",substring(input,3,3),sep="")) On Mon, Oct 12, 2009 at 4:14 PM, Maxwell Reback wrote: > Hi all. I'd like to define an object within a function based on an > argument to that function. > Specifically, I've got: > > do.something<-function(input){ > id<-substri

Re: [R] Creating object referant from argument name

2009-10-12 Thread Rolf Turner
On 13/10/2009, at 9:14 AM, Maxwell Reback wrote: Hi all. I'd like to define an object within a function based on an argument to that function. Specifically, I've got: do.something<-function(input){ id<-substring(input,3,3) j<-list1 if(id==2)j<-list2 if(id==3)j<-list3 if(id==4)j<-list4 ...} In

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Bert Gunter
>> What principle is at work? > > A strange one called "standard non-standard evaluation"; see > > http://developer.r-project.org/nonstandard-eval.pdf > > for a nice overview by Thomas Lumley. > > > ?xyplot says: > > data: For the 'formula' method, a data frame containing values (or >

[R] Creating object referant from argument name

2009-10-12 Thread Maxwell Reback
Hi all. I'd like to define an object within a function based on an argument to that function. Specifically, I've got: do.something<-function(input){ id<-substring(input,3,3) j<-list1 if(id==2)j<-list2 if(id==3)j<-list3 if(id==4)j<-list4 ...} Instead of all these if() arguments, I was hoping to us

Re: [R] crosstabulation and unlist function

2009-10-12 Thread eugen pircalabelu
Hello, First of all, thank you David for your reply, but sadly this is not what i wanted (i am sorry for not being more specific about my problem!) aa<-c(1:5) bb<-c(NA,2,NA,4,5) cc<-c(1,2,NA,4,NA) dd<-c("A","B","B","A","C") table(unlist(df[,1:3])) > df aa bb cc dd 1 1 NA 1 A 2 2 2

Re: [R] crosstabulation and unlist function

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 3:25 PM, David Winsemius wrote: On Oct 12, 2009, at 2:36 PM, eugen pircalabelu wrote: Hello R-users, My toy example: aa<-c(1:5) bb<-c(NA,2,NA,4,5) cc<-c(1,2,NA,4,NA) dd<-c("A","B","B","A","C") df<-data.frame(aa,bb,cc,dd=as.factor(dd)) table(unlist(df[,1:3])) Can anyone

Re: [R] crosstabulation and unlist function

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 2:36 PM, eugen pircalabelu wrote: Hello R-users, My toy example: aa<-c(1:5) bb<-c(NA,2,NA,4,5) cc<-c(1,2,NA,4,NA) dd<-c("A","B","B","A","C") df<-data.frame(aa,bb,cc,dd=as.factor(dd)) table(unlist(df[,1:3])) Can anyone point me to what function let's me do a crosstabulation

Re: [R] Trendline for a subset of data

2009-10-12 Thread Greg Snow
Others have show how to use the segments function, but this can also be done using the original abline function along with the clip function. Here is an example: plot( iris$Petal.Width, iris$Petal.Length, col=c('red','green','blue')[iris$Species]) tmp <- levels(iris$Species) tmp2 <- p

[R] How to hide tick lines behind the "box-and-whisker" 's in a boxplot

2009-10-12 Thread Helmer Belbo
Dear R people, I wonder how to hide tick lines behind other figures in a plot, e.g. in a boxplot. # Sample code: x<- c(rep(4,50),rep(5,20),rep(6,50),rnorm(20,5,1)) boxplot(x) axis(2,tck=1,col.ticks='grey',lty=5 ) # end of sample code The tick lines is put on top of the box-plot, but I would li

Re: [R] Using diff, ifelse on zoo object

2009-10-12 Thread Gabor Grothendieck
The problem is that ifelse does not work the way you might think (see value section of ?ifelse) and basically should not be used with three zoo objects unless the three arguments to ifelse have the same time index. We can get that effect by using na.pad = TRUE in your diff call: TradedRate <-

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Romain Francois
On 10/12/2009 08:30 PM, Deepayan Sarkar wrote: On Mon, Oct 12, 2009 at 9:32 AM, Jacob Wegelin wrote: When we call a lattice function such as xyplot, to what extent does the "data" designation cause the function to look inside the "data" for variables? In the examples below, the "subset" argume

Re: [R] Using tabs in output instead of spaces

2009-10-12 Thread Erik Iverson
?write.table is probably a good starting point. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of ws > Sent: Monday, October 12, 2009 1:39 PM > To: r-h...@stat.math.ethz.ch > Subject: [R] Using tabs in output instead of spaces >

[R] Using tabs in output instead of spaces

2009-10-12 Thread ws
Is there a way to have xtabs and friends use tabs in their output to separate columns rather than spaces? It would be great for importing into other software. TIA! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Mark Kimpel
Thanks Tony (and others). Setting oma corrects the problem. Mark Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry Indiana University School of Medicine 15032 Hunter Court, Westfield, IN 46074 (317) 490-5129 Work, & Mobile & VoiceMail (317) 399-1219 Skype No Voicemail please On Mon

[R] crosstabulation and unlist function

2009-10-12 Thread eugen pircalabelu
Hello R-users, My toy example: aa<-c(1:5) bb<-c(NA,2,NA,4,5) cc<-c(1,2,NA,4,NA) dd<-c("A","B","B","A","C") df<-data.frame(aa,bb,cc,dd=as.factor(dd)) table(unlist(df[,1:3])) Can anyone point me to what function let's me do a crosstabulation between table(unlist(df[,1:3])) and df$dd? I wan

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Deepayan Sarkar
On Mon, Oct 12, 2009 at 9:32 AM, Jacob Wegelin wrote: > When we call a lattice function such as xyplot, to what extent does > the "data" designation cause the function to look inside the "data" > for variables? > > In the examples below, the "subset" argument understands that > "Variety" is a vari

Re: [R] mkdir in R?

2009-10-12 Thread Henrique Dallazuanna
Try dir.create On Mon, Oct 12, 2009 at 3:00 PM, Peng Yu wrote: > Hi, > > Besides calling shell command mkdir by system(), I'm wondering if > there is a buildin command in R to make a new directory. > > Regards, > Peng > > __ > R-help@r-project.org maili

Re: [R] mkdir in R?

2009-10-12 Thread Erik Iverson
?dir.create > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Peng Yu > Sent: Monday, October 12, 2009 1:01 PM > To: r-h...@stat.math.ethz.ch > Subject: [R] mkdir in R? > > Hi, > > Besides calling shell command mkdir by system(

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Bert Gunter
Deepayan will correct me if I'm wrong, but I'm pretty sure that the answer is that it looks in the frame in the data argument only for variables in the formula argument. Note that the fact that it also works for the subset argument is explicitly mentioned therein: subset: logical or integer index

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-12 Thread baptiste auguie
Interesting, I hadn't tried this but it probably explains why navigation to different regions of a layout is neither documented nor advisable. Yet another alternative is to use Grid graphics. In particular, 1- lattice or ggplot2 provide ways to arrange several plots in a rectangular layout, with

[R] mkdir in R?

2009-10-12 Thread Peng Yu
Hi, Besides calling shell command mkdir by system(), I'm wondering if there is a buildin command in R to make a new directory. Regards, Peng __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] Speed up and limit memory usage of lm()

2009-10-12 Thread Dieter Menne
gauti wrote: > > > I have been doing series of linear regression models lm(). In this case > the execution time and memory usage becomes a huge issue. I have therefore > been trying to speed the process and limit the memory usage. > > Have a look at package biglm. Dieter -- View this m

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-12 Thread Greg Snow
This only works if all the plots are the same size and the defaults are used for the margins. Try it with different sized figure regions in layout, the added lines don't match at the end. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.4

Re: [R] Ordinal response model

2009-10-12 Thread Dieter Menne
drlucyasher wrote: > > > The questionnaire has a section which contains a particular issue and then > questions which are related to this issue (and potentially to each other): > 1) importance of the issue (7 ordinal categories from -3 to +3) > 2) impact of the impact (7 ordinal categroies fro

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-12 Thread Greg Snow
Since you are using LaTeX, you might consider creating the plots all in 1 step, but use the tikzdevice, this provides LaTeX (pgf) commands to create the plot that you can then insert LaTeX commands to built up the plot bit by bit. You could also look at using the subplot function in the Teachin

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Simon Bonner
Hey Mark, The text is actually there -- I can just see the bottom of the 'y' and the 'p' in my plotting window. You can move the text down (into the plot) with the argument line. E.g.: mtext(text = "my test plots", side = 3, outer = TRUE, line=-2) Hope that helps... - Simon Bonner Post-Doctor

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Dieter Menne
Mark Kimpel wrote: > > I'm trying to use mtext to create a main title over multiple plots. Below > is > a simple self-contained example and my sessionInfo (I should note I've > also > tried this with R-2.8.1 with the same results). When I execute the code > > ... > > > Thanks for your nice

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 1:41 PM, Tony Plate wrote: Try playing around with the "oma" setting in par() -- it sets the outer margins, which by default are zero. The following shows the mtext label for me, using the windows device: par(mfrow=c(2,2)) par("oma") [1] 0 0 0 0 par("oma"=c(0,0,2,0))

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Tony Plate
Try playing around with the "oma" setting in par() -- it sets the outer margins, which by default are zero. The following shows the mtext label for me, using the windows device: par(mfrow=c(2,2)) par("oma") [1] 0 0 0 0 par("oma"=c(0,0,2,0)) for (i in 1:4) plot(0:1,0:1) mtext(text = "my test

[R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Mark Kimpel
I'm trying to use mtext to create a main title over multiple plots. Below is a simple self-contained example and my sessionInfo (I should note I've also tried this with R-2.8.1 with the same results). When I execute the code chunk below, I get the plots, but no title. I've tried this using the scre

Re: [R] spectral analysis

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 5:24 AM, sdlywjl666 wrote: Dear all£¬ Is there some functions to estimate the spectrum by the fft of autocorrelation? The blindingly obvious search terms: fft spectrum autocorrelation ... in two hops to what appears to be a function to this: Auto And/Or Cross

[R] combining/overlaying boxplot and barplot

2009-10-12 Thread Soenario, Ivan (KNMI)
Dear all, I would like to visualise when days are rainy or dry in bar/boxplots. Therefore I've tried to combine raingauge data (boxplots) and percentage of raingauges with 0mm measurements (barplot). See attachment mei2004.pdf (if it came through). I've come this far: barplot(dcp0[monthindex], c

[R] xyplot does not find variable in data

2009-10-12 Thread Jacob Wegelin
When we call a lattice function such as xyplot, to what extent does the "data" designation cause the function to look inside the "data" for variables? In the examples below, the "subset" argument understands that "Variety" is a variable in the data. But the "scales" argument does not understand t

Re: [R] field index given name.

2009-10-12 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of tdm > Sent: Monday, October 12, 2009 12:22 AM > To: r-help@r-project.org > Subject: Re: [R] field index given name. > > > Thanks - would never have guessed that. I eventually go

Re: [R] R commander.

2009-10-12 Thread David Winsemius
You seem to have gotten an extraneous list item called "Chromosome" to which an empty string has been assigned. What happens if you issue this command: ann2 <- data.frame( Name=ann$Name, Position=ann$Position, Chr.num=factor(ann$Chr.num) ) (I took the liberty of making Chr.num into a fact

Re: [R] spectral analysis

2009-10-12 Thread stephen sefick
fft, specturm, and there is an auto correlation function (I don't remember which one). On Mon, Oct 12, 2009 at 4:24 AM, sdlywjl666 wrote: > Dear all, >    Is there some functions to estimate the spectrum by the fft of > autocorrelation? > Is there Parzen's lag window in R ?Thank you! > Best wish

[R] Ordinal response model

2009-10-12 Thread drlucyasher
I have been asked to analyse some questionnaire data- which is not data I'm that used to dealing with. I'm hoping that I can make use of the nabble expertise (again). The questionnaire has a section which contains a particular issue and then questions which are related to this issue (and potentia

[R] tktext-window smaller than text

2009-10-12 Thread Anne Skoeries
Hi there, I need to build up a tktext-widget that contains a longer text than the tktext-widget actually is. So what I mean is, that the tktext window is of width=100 and the text in it has a length greater 100. But I don't want the window to just wrap the line, but to belong to scrollba

[R] Vector Allocation -problem

2009-10-12 Thread premmad
When i tried running Zip<-sqldf("select a.*,b.s_lv from Zip a inner join lin b on a.S=B.S") Error: cannot allocate vector of size 15.6 Mb and with following warning Warning messages: 1: In as.list.data.frame(X) : Reached total allocation of 1024Mb: see help(memory.size) 2: In as.list.data.frame

Re: [R] R commander.

2009-10-12 Thread joris meys
As the error says, you have different row numbers in your variables. The variable $Chromosome has no values. try : ann <- data.frame( ann [-3] ) Cheers Joris On Mon, Oct 12, 2009 at 8:29 AM, Ilyas . wrote: > i have two RData files,,i want to print them to check the format of the > tables in the

[R] Speed up and limit memory usage of lm()

2009-10-12 Thread gauti
Hi all I have been doing series of linear regression models lm(). In this case the execution time and memory usage becomes a huge issue. I have therefore been trying to speed the process and limit the memory usage. Here follows part of the code do give better understanding of what I am d

[R] Using diff, ifelse on zoo object

2009-10-12 Thread charliegenge
Hi, I'm having an issue when using diff and ifelse on a zoo object. x.Date <- as.Date("2003-02-01") + c(1, 3, 7, 9, 14) - 1 x <- zoo(rnorm(5), x.Date) x.POS <- c(0,0,0,1,1) x<- merge(x,x.POS) x x x.POS 2003-02-01 -0.1858136 0 2003-02-03 -1.3188533

[R] spectral analysis

2009-10-12 Thread sdlywjl666
Dear all£¬ Is there some functions to estimate the spectrum by the fft of autocorrelation? Is there Parzen's lag window in R ?Thank you! Best wishes! Wang [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://st

Re: [R] how to output profile plots for groups using lattice package

2009-10-12 Thread George Kalema
Hi Peter (and anyone else willing to help me out), Many thanks for your help. Having used your code plus a few other modifications, I only get the points plotted but without the two lines. I just cannot figure out what the problem is. My code is as follows: library(lattice) datos2 <- subset(datos

[R] R commander.

2009-10-12 Thread Ilyas .
i have two RData files,,i want to print them to check the format of the tables in these files,,,i can load both the files and can read it as well > load('ann.RData') > str(ann) List of 4 $ Name : chr [1:561466] "rs3094315" "rs12562034" "rs3934834" "rs9442372" ... $ Position : int [1:561466

[R] function: ploting an igraph object within lattice

2009-10-12 Thread Andrewjohnclose
Hi, I would like to be able to develop a function to plot an igraph object with lattice (trellis type displays will be usefull for grouping etc). Anyway, I mostly feeble Igraph requires that you convert two columns of data two an igraph object and to be able to plot the graph...I have tried a ve

[R] need help

2009-10-12 Thread MOH MOHA
Sample Size λ=5      α = 4       β = 3 Min. 1St Qu. Median Mean 3rd Qu. Max. 100 0.00 1.740638 4.040032 4.433828 5.607589 22.450405 5

[R] Fwd: Error: cannot allocate vector of size 1.2 Gb

2009-10-12 Thread romunov
To save for posterity, I include an email from Joris who's advice solved my problem. Lession learned is to check your data before passing it along to a function. Cheers, Roman -- Forwarded message -- From: joris meys Date: Mon, Oct 12, 2009 at 4:01 PM Subject: Re: [R] Error: cann

[R] RPostgreSQL and needed .dlls

2009-10-12 Thread Josuah Rechtsteiner
Dear List, I am trying to connect from R 2.9.2 on Win XP SP3 to a remotely installed PostgreSQL DB (8.3.7 on Ubuntu Server 9.04). Everything seems to be properly installed, as I can connect to the DB from within Excel and RKWard (running on another machine). But regarding R on the Win XP, I

Re: [R] List mappings and variable creation

2009-10-12 Thread Sundar Dorai-Raj
Hi, Michael, Seems like all you need is aggregate and rbind: x <- aggregate(saw.aggr.data["value"], saw.aggr.data[c("conversion.type", "filteredID", "metric")], sum) x$bucketID <- "combined" y <- rbind(saw.aggr.data, x) Is this what you need? --sundar On Mon, Oct

Re: [R] Error: cannot allocate vector of size 1.2 Gb

2009-10-12 Thread joris meys
That's the file I needed, and the problem I expected. The factor you specify is not a factor, but a numerical variable. Even more, if you tabulate it, you have 2 times the values "1", "2" and "5", and all other values only once. That's what gives you the error. p is an internal variable of the fun

Re: [R] Nelder-Mead with output of simplex vertices

2009-10-12 Thread Ted Harding
On 12-Oct-09 13:33:17, Ted Harding wrote: > On 12-Oct-09 13:24:01, Terry Therneau wrote: >> -- begin included >> Greetings! >> I want to follow the evolution of a Nelder-Mead function >> minimisation (a function of 2 variables). Hence each simplex >> will have 3 vertices. >> >> Th

Re: [R] R and computer size

2009-10-12 Thread Martin Morgan
Vibe Henriette Skov wrote: > Dear R-mailing list > > Hope you can help me. I am using R for windows to analyze my 107 > HGU133Plus2.0 chips, however, R chrash when I try to use ReadAffy(). I > want to buy a computer that can handle all these arrays, do you know how > big a computer I need to buy?

Re: [R] Nelder-Mead with output of simplex vertices

2009-10-12 Thread Ted Harding
On 12-Oct-09 13:24:01, Terry Therneau wrote: > -- begin included > Greetings! > I want to follow the evolution of a Nelder-Mead function > minimisation (a function of 2 variables). Hence each simplex > will have 3 vertices. > > Therefore I would like to have a function which can o

Re: [R] svy / weighted regression

2009-10-12 Thread David Winsemius
I think you are missing the point. You have 4 zero death counts associated with much higher person years of exposure followed by 4 death counts in the thousands associated with lower degrees of exposures. It seems unlikely that these are real data as there are not cohorts that would exhibit

Re: [R] Nelder-Mead with output of simplex vertices

2009-10-12 Thread Terry Therneau
-- begin included Greetings! I want to follow the evolution of a Nelder-Mead function minimisation (a function of 2 variables). Hence each simplex will have 3 vertices. Therefore I would like to have a function which can output the coordinates of the 3 vertices after each new simp

Re: [R] svy / weighted regression

2009-10-12 Thread Laust
Dear Peter, Thanks for the input. The zero rates in some strata occurs because sampling depended on case status: In Finland only 50% of the non-cases were sampled, while all others were sampled with 100% probability. Best Laust On Sat, Oct 10, 2009 at 11:02 AM, Peter Dalgaard wrote: > Sorry, fo

[R] R and computer size

2009-10-12 Thread Vibe Henriette Skov
Dear R-mailing list Hope you can help me. I am using R for windows to analyze my 107 HGU133Plus2.0 chips, however, R chrash when I try to use ReadAffy(). I want to buy a computer that can handle all these arrays, do you know how big a computer I need to buy? Best, Skov, Denmark [[altern

[R] List mappings and variable creation

2009-10-12 Thread Michael Pearmain
Hi All, I have a questions about associative list mappings in R, and if they are possible? I have data in the form show below, and want to make a new 'bucket' variable called combined. Which is the sum of the control and the exposed metric values This combined variable is a many to many matching

Re: [R] is that possible to graph 4 dimention plot

2009-10-12 Thread joris meys
I'm basically put off by the question itself. Plotting a 4-dimensional graph is rather "complicated" if the world has only 3 dimensions. A 4-dimensional representation is typically a movie (with time as the 4th dimension). You could try to project a heatmap on a 3D surface graph, but I doubt this w

Re: [R] Position of legend box

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 4:07 AM, ogbos okike wrote: Good morning to you. I have about 4 different lines in one plot. I have used legend to indicate the colour of each plot. But the box contain the legend covers part of the lines thereby blurring the legend. There are some spaces in the plot th

Re: [R] field index given name.

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 3:22 AM, tdm wrote: Thanks - would never have guessed that. I eventually got the following to do what I want... colprob <- array(dim=NCOL(iris)) for(i in 1:NCOL(iris)){ + colprob[i]= + ifelse(names(iris)[i] == 'Species',1,0.5) + } colprob [1] 0.5 0.5 0.5 0.5 1.0

  1   2   >