[R] [R-pkgs] psych 1.2.8 has been released

2012-09-09 Thread William R Revelle
Dear fellow R users. I have released version 1.2.8 of the psych package. This replaces 1.2.4 from the April release. The more important changes o Modified score.irt so that subjects who miss all items or pass all items are given an estimate based upon the (product) of the

Re: [R] Rscript installing packages

2012-09-09 Thread Duncan Murdoch
On 12-09-10 2:03 AM, Diviya Smith wrote: Hi there I have an Rscript and I am looking for a way to install a package non-interactively. In Rscript {Utils}, I saw an example which does something like this, however this does not seem to work for my particular example. I am trying to install the fol

Re: [R] draw.key; getting grobWidth to respect fontfamily="mono"

2012-09-09 Thread Paul Murrell
Hi On 07/09/12 09:35, Benjamin Tyner wrote: Update: seems one way to skin this cat is to add gp = gpar(fontfamily="mono") to the viewport() call itself. If anyone has any suggestions for a robust way to extract this piece information from the key grob itself (it's nested several levels deep

[R] R- merging two matrix

2012-09-09 Thread Sridhar Iyer
Hi, I have two matrices. (same size, same number of rows, same names for the rows - one has data in sorted order, another one master data in unsorted order. I need to combine both). Rows names of Matrix A P, Q, R, S, T, U, V ...(some order) - each row has 4 values Row names of Matr

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

2012-09-09 Thread Rolf Turner
On 10/09/12 01:52, Fred wrote: Thanks Arun, I can manage something with that, just need then to delete the first raw with photoshop ! Huh? WTF? If you're doing that then you're doing something completely wrong and not understanding how R works. You didn't include the context of your question

[R] Solving a system of two equations

2012-09-09 Thread berg1546
Hi, I am trying to find a simple way to numerically solve a system of two equations equal to zero with two unknowns (x_loc and y_loc). Here is a mock data set and below it, the equations I need to solve. theta<-c(180,135,90)/(2*pi) x<-c(0,0,15) y<-c(20,0,0) 0 = -sum((y_loc-y)*(sin(theta)*(x_loc-

[R] Rscript installing packages

2012-09-09 Thread Diviya Smith
Hi there I have an Rscript and I am looking for a way to install a package non-interactively. In Rscript {Utils}, I saw an example which does something like this, however this does not seem to work for my particular example. I am trying to install the following package in an Rscript (without switc

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

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 wrote: > Thanks a lot Jim, it works a treat. Just had to change the date format > in the mCALL

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 wrote: > How about an improvement to 16 seconds. The first thi

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 close

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 a

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

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 A&M University College Station, TX 77843-4352 >

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 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 mobile device Envoyait de

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

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.

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

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

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"] <-

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 Dun

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 ... bu

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, an

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 fil

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 hig

[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] 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 Nabble.co

[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

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 need

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

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: