Re: [R] Producing a table with mean values

2012-09-09 Thread John Kane
My stupdity I made a late edit for clarity and forgot to run it to be sure I had changed everything. It should read: tabx - ddply(meltx, .(Seamount, variable), summarize, mean = mean(value), sd = sd(value)) My appologies. John Kane Kingston ON Canada -Original Message- From:

[R] Error msg in rpanel

2012-09-09 Thread Dr Subramanian S
I am working on the r panel package. Now if i have a function that uses a radiogroup button, and if i attempt to run the function from inside the rpanel menu, i get this error: Error in panel$intname : $ operator is invalid for atomic vectors However if i run the function per se i.e. not from

Re: [R] method or package to make special boxplot

2012-09-09 Thread Jim Lemon
On 09/09/2012 12:14 AM, Zhang Qintao wrote: Hi, All, I am trying to use R to make the following type of boxplot while I couldn't find a way to do it. My dataset looks like X1 Y1 X2 Y2 SPLIT. The split highlights my experiment details and both x and y are continuous numerical values. I

[R] use subset to trim data but include last per category

2012-09-09 Thread Giovanni Azua
Hello, I bumped into the following funny use-case. I have too much data for a given plot. I have the following data frame df: str(df) 'data.frame': 5015 obs. of 5 variables: $ n : Factor w/ 5 levels 1000,2000,..: 1 1 1 1 1 1 1 1 1 1 ... $ iter : int 10 20 30 40 50 60 70

Re: [R] Problem with duplicates in row.names

2012-09-09 Thread Fred
Thanks Arun, I can manage something with that, just need then to delete the first raw with photoshop ! Thanks Fred -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-duplicates-in-row-names-tp4642518p4642604.html Sent from the R help mailing list archive at

[R] how to save a heatmap.2 in png /jpeg /tiff

2012-09-09 Thread STADLER Frederic
Hey, I am still working on my heat map (for those who are read my previous post about row.names)… Now, I would like to save my heat map.2 in .png or .tiff in order being able to work on the picture in photoshop, but it doesn't work. I'am using (as I have found on some forum) png(heatmap.2.png)

Re: [R] how to save a heatmap.2 in png /jpeg /tiff

2012-09-09 Thread Sarah Goslee
Normally the workflow is: png(heatmap.png) # don't forget the second quote, as you did below my.plot.code # whatever you need to draw the heatmap dev.off() # people often forget this step - did you? You'll probably want to adjust the size and resolution settings for png() to get the desired

Re: [R] how to save a heatmap.2 in png /jpeg /tiff

2012-09-09 Thread Jeff Newmiller
It just doesn't work could mean anything... and for those of us for whom it does work, that leaves a lot of possible differences between your case and ours. This is your cue to read the Posting Guide. Some issues I have encountered: If you are using Windows, and you have opened a graphics file

Re: [R] use subset to trim data but include last per category

