[R] Simple question, name of the variable as string.

2010-09-16 Thread C.H.
Dear R users, I have a very simple question and I've tried to search for the answer. (But failed.) there should be a function (func) that work like > abc <- c(1,2,3,4) > func(abc) "abc" I would like to know the name of that function. Thank you very much for your help. Regards, CH -- CH Chan

Re: [R] Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function

2010-09-16 Thread Michael Bedward
Cool. If you get some code working and don't mind sharing it please post it here. Michael On 17 September 2010 16:49, Sunny Srivastava wrote: > Thanks Michael for your help. At least its good to know that there is no > function which does what I wanted. I will definitely try to code something >

Re: [R] Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function

2010-09-16 Thread Sunny Srivastava
Thanks Michael for your help. At least its good to know that there is no function which does what I wanted. I will definitely try to code something that fulfills my requirements. Regards, S. On Fri, Sep 17, 2010 at 2:32 AM, Michael Bedward wrote: > Hello Sunny, > > Defining groups at a given hei

Re: [R] Converting tables to matrices

2010-09-16 Thread selthy
Thanks so much! I realise that probably seems very simple to you, but you've just saved me hours of struggling with syntax and commands I'm not very familiar with...excellent. Cheers, Selthy -- View this message in context: http://r.789695.n4.nabble.com/Converting-tables-to-matrices-tp2543309p25

Re: [R] R Founding

2010-09-16 Thread Peter Dalgaard
On 09/17/2010 12:14 AM, Jeremy Miles wrote: >> I know from organizing a conference in Germany that the only really good way >> was and is ordinary money transfer via BIC and IBAN numbers. Unfortunately, >> this system is pretty unknown in the US. Europeans can easily use money >> transfer to the R

Re: [R] KMedians clustering in R

2010-09-16 Thread Shubha Vishwanath Karanth
Thanks all. But I was looking for "KMedian" algorithm and not the "KMedoids" algorithm. The wiki says, " Note that this algorithm is often confused with k-medoids, which finds the optimal medoid, not median, for each cluster. (A medoid is an actual point from the dataset; a median is the mathema

Re: [R] Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function

2010-09-16 Thread Michael Bedward
Hello Sunny, Defining groups at a given height can be done with the cut function (see ?cut.dendrogram). Unfortunately, cut doesn't give you the option of specifying a number of clusters rather than a height in the way that cutree does for "hclust" objects. Perhaps someone else here knows of a pac

Re: [R] Odp: Programming: loop versus vector oriented

2010-09-16 Thread Petr PIKAL
Hi Jan but I think this is how your code really works. Did you try it? Regards Petr Jan private napsal dne 16.09.2010 13:22:05: > Hello Petr, > > > If you want to get results of your function for a vector of reynolds and > > dk you can use function outer and probably get rid of for cycle in

Re: [R] Calculate difference between dates in years