2012-09-09 Thread Jeff Newmiller
dfthin - df[ c(which(iter %% 500 == 0),nrow(df) ] or dfthin - subset(df, (iter %% 500 == 0) | (seq.int(nrow(df)==nrow(df))) N.B. You should avoid using the name df for your variables, because it is the name of a built-in function that you are hiding by doing so. Others may be confused, and

Re: [R] use subset to trim data but include last per category

2012-09-09 Thread Giovanni Azua
Hi Jeff, Thanks for your help, but this doesn't work, there are two problems. First and most important I need to keep the last _per category_ where my category is n and not the last globally. Second, there seems to be an issue with the subset variation that ends up not filtering anything ...

Re: [R] use subset to trim data but include last per category

2012-09-09 Thread William Dunlap
I would like to change the subset clause to be iter %% 500 _or_ the record is the last per n If your data.frame df is sorted by n you can define the function isLastInRun - function(x) c(x[-1] != x[-length(x)], TRUE) and use it as subset(df, iter %% 500 == 0 | isLastInRun(n)) Bill

Re: [R] use subset to trim data but include last per category

2012-09-09 Thread Giovanni Azua
Hello, This solves my problem in a horribly inelegant way that works: df - data.frame(n=newInput$n, iter=newInput$iter, Error=newInput$Error, Duality_Gap=newInput$Duality, Runtime=newInput$Acc) df_last - aggregate(x=df$iter, by=list(df$n), FUN=max) names(df_last)[names(df_last)==Group.1] - n

Re: [R] [Rscript] difficulty passing named arguments from commandline

2012-09-09 Thread Tom Roche
https://github.com/TomRoche/GEIA_to_netCDF/commit/62ad6325d339c61ac4e7de5e7d4d26fa21ed918c # - Rscript ./netCDF.stats.to.stdout.r netcdf.fp=./GEIA_N2O_oceanic.nc var.name=emi_n2o # fails # + Rscript ./netCDF.stats.to.stdout.r 'netcdf.fp=./GEIA_N2O_oceanic.nc' 'var.name=emi_n2o' #

[R] PCA legend outside of PCA plot

2012-09-09 Thread Tinus Sonnekus
Hi All, I have been trying to get to plot my PCA legend outside of the PCA plot, but success still alludes me. Can you guys please advise how I can achieve this. I used locater() to obtain coordinates for below the Comp.1 axis. Using these coordinates the legend disappears. Below is the code

Re: [R] Error msg in rpanel

2012-09-09 Thread Subramanian
If I run the whole code and click on the addition menu and then click Add, the error comes. But not when I just call add(). So I guess the problem is not with the rpanel package. Also tried panel[vars] instead of panel$vars. no luck. Same error when I call the add function from the rpanel GUI.

Re: [R] how to save a heatmap.2 in png /jpeg /tiff

2012-09-09 Thread Fred
hey Sarah, thanks for your help !! Of Course I put the second quote also (I forgot to put it on the last post). Sorry, I don't get the my.plot.code... # I'm new in R and use it only to draw heatmaps right now. Well, I did forget the dev.off(). # but I got null device (1) # when quartz is turned

Re: [R] how to save a heatmap.2 in png /jpeg /tiff

2012-09-09 Thread Fred
Hey Jeff, sorry for the it just doesn't work, but it's really what it does... I can't find any file called heatmap.2.png on my computer after creating my heatmap.2 (that I can see on Quartz) and typing: png(heatmap.2.png) Maybe I should add, that I am working on mac with MAC OS X (v.10.8.1).!!

Re: [R] how to save a heatmap.2 in png /jpeg /tiff

2012-09-09 Thread Hasan Diwan
Mr Stadler, On 9 September 2012 10:36, Fred frederic.stad...@unifr.ch wrote: But I don't have any files called heatmap.2.png on my computer. I really don't understand why I don't get anything ! What does getwd() print out as a path? Check there for the your file. -- H -- Sent from my

Re: [R] PCA legend outside of PCA plot

2012-09-09 Thread David L Carlson
Try adding the parameter xpd=TRUE to your legend() statement. Without reproducible code it is pretty hard to be sure what the problem is. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352

[R] Sum of column from another df based of row values of df1

2012-09-09 Thread Shivam
Dear All, I need to sum a column from another dataframe based on the row values of one dataframe. I am stuck in a loop trying to accomplish it and at current speed it will take more than 80 hours to complete. Needless to say I am looking for a more elegant/quicker solution. Really need some help

Re: [R] Sum of column from another df based of row values of df1

2012-09-09 Thread jim holtman
How about an improvement to 16 seconds. The first thing to do is to convert you data to a matrix because accessing data in a dataframe is very expensive. If you run Rprof on your code you will see that all the time is spent in retrieving the information. Converting to a matrix and using matrix

Re: [R] how to save a heatmap.2 in png /jpeg /tiff

2012-09-09 Thread Rui Barradas
Hello, Em 09-09-2012 18:36, Fred escreveu: hey Sarah, thanks for your help !! Of Course I put the second quote also (I forgot to put it on the last post). Sorry, I don't get the my.plot.code... What Sarah meant is that you must put your.plot.code between the instructions that open and

Re: [R] Sum of column from another df based of row values of df1

2012-09-09 Thread Shivam
Thanks a lot Jim, it works a treat. Just had to change the date format in the mCALL as well. But you saved me 80 hours of fretting and frustration. Really thankful for it. Regards, Shivam On Mon, Sep 10, 2012 at 1:33 AM, jim holtman jholt...@gmail.com wrote: How about an improvement to 16

Re: [R] Sum of column from another df based of row values of df1

2012-09-09 Thread Shivam
Just to add, I did not know that the speed of data access is so much different in matrix and dataframes. This is one for the future. Thanks again Jim :) -Shivam On Mon, Sep 10, 2012 at 3:29 AM, Shivam shivamsi...@gmail.com wrote: Thanks a lot Jim, it works a treat. Just had to change the date

Re: [R] how to save a heatmap.2 in png /jpeg /tiff

2012-09-09 Thread David Winsemius
On Sep 9, 2012, at 7:04 AM, STADLER Frederic wrote: Hey, I am still working on my heat map (for those who are read my previous post about row.names)∑ Now, I would like to save my heat map.2 in .png or .tiff in order being able to work on the picture in photoshop, but it doesn't work. I'am