2010-09-16 Thread nzcoops
Just expanding on Brians code to something that will work for vector. age_years <- function(first, second) { lt <- data.frame(first, second) age <- as.numeric(format(lt[,2],format="%Y")) - as.numeric(format(lt[,1],format="%Y")) first < as.Date(paste(format(lt[,1],format="%Y"),"-",

[R] Nonlinear programming problem

2010-09-16 Thread Xiaoxi Gao
Hello useRs, I'm using the command "solnp" in package "Rsolnp" to solve a general nonlinear programming problem. But I got an error that " the leading minor of order 15 is not positive definite ". Can anybody tell what may cause this error? Does it have something to do with the starting values

Re: [R] Was the package installed correctly (SOLVED)

2010-09-16 Thread Stephen Liu
Hi folks, Re: Installation of rgl and tkrplot Problem solved as follows; On Debian 504 64-bit console:- $ sudo aptitude remove r-cran-rgl $ sudo aptitude remove r-cran-tkrplot $ sudo aptitude install libglu1-mesa-dev $ sudo aptitude install tk8.5-dev On R 1) > install.packages("rgl", depen

Re: [R] Converting tables to matrices

2010-09-16 Thread Michael Bedward
Oops, that should have been result[[1]], not results[[1]] On 17 September 2010 15:03, Michael Bedward wrote: > Hello Selthy, > > Here's one way. Assume your tables are called x.trt and x.cont > > # form a single matrix > x <- cbind(x.trt, x.cont) > colnames(x) <- c("Ntrt", "BPtrt", "Ncon", "BPcon

Re: [R] Converting tables to matrices

2010-09-16 Thread Michael Bedward
Hello Selthy, Here's one way. Assume your tables are called x.trt and x.cont # form a single matrix x <- cbind(x.trt, x.cont) colnames(x) <- c("Ntrt", "BPtrt", "Ncon", "BPcon") result <- apply( x, 1, function(xrow) fisher.test( matrix(xrow, nrow=2) ) ) Now result is a list where element i holds

[R] Converting tables to matrices

2010-09-16 Thread selthy
Hi there, I'm a real beginner to R. I have two tables of the following format (~1000 rows in each): Table 1 (experimental) Nbp 1064 12312089 856 12312234 Table 2 (control) 846334728908 879 34443290 . I would like to do Fisher's exact tests comparing each row of th

Re: [R] convert to csv file

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 10:55 PM, lord12 wrote: In order to use the extension csv, is the syntax: write.table(table_list, file= paste("file", x, sep = "").csv, sep = ",") ? Nope. You cannot just tack strings on the end of function calls. Try: write.table(table_list, file= paste("file", x, ".

Re: [R] convert to csv file

2010-09-16 Thread Bill.Venables
no. Your best way is to use write.csv(table_list, file = paste("file", x, ".csv", sep="")) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of lord12 Sent: Friday, 17 September 2010 12:55 PM To: r-help@r-project.org Subject: Re: [R

Re: [R] convert to csv file

2010-09-16 Thread lord12
In order to use the extension csv, is the syntax: write.table(table_list, file= paste("file", x, sep = "").csv, sep = ",") ? Also I pretty much create a table by doing: table_list= cbind(c1,c2,c3,c4) where c1...c4 are vectors. -- View this message in context: http://r.789695.n4.nabble.com

Re: [R] Making heatmaps

2010-09-16 Thread wns09a
Sorry. Must've skipped over the posting guide in your reply. Pitfalls of mobile posting. I'll retry this more correctly when I have all the resources and code in front of me. -- View this message in context: http://r.789695.n4.nabble.com/Making-heatmaps-tp2543201p2543274.html Sent from the

Re: [R] convert to csv file

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 10:22 PM, lord12 wrote: I want to open the file in excel and I want the columns in my table to be lined up with the columns in excel. Generally one would use an extension of .csv in that instance, and you may need to move the column headers over one cell because the

Re: [R] convert to csv file

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 10:17 PM, lord12 wrote: write.table(table_list, file= paste("file", x, sep = ""), sep = ",") My output is still a file object. Wasn't that the point? -- View this message in context: http://r.789695.n4.nabble.com/convert-to-csv-file-tp2543232p2543251.html Sent from

Re: [R] Making heatmaps

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 10:21 PM, wns09a wrote: I didn't try to attach anything... Just wondering what to do with the matrix after that. You didn't post an example. image() and heatmap() are pretty similar, as the help page for heatmap informs you in the first sentence. The question is what

Re: [R] convert to csv file

2010-09-16 Thread lord12
write.table(table_list, file= paste("file", x, sep = ""), sep = ",") My output is still a file object. -- View this message in context: http://r.789695.n4.nabble.com/convert-to-csv-file-tp2543232p2543251.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] convert to csv file

2010-09-16 Thread lord12
I want to open the file in excel and I want the columns in my table to be lined up with the columns in excel. -- View this message in context: http://r.789695.n4.nabble.com/convert-to-csv-file-tp2543232p2543256.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Making heatmaps

2010-09-16 Thread wns09a
I didn't try to attach anything... Just wondering what to do with the matrix after that. -- View this message in context: http://r.789695.n4.nabble.com/Making-heatmaps-tp2543201p2543254.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Was the package installed correctly

2010-09-16 Thread Stephen Liu
Hi Bill, Thanks for your advice. OS - Debian 504 64-bit $ apt-cache search rgl r-cran-misc3d - GNU R collection of 3d plot functions and rgl-based isosurfaces r-cran-rgl - GNU R package for three-dimensional visualisation using OpenGL sanduhr - An alarm clock designed as an hourglass $ sudo a

Re: [R] Making heatmaps

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 9:04 PM, wns09a wrote: Basically, I have the location data for about 1,000 pitches. I can get them to show up correctly on normal plots, but I am genuinely messed up on heatmaps. location <- read.csv('C:/Users/William/Downloads/09Location.csv') location <- as.matrix(l

Re: [R] convert to csv file

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 9:49 PM, lord12 wrote: I have a command: write.table(table_list, file= paste("file", x, sep = "")) where x is the file name. How do I convert this file into a csv file in this statement? By using a sep argument of "," for write.table or using the pre- packaged write.

[R] convert to csv file

2010-09-16 Thread lord12
I have a command: write.table(table_list, file= paste("file", x, sep = "")) where x is the file name. How do I convert this file into a csv file in this statement? -- View this message in context: http://r.789695.n4.nabble.com/convert-to-csv-file-tp2543232p2543232.html Sent from the R help mail

Re: [R] Combining Data Sets w/ Weights

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 8:33 PM, btpagano wrote: Hello All, I am still a beginner with R, and I only have a week or two under my belt so far. I'm working with NHANES anthropometric data on stature. I have two sets of data that have different statistical weights. I'm trying to combine tho

[R] Combining Data Sets w/ Weights

2010-09-16 Thread btpagano
Hello All, I am still a beginner with R, and I only have a week or two under my belt so far. I'm working with NHANES anthropometric data on stature. I have two sets of data that have different statistical weights. I'm trying to combine those two data sets into one "mega-set" while retaining eac

[R] Making heatmaps

2010-09-16 Thread wns09a
Basically, I have the location data for about 1,000 pitches. I can get them to show up correctly on normal plots, but I am genuinely messed up on heatmaps. > location <- read.csv('C:/Users/William/Downloads/09Location.csv') > location <- as.matrix(location) Like I said, that can get a plot fine

[R] Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function

2010-09-16 Thread Sunny Srivastava
Hello R-Helpers, I have a question about extracting the clusters of genes after we make the heatmap (say ht4) using the heatmap.2 function. Basically, I want to get the clusters which are shown as row dendrogram in the heatmap. I understand that ht4$rowDendrogram is an object of dendrogram and it

Re: [R] Was the package installed correctly

2010-09-16 Thread Bill.Venables
It means that two of the packages on which "TeachingDemos" depends were not installed correctly, namely "rgl" and "tkplot". The problem could be that you do not have the system dependencies in place. For rgl these are listed as: SystemRequirements:OpenGL, GLU Library, zlib (optiona

Re: [R] Was the package installed correctly

2010-09-16 Thread Joshua Wiley
On Thu, Sep 16, 2010 at 5:40 PM, Stephen Liu wrote: > > Hi folks, > > > On R > >> install.packages("TeachingDemos", dependencies=TRUE) > .. > installing to /usr/local/lib/R/site-library/mapproj/libs > ** R > ** inst > ** preparing package for lazy loading > ** help > *** installing help indice

Re: [R] R Founding

2010-09-16 Thread Juliet Hannah
Hi Group, I have a possibly naive question, but it seems like it fits into this discussion. I have observed that when researchers publish findings that are deemed to be high-impact, generous funding often follows. R is used everywhere, and, of course, for many of these projects. So my naive que

[R] Was the package installed correctly

2010-09-16 Thread Stephen Liu
Hi folks, On R > install.packages("TeachingDemos", dependencies=TRUE) .. installing to /usr/local/lib/R/site-library/mapproj/libs ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ... ** testing if installed package can be loa

Re: [R] test to see if a s4 property is assigned?

2010-09-16 Thread Martin Morgan
On 09/16/2010 02:23 PM, darckeen wrote: > >> > setClass("person",representation(age="numeric",weight="numeric"),prototype(age=NULL,weight=NULL)) > [1] "person" >> bob <- new("person",age=30) > Error in validObject(.Object) : > invalid class "person" object: invalid object for slot "weight" in c

Re: [R] Help with graphic margin

2010-09-16 Thread Filoche
Hi there and thank you for reply. I have been trying that, using mar to set margin around each plot and oma to specify bottom space. However, it wont display the xlab. Here's my code : pdf(file="/home/persican/Desktop/test.pdf", width = 3.5, height = 5.6, pointsize = 8); par(mfcol = c(3,1), m

Re: [R] R Founding

2010-09-16 Thread Matt Shotwell
On Thu, 2010-09-16 at 17:30 -0400, Tal Galili wrote: > Hello dear Jaroslaw, > I strongly agree with you that the R foundation should have an easier method > of enabling people to give donations. > At the same time, I feel there is a (friendly) disagreement between us on > how such money should be u

Re: [R] How do I create a plotable zoo object based on weekly data?

2010-09-16 Thread Gabor Grothendieck
On Thu, Sep 16, 2010 at 8:50 AM, Michael Green wrote: > Dear readers, > > The problem is simple: I have weekly time series data with a maximum > week number of (52,53,52,52) in (2008,2009,2010,2011) respectively. That > means I have a dataset looking like this: > > 2008-01 value > 2008-02 value >

[R] glm: formula vs character

2010-09-16 Thread Krishna Tateneni
Hello, This is a question motivated by curiosity, not a pressing problem. Any responses are much appreciated! In the following code, function reg1 calls glm with a formula object while reg2 uses a string. In both cases, glm works; however, in the second case, the add1 function fails with the fo

Re: [R] R Founding

2010-09-16 Thread Ravi Varadhan
Enjoyed it very much! -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Tal Galili Sent: Thursday, September 16, 2010 5:31 PM To: jaropis Cc: r-h...@stat.math.ethz.ch; lig...@statistik.tu-dortmund.de; da...@revolutionanalytics.com Subj

Re: [R] If statements for multiple arrays

2010-09-16 Thread David Winsemius
I see Joshua has kindly offered some resources to turn you from your path of erroR and sins against the interpreteR, but if you want to do extra penance, you might consider reading the R-FAQ (although your issue if if and "&&" is surprisingly not included there) : http://cran.r-project.org/

Re: [R] finding complex roots in R

2010-09-16 Thread Toros Caglar
Thanks a lot. This helps a lot. Toros On Thu, Sep 16, 2010 at 4:29 PM, Ravi Varadhan wrote: > Beware that you are likely to have multiple, or even infinitely many, roots > in the complex plane.  In the first example, there are infinitely many > roots, which are equal to +/- 1i  * (N * pi), where

Re: [R] If statements for multiple arrays

2010-09-16 Thread Phil Spector
George - I think you're looking for the ifelse function: X = c(100,125,110,90) Y = c(200,110,150,200) Z = c(125,105,130,75) AA = c(150,140,200,65) result = ifelse(X < Z & Y > Z,AA - Z,NA) result [1] 25 NA 70 NA result[!is.na(result)] [1] 25 70 (I'm assuming you said 50 when you meant 70.)

Re: [R] function help?

2010-09-16 Thread Duncan Murdoch
On 16/09/2010 5:00 PM, Rolf Turner wrote: On 17/09/2010, at 8:51 AM, Duke wrote: Hi Duncan, On 9/16/10 3:47 PM, Duncan Murdoch wrote: On 16/09/2010 3:40 PM, Duke wrote: Hi all, I am writing a function (fun.R), but I dont know how to code the function so that the Help Text will be shown u

Re: [R] If statements for multiple arrays

2010-09-16 Thread Joshua Wiley
Hello George, Two things should help you move from one case to multiple. First, if is designed for a single result (TRUE or FALSE), but you actually want many, so you can use the ifelse() function. Second, since you want to examine each element, you just want '&', not '&&'. I believe this does

Re: [R] R Founding

2010-09-16 Thread Jeremy Miles
> I know from organizing a conference in Germany that the only really good way > was and is ordinary money transfer via BIC and IBAN numbers. Unfortunately, > this system is pretty unknown in the US. Europeans can easily use money > transfer to the R foundation. > Paypal? Many open source projec

[R] If statements for multiple arrays

2010-09-16 Thread George Coyle
Hello, I wrote this code which works fine on a single observation: x<-100 y<-200 z<-125 aa<-150 if(xz) {aa-z} result: 25 I am trying to apply this logic where x,y,z,and aa are arrays but with very little success. I have tried using loops and whiles but I always get errors of various types. I h

Re: [R] R Founding

2010-09-16 Thread Tal Galili
Hello dear Jaroslaw, I strongly agree with you that the R foundation should have an easier method of enabling people to give donations. At the same time, I feel there is a (friendly) disagreement between us on how such money should be used. Your massage has inspired me to write a post on the topic

[R] Revolutions Blog: August Roundup

2010-09-16 Thread David Smith
I write about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related to R from the month of August: http

[R] Multivariate linear model versus univariate linear model and interaction

2010-09-16 Thread Chun (Jimmie) Ye
Hi, I have a quick question regarding the merits of modeling data using a multivariate linear model versus a univariate linear model with an interaction term. Here's the data set. Say I have gene expression from two tissues liver and kidney and I'm interested in identifying differentially expresse

Re: [R] R Founding

2010-09-16 Thread David Smith
On Thu, Sep 16, 2010 at 12:45 PM, Duncan Murdoch wrote: > >  On 16/09/2010 3:29 PM, Kevin Wright wrote: >> >> Revolution has given back in a number of ways: supporting the useR >> conference, assisting R core with getting R to build on 64-bit Windows >> systems, bug fixes, releasing some open sour

Re: [R] test to see if a s4 property is assigned?

2010-09-16 Thread darckeen
> setClass("person",representation(age="numeric",weight="numeric"),prototype(age=NULL,weight=NULL)) [1] "person" > bob <- new("person",age=30) Error in validObject(.Object) : invalid class "person" object: invalid object for slot "weight" in class "person": got class "NULL", should be or extend

Re: [R] IP address

2010-09-16 Thread RICHARD M. HEIBERGER
Is this a Windows system behind a firewall? Can you reach the CRAN mirrors directly from Internet Explorer? If yes to both, then you need to use setInternet2(TRUE) before doing the package installations from the RConsole menu. See the Windows FAQ and the ?setInternet2 for more details. On Thu,

Re: [R] function help?

2010-09-16 Thread Rolf Turner
On 17/09/2010, at 8:51 AM, Duke wrote: > Hi Duncan, > > On 9/16/10 3:47 PM, Duncan Murdoch wrote: >> On 16/09/2010 3:40 PM, Duke wrote: >>> Hi all, >>> >>> I am writing a function (fun.R), but I dont know how to code the >>> function so that the Help Text will be shown up when one types ?fun

Re: [R] Weibull simulation- number of items to replace is not a multiple of replacement length

2010-09-16 Thread Phil Spector
Perhaps the following will be instructive: mymat = matrix(1:6,3,2) p = 1 mymat[p] [1] 1 mymat[p,] [1] 1 4 When you index a matrix by a single subscript, it returns a single element, corresponding to the columnwise vector representation of the matrix. I'm guessing you want to put the estimat

Re: [R] Survival Analysis Daily Time-Varying Covariate but Event Time Unknown

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 4:43 PM, David Winsemius wrote: On Sep 16, 2010, at 12:14 PM, smm7aa wrote: Help! I am unsure if I can analyze data from the following experiment. Fish were placed in a tank at (t=0) Measurements of Carbon Dioxide were taken each day for 120 days (t=0,...120) A few f

Re: [R] function help?

2010-09-16 Thread Duke
Hi Duncan, On 9/16/10 3:47 PM, Duncan Murdoch wrote: On 16/09/2010 3:40 PM, Duke wrote: Hi all, I am writing a function (fun.R), but I dont know how to code the function so that the Help Text will be shown up when one types ?fun (of course, after he loads it up). Anyone has any advice for

[R] Weibull simulation- number of items to replace is not a multiple of replacement length

2010-09-16 Thread Halabi, Anan
Hi, I write below code for simulation for weibull- estimating parameters by weibullMLE function, Although I define metrix for the variables still I got this message: number of items to replace is not a multiple of replacement length Any suggestion > est=matrix (NA, 2,2) > se=matrix (NA, 2,2) >

Re: [R] Survival Analysis Daily Time-Varying Covariate but Event Time Unknown

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 12:14 PM, smm7aa wrote: Help! I am unsure if I can analyze data from the following experiment. Fish were placed in a tank at (t=0) Measurements of Carbon Dioxide were taken each day for 120 days (t=0,...120) A few fish were then randomly pulled out of the tank at differ

[R] keep par settings after device closes

2010-09-16 Thread Jack Siegrist
I am saving several plots to different formats. I want to be able to change the font size for all of them at once. Is there a way to do this without having to have a call to par every time a new device is opened? I know that the par settings are removed after each device is closed. Thanks for you

[R] nlinfit equivalent in R

2010-09-16 Thread Lavin, Yingmei
Hi, Is there a function in R that's equivalent of nlinfit in Matlab? I'd like to find parameters in a pre-determined form: x(t) ~ sum(beta1/beta2^i*x(t-i)) where i = 1,2,3n (n could be large) Thanks, Yingmei The information contained in this message and its attach...{{dropped:10}} _

Re: [R] using variable from for loop in naming new variables

2010-09-16 Thread Joshua Wiley
Dear Jim, Just to follow up some of the great suggestions with some examples: # # Initialize a list, length 4 lstuff <- vector(mode = "list", length = 4) # store the results of your for loop in it for (i in 1:4) { lstuff[[i]] <- 3 + i } # The assign() w

Re: [R] finding complex roots in R

2010-09-16 Thread Ravi Varadhan
Beware that you are likely to have multiple, or even infinitely many, roots in the complex plane. In the first example, there are infinitely many roots, which are equal to +/- 1i * (N * pi), where N = 1, 3, 5, ... Similarly, there are infinitely many roots in my second example. Therefore, I wou

Re: [R] finding complex roots in R

2010-09-16 Thread Ravi Varadhan
Hi Toros, It is actually quite easy to do this with existing real-root finders. If you want to solve for F(z) = 0, where z = x + iy, you simultaneously solve for the zeros of the real and imaginary part of F. Here are a couple of examples using the package "BB": fn1 <- function(x, a){ z <- x[

Re: [R] Help with graphic margin

2010-09-16 Thread Greg Snow
Set the inner margins to be small (the distance you want between the 2 plots), then set the outer margin big enough to hold the x axis on the bottom plot. Details on setting the margins is in ?par in case you don't know or remember them. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center

Re: [R] function help?

2010-09-16 Thread Duncan Murdoch
On 16/09/2010 3:40 PM, Duke wrote: Hi all, I am writing a function (fun.R), but I dont know how to code the function so that the Help Text will be shown up when one types ?fun (of course, after he loads it up). Anyone has any advice for me how to do that? The help text is separate from t

Re: [R] using variable from for loop in naming new variables

2010-09-16 Thread Greg Snow
This is FAQ 7.21. Note that the most important part of the FAQ is the last few lines where it essentially says "DON'T DO THIS". If this is just a model for a bigger situation then definitely Don't Do This, as using assign and global variables will just create more and bigger future headaches.

Re: [R] R Founding

2010-09-16 Thread Duncan Murdoch
On 16/09/2010 3:29 PM, Kevin Wright wrote: I am sure there would be enough to employ some foundation members > full-time, pay external CSs and even protect the system in court from those > who make money off of somebody else's work and do not give back to the > community (you know who I am

[R] function help?

2010-09-16 Thread Duke
Hi all, I am writing a function (fun.R), but I dont know how to code the function so that the Help Text will be shown up when one types ?fun (of course, after he loads it up). Anyone has any advice for me how to do that? Thanks, D. __ R-help@r-pr

Re: [R] IP address

2010-09-16 Thread Peter Dalgaard
On 09/16/2010 04:42 PM, Ben Bolker wrote: > Jorge Nieves moorecap.com> writes: > >> >> >> Hi, >> >> We have some tight controls in our systems and I am having difficulty >> downloading/upgrading R packages. The IT department will configure our >> system to let me download packages from two or th

Re: [R] R Founding

2010-09-16 Thread Kevin Wright
I am sure there would be enough to employ some foundation members > full-time, pay external CSs and even protect the system in court from those > who make money off of somebody else's work and do not give back to the > community (you know who I am talking about). > If you are trying to smear Rev

Re: [R] error in 2.10: "R include directory is empty" prevents package installation

2010-09-16 Thread Peter Dalgaard
On 09/16/2010 04:27 PM, slakov wrote: > > I hope to revive this topic. I have the same error message when I try to > install any package. Well, sorry to hear that, but perhaps you'll have better luck if you supply the specifics. You seem to be replying to an ancient post on a mailing list and you

Re: [R] get top n rows group by a column from a dataframe

2010-09-16 Thread Dennis Murphy
Hi: You already have some good solutions; here is another using the plyr package, based on a slight modification in salary from Phil Spector's test data: sdata = data.frame(company=sample(LETTERS[1:8],1000,replace=TRUE), person=1:1000, salary= trunc(rnorm(100

[R] [R-pkgs] WriteXLS - New Version 2.0.1

2010-09-16 Thread Marc Schwartz
The updated package has been submitted to CRAN and will propagate to mirrors over the next day or so. It is maintained on R-Forge at http://r-forge.r-project.org/projects/writexls, where downloads will eventually be available as well. Package: WriteXLS Version: 2.0.1 Description: Cross-platf

Re: [R] rep within an ifelse statment

2010-09-16 Thread Henrique Dallazuanna
ifelse return a value with the same length that logical test. You need if () {} else {} if (y == 5) rep(2, 4) else NA On Thu, Sep 16, 2010 at 3:58 PM, deven hamilton wrote: > I have come across simple problem in R and I was hoping > > someone out there could help me out. Here is the problem: I

[R] rep within an ifelse statment

2010-09-16 Thread deven hamilton
I have come across simple problem in R and I was hoping someone out there could help me out. Here is the problem: I am trying to set up and rep statement with a conditional statement using ifelse. Here is simple example. > y=5 > o<-ifelse(y==5,rep(2,4),NA) > o > [1] 2 > > If I check

Re: [R] More accurate ODE solver?

2010-09-16 Thread Ben Bolker
Tianchan Niu isis.georgetown.edu> writes: > > Dear All, > > I was using rk4 and lsoda to solve a ODE system. However, both of them gave > bad accurate solutions, especially compared with Matlab solver ODE45. For > example, ODE45 gave solutions that can go to a stable level (about 1.6) when > ti

Re: [R] parallel computation with plyr 1.2.1

2010-09-16 Thread Dylan Beaudette
On Thursday 16 September 2010, David Winsemius wrote: > On Sep 16, 2010, at 1:11 PM, Dylan Beaudette wrote: > > Hi, > > > > I have been trying to use the new .parallel argument with the most > > recent > > version of plyr [1] to speed up some tasks. I can run the example in > > the NEWS > > file [1

Re: [R] get top n rows group by a column from a dataframe

2010-09-16 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Tan, Richard > Sent: Thursday, September 16, 2010 8:39 AM > To: r-help@r-project.org > Subject: [R] get top n rows group by a column from a dataframe > > Hi, is there an R functi

Re: [R] get top n rows group by a column from a dataframe

2010-09-16 Thread Tan, Richard
Thanks, it works. Richard From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Thursday, September 16, 2010 1:56 PM To: Tan, Richard Cc: RICHARD M. HEIBERGER; r-help@r-project.org Subject: Re: [R] get top n rows group by a column from a dataframe You can try this: (Using Richar

Re: [R] parallel computation with plyr 1.2.1

2010-09-16 Thread Hadley Wickham
Yes, this was a little bug that will be fixed in the next release. Hadley On Thu, Sep 16, 2010 at 1:11 PM, Dylan Beaudette wrote: > Hi, > > I have been trying to use the new .parallel argument with the most recent > version of plyr [1] to speed up some tasks. I can run the example in the NEWS > f

Re: [R] Can I save my console contents automatically?

2010-09-16 Thread Greg Snow
Currently comments (#) are ignored by txtStart and friends due to the task callback mechanism used. The txtComment function is available as a work around to insert comments into the output/commands. I tried running date() as below and everything worked as expected (the comments were missing, b

Re: [R] get top n rows group by a column from a dataframe

2010-09-16 Thread Henrique Dallazuanna
You can try this: (Using Richard's example): aggregate(sdata['salary'], sdata[c('company')], function(x)tail(sort(x), 5)) On Thu, Sep 16, 2010 at 2:26 PM, Tan, Richard wrote: > Hi Richard > > > > Thanks for the suggestion, but I want top 5 salary for each company, not > the whole list. I don't

Re: [R] RODBC Access/Excel driver location for 64 bit Win7

2010-09-16 Thread Dennis Murphy
Hi: On Thu, Sep 16, 2010 at 8:55 AM, Peter Holck wrote: > Apologies, but after a fair amount of digging, I still only have a foggy > understanding of the cause of this problem, due to my own ignorance. > > I hope to use RODBC package to connect to an Access DB when running 64 bit > Win7 (R versi

Re: [R] use same breaks and colors, but the displayed scale are different-image.plot()

2010-09-16 Thread rusers.sh
Thanks guys. I forgot to use the argument "zlim". It's solved. 2010/9/16 Jim Lemon > On 09/16/2010 12:05 PM, rusers.sh wrote: > >> Hi all, >> I want to put several figures in a one figure for easy comparison, so i >> need to use the same methods to plot these figures. The following is an >> ex

Re: [R] get top n rows group by a column from a dataframe

2010-09-16 Thread Phil Spector
Richard - Is this what you're looking for? sdata = data.frame(company=sample(LETTERS[1:8],1000,replace=TRUE), person=1:1000, salary=rnorm(1000)) splitsdata = split(sdata,sdata$company) res = do.call(rbind,sapply(splitsdata,simplify=FALSE,

Re: [R] test to see if a s4 property is assigned?

2010-09-16 Thread Martin Morgan
On 09/15/2010 12:03 PM, darckeen wrote: > > Class("person",representation(age="numeric",weight="numeric")) > [1] "person" >> bob <- new("person",age=30) >> is.null(b...@weight) > [1] FALSE >> b...@weight > numeric(0) >> b...@weight == numeric(0) > logical(0) Hi darckeen -- use the prototype argum

Re: [R] shuffling of data

2010-09-16 Thread David Winsemius
On Sep 16, 2010, at 1:14 PM, fugelpitch wrote: I have a file that reads like this: How much R do you know? Are you still at the stage where you need basic help reading a file into a session? Species,Year,Julian_day Alnus_glutinosa, 1873, 123 Sorbus_aucuparia, 1873, 122 (more specie

Re: [R] get top n rows group by a column from a dataframe

2010-09-16 Thread Tan, Richard
Hi Richard Thanks for the suggestion, but I want top 5 salary for each company, not the whole list. I don't see how your way can work? Thanks, Richard From: RICHARD M. HEIBERGER [mailto:r...@temple.edu] Sent: Thursday, September 16, 2010 11:53 AM To: Tan, Richard Cc: r-help@r-proje

Re: [R] shuffling of data

2010-09-16 Thread stephen sefick
Something like this? library(ggplot2) qplot(Year, Julian_day, data=a, colour=Species) On Thu, Sep 16, 2010 at 12:14 PM, fugelpitch wrote: > > I have a file that reads like this: > > Species,Year,Julian_day > Alnus_glutinosa, 1873, 123 > Sorbus_aucuparia, 1873, 122 > (more species...) > Alnu

[R] shuffling of data

2010-09-16 Thread fugelpitch
I have a file that reads like this: Species,Year,Julian_day Alnus_glutinosa, 1873, 123 Sorbus_aucuparia, 1873, 122 (more species...) Alnus_glutinosa, 1874, 134 Sorbus_aucuparia, 1874, 143 (more species and years) Is there a way to plot this as julian day over years so that each species g

[R] parallel computation with plyr 1.2.1

2010-09-16 Thread Dylan Beaudette
Hi, I have been trying to use the new .parallel argument with the most recent version of plyr [1] to speed up some tasks. I can run the example in the NEWS file [1], and it seems to be working correctly. However, R will only use a single core when I try to apply this same approach with ddply().

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-16 Thread dadrivr
Thanks for all the suggestions, guys. It looks like TIFF may be the easiest solution, as I wouldn't have to worry about printing to a postscript printer or converting to PDF (when using EPS). That way, I could send the Word file as is to all coauthors (important for collaboration - i.e., track c

[R] Problems creating a Panel

2010-09-16 Thread Luis Felipe Parra
Hello, I am trying to create a panel with the attached data frame. using the following code: > PanelRio = DataRiopaila[which(duplicated(DataRiopaila$SEC_STE)==T),] > PanelRio=plm.data(PanelRio,index=c("SEC_STE","FechaSiembra")) series Pluv3Meses,PluvMes4al10,Pluv2UltimosMeses,Rad3Meses,RadMes4al1

[R] a reliable way to check the latest version of R on CRAN?

2010-09-16 Thread Yihui Xie
Hi all, We know old.packages() can check for updates of add-on packages, but is there a way to check updates of R itself? "go to R homepage" is a way, of course, but I hope this can be done by R. I'm not sure about the "reliable" place to check; here is a simple example to check from one of the C

[R] RODBC Access/Excel driver location for 64 bit Win7

2010-09-16 Thread Peter Holck
Apologies, but after a fair amount of digging, I still only have a foggy understanding of the cause of this problem, due to my own ignorance. I hope to use RODBC package to connect to an Access DB when running 64 bit Win7 (R version 2.11.1, 64 bit). I have successfully done this before on a winXP

Re: [R] reshape matrix entities to columns

2010-09-16 Thread Dennis Murphy
Hi: Could you please devise a reproducible example that illustrates the problem? As far as points (1) and (2) are concerned, if you lack row or column names, they can always be defined and added to the object. Dennis On Thu, Sep 16, 2010 at 4:26 AM, Natasha Asar wrote: > Thanks for the help > >

[R] Survival Analysis Daily Time-Varying Covariate but Event Time Unknown

2010-09-16 Thread smm7aa
Help! I am unsure if I can analyze data from the following experiment. Fish were placed in a tank at (t=0) Measurements of Carbon Dioxide were taken each day for 120 days (t=0,...120) A few fish were then randomly pulled out of the tank at different days, killed and examined for the presence of

  1   2   >