Re: [R] Can a matrix have 'list' as rows/columns?

2012-04-16 Thread Henrik Bengtsson
On Mon, Apr 16, 2012 at 9:13 PM, Worik R wrote: > After a lot of processing I get a matrix into M.  I expected each row and > column to be a vector.  But it is a list. Lists are also vectors, e.g. > x <- list() > is.vector(x) [1] TRUE > y <- vector("list", length=3) > str(y) List of 3 $ : NULL

Re: [R] Installing Kendall Package

2012-04-16 Thread McGuire, Rhydwyn
You need to load the library by running >library(Kendall) Rhydwyn -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Doyle Sent: Tuesday, 17 April 2012 12:35 PM To: r-help@r-project.org Subject: [R] Installing Kendall Package

[R] error using nls with logistic derivative

2012-04-16 Thread Francisco Mora Ardila
Hi I´m trying to fit a nonlinear model to a derivative of the logistic function y = a/(1+exp((b-x)/c)) (this is the parametrization for the SSlogis function with nls) The derivative calculated with D function is: > logis<- expression(a/(1+exp((b-x)/c))) > D(logis, "x") a * (exp((b - x)/c) * (1

[R] Can a matrix have 'list' as rows/columns?

2012-04-16 Thread Worik R
After a lot of processing I get a matrix into M. I expected each row and column to be a vector. But it is a list. R-Inferno says... "Arrays (including matrices) can be subscripted with a matrix of positive numbers. The subscripting matrix has as many columns as there are dimensions in the array

[R] Re : Installing Kendall Package

2012-04-16 Thread Pascal Oettli
Hello, Did you type 'library(Kendall)'? Regards. - Mail original - De : David Doyle À : r-help@r-project.org Cc : Envoyé le : Mardi 17 avril 2012 11h34 Objet : [R] Installing Kendall Package I know this is a dumb question but I'm pulling out what little hair I have left.  I download

[R] Installing Kendall Package

2012-04-16 Thread David Doyle
I know this is a dumb question but I'm pulling out what little hair I have left. I download the package and got the following: trying URL ' http://ftp.ussg.iu.edu/CRAN/bin/windows/contrib/2.14/Kendall_2.2.zip' Content type 'application/zip' length 52732 bytes (51 Kb) opened URL downloaded 51 Kb

Re: [R] Select rows based on condition

2012-04-16 Thread kborgmann
Thanks Again!! R was holding a large file in memory so there was not enough memory to execute the function. After reading in the file separately, your code worked perfectly. Thanks! -- View this message in context: http://r.789695.n4.nabble.com/Select-rows-based-on-condition-tp4562919p4563346.htm

Re: [R] writing spdiags function for R

2012-04-16 Thread Ben Bolker
On 12-04-16 09:32 PM, Moreno I. Coco wrote: > Hi Ben, > > thank you soo much:) your code worked, and we > managed to halven computing time. > I am copying below the final version of the function, > if anybody is willing to use/improve it. > > thanks again, > > Moreno A couple of quick comment

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
Thanks again, Greg. I must have gotten up on the wrong side of the keyboard this morning and been having a spate of dim insight. What you've said here makes things clearer. DAV -Original Message- From: Greg Snow [mailto:538...@gmail.com] Sent: Monday, April 16, 2012 5:42 PM To: David A

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
OK, then. Thanks. I've read the docs more carefully and Reduce does indeed look like the ticket. For whatever reason, the first time I looked at the documentation my initial reaction was: huh? DAV -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Monday, Apr

Re: [R] Can't install package gbm, because packageVersion is not an exported object from namespace::Utils

2012-04-16 Thread Douglas Colkitt
Okay, that makes sense. That's what I thought at first, but the CRAN page for the package lists the required version as 2.5.0. I'll emai the package maintainer to alert them of the error. On Mon, Apr 16, 2012 at 7:54 PM, Duncan Murdoch wrote: > On 12-04-16 6:28 PM, Douglas Colkitt wrote: > >> I'm

Re: [R] Select rows based on condition

2012-04-16 Thread kborgmann
Thanks for the reply! I tried your suggestion, but R stops responding. Perhaps it is due to the size (>6,000 rows) of the dataset I am trying to manipulate?? -- View this message in context: http://r.789695.n4.nabble.com/Select-rows-based-on-condition-tp4562919p4563031.html Sent from the R help m

Re: [R] Select rows based on condition

2012-04-16 Thread Rui Barradas
Hello, Try df1 <- read.table(text=" PtName Visit Date Obs ObsID S2 1 6/8/2005 KB 3 S2 1 6/8/2005 JB 5 S3 1 6/8/2005KB3 S3 16/8/2005

[R] Select rows based on condition

2012-04-16 Thread kborgmann
Hi, I am relatively new to R and I am trying to figure out how to select rows of my data based on a condition. For example in the dataset below multiple observers recorded data at the same point on the same date and the data was recorded on separate rows, but I only need one of the rows of data.

Re: [R] writing spdiags function for R

2012-04-16 Thread Moreno I. Coco
Hi Ben, thank you soo much:) your code worked, and we managed to halven computing time. I am copying below the final version of the function, if anybody is willing to use/improve it. thanks again, Moreno ### spdiags = function(A){ re

Re: [R] arrangement

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 6:08 PM, Soheila Khodakarim wrote: Hi David, Thanks a lot for your help. But unfortunately I can not understand your mean:( Could you explain more for me? Best Wishes, Soheila deleted excessive white-space and changed format to plain-text. object <- structure(list(V1 =

Re: [R] formatting sub-second intervals

2012-04-16 Thread R. Michael Weylandt
It looks to me like it's written in the penultimate paragraph of the details section for ?strptime Michael On Mon, Apr 16, 2012 at 12:50 PM, Gene Leynes wrote: > I would like to suggest that there is some documentation missing from > strptime. > > There appears to be a way to show second decimal

Re: [R] arrangement

2012-04-16 Thread R. Michael Weylandt
He's saying it looks like you need to transpose your matrix with the t() function -- documentation can be attained by typing ?t at the console -- and that you'll need to subset to get the rows you want. It's not quite clear to us which order your rows are actually in because you sent HTML email whi

Re: [R] Can't install package gbm, because packageVersion is not an exported object from namespace::Utils

2012-04-16 Thread Duncan Murdoch
On 12-04-16 6:28 PM, Douglas Colkitt wrote: I'm running R 2.11.1 on 64 bit Debian. I've had no problem installing any other CRAN packages, but installing package "gbm" fails due to: *** installing help indices ** building package indices ... ** testing if installed package can be loaded Error :

Re: [R] system command to a specific shell (bash)

2012-04-16 Thread MacQueen, Don
I believe that shell() was superceded by system(), quite a long time ago. However, I get this: > foo <- system('printenv',intern=TRUE) ; foo[grepl('SHELL',foo)] [1] "SHELL=/bin/tcsh" "XTERM_SHELL=/bin/tcsh" And tcsh is my login shell, i.e., as specified for my account at the OS level. To m

Re: [R] grep and XML

2012-04-16 Thread Henrique Dallazuanna
Try this: library(rjson) j <- fromJSON(file = 'https://raw.github.com/currencybot/open-exchange-rates/master/latest.json') j$rates$USD On Mon, Apr 16, 2012 at 6:03 PM, Simon Kiss wrote: > Hi all: > I struggle a lot scraping web data. I still haven't got a handle on the XML > package. > I'd like

[R] projection pursuit classification

2012-04-16 Thread Ranjan Maitra
Hello, I am trying to look at projection pursuit classification: I was wondering what function/package is recommended for use. I note that the stats function ppr only takes in numeric responses. Any suggestions? Many thanks, Ranjan __ R-help@r-projec

Re: [R] Simultaneous OLS fitting with constraints on coeffcients

2012-04-16 Thread Gabor Grothendieck
On Mon, Apr 16, 2012 at 6:02 PM, Allan Sikk wrote: > Hi, > > Is it possible in R to fit two equations simultaneously: > > y1 = a1 - b1*t   and > y2 = a2 - b2*t > > so that the following constraint applies: a1/b1 = a2/b2 ? > Try this: set.seed(123) # simulated data a2 <- 2; b1 <- 3; b2 <- 4; a1

Re: [R] How to adjust the distance between legend and the plot (xyplot)

2012-04-16 Thread Peter Ehlers
On 2012-04-16 14:53, Jun Shen wrote: Hi, Peter, Thanks. This is exactly what I am looking for! Just a little concern. Since there are so many parameters in the trellis.par, how do we even know there is one that can do what we want? The documentation does not really have that much details. Well

[R] Can't install package gbm, because packageVersion is not an exported object from namespace::Utils

2012-04-16 Thread Douglas Colkitt
I'm running R 2.11.1 on 64 bit Debian. I've had no problem installing any other CRAN packages, but installing package "gbm" fails due to: *** installing help indices ** building package indices ... ** testing if installed package can be loaded Error : .onAttach failed in attachNamespace() for 'gbm

Re: [R] Effeciently sum 3d table

2012-04-16 Thread Bert Gunter
That _is_ interesting. Reduce() calls the sum function at the interpreted level, so I would not expect this. Can you check whether most of the time for my "vectorized" version is spent on the do.call(cbind ...) part, which is what I would guess. Otherwise, this sounds strange, since .rowSums is spe

Re: [R] How to adjust the distance between legend and the plot (xyplot)

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 5:53 PM, Jun Shen wrote: Hi, Peter, Thanks. This is exactly what I am looking for! Just a little concern. Since there are so many parameters in the trellis.par, how do we even know there is one that can do what we want? The documentation does not really have that much

Re: [R] arrangement

2012-04-16 Thread Soheila Khodakarim
Hi David, Thanks a lot for your help. But unfortunately I can not understand your mean:( Could you explain more for me? Best Wishes, Soheila On Tue, Apr 17, 2012 at 1:55 AM, David Winsemius wrote: > > On Apr 16, 2012, at 5:19 PM, Soheila Khodakarim wrote: > > Dear All >> >> I want to

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 4:32 PM, Bert Gunter wrote: David: Here is a comparison of the gains to be made by vectorization (again, assuming I have interpreted your query correctly) ## create a list of arrays z <- lapply(seq_len(1),function(i)array(runif(24),dim=2:4)) ## Using an apply type ap

[R] Simultaneous OLS fitting with constraints on coeffcients

2012-04-16 Thread Allan Sikk
Hi, Is it possible in R to fit two equations simultaneously: y1 = a1 - b1*t and y2 = a2 - b2*t so that the following constraint applies: a1/b1 = a2/b2 ? Thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 5:41 PM, Greg Snow wrote: Here is a simple example: mylist <- replicate(4, matrix(rnorm(12), ncol=3), simplify=FALSE) A <- Reduce( `+`, mylist ) B <- mylist[[1]] + mylist[[2]] + mylist[[3]] + mylist[[4]] all.equal(A,B) [1] TRUE Basically what Reduce does is it first appl

Re: [R] How to adjust the distance between legend and the plot (xyplot)

2012-04-16 Thread Jun Shen
Hi, Peter, Thanks. This is exactly what I am looking for! Just a little concern. Since there are so many parameters in the trellis.par, how do we even know there is one that can do what we want? The documentation does not really have that much details. Jun On Mon, Apr 16, 2012 at 4:29 PM, Peter

Re: [R] Effeciently sum 3d table

2012-04-16 Thread Greg Snow
Here is a simple example: > mylist <- replicate(4, matrix(rnorm(12), ncol=3), simplify=FALSE) > A <- Reduce( `+`, mylist ) > B <- mylist[[1]] + mylist[[2]] + mylist[[3]] + mylist[[4]] > all.equal(A,B) [1] TRUE Basically what Reduce does is it first applies the function (`+` in this case) to the 1

Re: [R] How to adjust the distance between legend and the plot (xyplot)

2012-04-16 Thread Peter Ehlers
On 2012-04-16 08:51, David Winsemius wrote: On Apr 16, 2012, at 11:43 AM, Jun Shen wrote: Dear list, As the title indicates if I draw the legend outside of the plot, how do I adjust the distance between the legend and the plot? The default setting is too close. Thanks. From the help page

Re: [R] Sending lists from R to C using .C

2012-04-16 Thread Mercier Eloi
Hi Chris, I personally found the documentation rather...indigestible. At least 3 years ago when I developed my R package. It seems they have nicely improved this part of the documentation though. I'm not an expert at all, but at least you will have the point of view of a beginner. First, i

[R] overlay graphics on a googlemap

2012-04-16 Thread reyjuancarlos
Hi, I need help about overlaying an image on a google map I retrieve a google map by using the rgooglemaps package. Actually I have made a filled.contour graphic with my data, and I would like to overlay this graphic on a static map, but the problem is "how do we indicate this function in the FU

Re: [R] arrangement

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 5:19 PM, Soheila Khodakarim wrote: Dear All I want to arrange our output in 3 columns in R. Example: N 0432003010 00514 00604 0056303430 03022 V 22.00 0.00e+00 15.000 15. 13. 1.30e+01 51.000 p 0.640625 2.910

[R] arrangement

2012-04-16 Thread Soheila Khodakarim
Dear All I want to arrange our output in 3 columns in R. Example: N 0432003010 00514 00604 0056303430 03022 V 22.00 0.00e+00 15.000 15. 13. 1.30e+01 51.000 p 0.640625 2.910383e-11 0.4257812 0.4375 0.6875 3.356934e-04 0.2434998

[R] grep and XML

2012-04-16 Thread Simon Kiss
Hi all: I struggle a lot scraping web data. I still haven't got a handle on the XML package. I'd like to get particular exchange rates from this table: https://raw.github.com/currencybot/open-exchange-rates/master/latest.json This is the code that I'm working with: library(RCurl) library(XML) t

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 4:04 PM, David A Vavra wrote: even now you _could_ be clearer I fail to see why it's unclear. I'm after T1 + T2 + T3 + ... Which would be one number ... i.e. the result you originally said you did not want. I think it's precisely what I want. If I have two 3d tables,

Re: [R] Effeciently sum 3d table

2012-04-16 Thread Bert Gunter
On Mon, Apr 16, 2012 at 1:39 PM, David A Vavra wrote: > OK. I'll take your word for it. The mapply function calls "do_mapply" so I > would have thought it is passing the operation down to the C code. I haven't > tracked it any further than below. No, they can't. Function evaluation must take plac

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
OK. I'll take your word for it. The mapply function calls "do_mapply" so I would have thought it is passing the operation down to the C code. I haven't tracked it any further than below. > mapply function (FUN, ..., MoreArgs = NULL, SIMPLIFY = TRUE, USE.NAMES = TRUE) { FUN <- match.fun(FUN)

Re: [R] Effeciently sum 3d table

2012-04-16 Thread William Dunlap
I generally prefer the list approach too. I only mentioned that you didn't need to have a list of inputs before starting the summation because you said > There's a lot > of extraneous memory wastage holding all of the tables in a list as well as > the return 'values'. I guess I misinterpret

Re: [R] Effeciently sum 3d table

2012-04-16 Thread Bert Gunter
David: Here is a comparison of the gains to be made by vectorization (again, assuming I have interpreted your query correctly) ## create a list of arrays > z <- lapply(seq_len(1),function(i)array(runif(24),dim=2:4)) ## Using an apply type approach > system.time(ans1 <- array(do.call(mapply,c(

Re: [R] Simple Merge

2012-04-16 Thread Brian Diggs
On 4/16/2012 1:23 PM, Jeff wrote: I'm new to R. I have two data frames I need to merge. One has an ID column the other does not, but both have the same number of rows that are ordered in the same way - e.g., row 1 is the same person in both data frames. For this reason, there is no need to sor

[R] Simple Merge

2012-04-16 Thread Jeff
I'm new to R. I have two data frames I need to merge. One has an ID column the other does not, but both have the same number of rows that are ordered in the same way - e.g., row 1 is the same person in both data frames. For this reason, there is no need to sort or specify a "by" column. I

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
Thanks Bill, For reasons that aren't important here, I must start from a list. Computing the sum while generating the tables may be a solution but it means doing something in one piece of code that is unrelated to the surrounding code. Bad practice where I'm from. If it's needed it's needed but

Re: [R] Effeciently sum 3d table

2012-04-16 Thread Bert Gunter
For purposes of clarity only... On Mon, Apr 16, 2012 at 12:40 PM, David A Vavra wrote: > Bert, > > My apologies on the name. > > I haven't kept any data on loop times. I don't know why lapply seems faster > but the difference is quite noticeable. It has struck me as odd. I would > have thought la

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
> even now you _could_ be clearer I fail to see why it's unclear. >> I'm after T1 + T2 + T3 + ... > Which would be one number ... i.e. the result you originally said you >did not want. I think it's precisely what I want. If I have two 3d tables, T1 and T2, then say either 1) T1 + T2

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 3:26 PM, David Winsemius wrote: On Apr 16, 2012, at 2:43 PM, David A Vavra wrote: Thanks Petr, I'm after T1 + T2 + T3 + ... Which would be one number ... i.e. the result you originally said you did not want. and your solution is giving a list of n items each conta

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
Bert, My apologies on the name. I haven't kept any data on loop times. I don't know why lapply seems faster but the difference is quite noticeable. It has struck me as odd. I would have thought lapply would be slower. It has taken an effort to change my thinking to force fit solutions to it but I

Re: [R] Creating a point pattern with spatstat

2012-04-16 Thread David L Carlson
First you should read the documentation carefully and look at the examples. Your data are tabular. Spatstat expects a row for each point with the x and y coordinates for that point. # First use dput() to create a version of the data that you can copy into your r-help requests so we # can easily ge

Re: [R] Effeciently sum 3d table

2012-04-16 Thread William Dunlap
> Example in partial code: > > Env <- CreatEnv() # my own function > Assign('final',T1-T1,envir=env) > L<-listOfTables > > lapply(L,function(t) { > final <- get('final',envir=env) + t > assign('final',final,envir=env) > NULL > }) First, finish writing that code so it runs and y

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 2:43 PM, David A Vavra wrote: Thanks Petr, I'm after T1 + T2 + T3 + ... Which would be one number ... i.e. the result you originally said you did not want. and your solution is giving a list of n items each containing sum(T[i]). I guess I should have been clearer in

Re: [R] ggplot2: scale_shape_manual

2012-04-16 Thread Brian Diggs
On 4/16/2012 7:31 AM, Brian Smith wrote: Hi, I was trying to replicate one of the graphs given on the ggplot2 website. I have given a sample code below. I would like to combine the legends, since each color is uniquely mapped to a shape. ### library(ggplot2) leaves<- letters[1:8]

Re: [R] Effeciently sum 3d table

2012-04-16 Thread Bert Gunter
David: 1. My first name is Bert. 2. " It never occurred to me that there would be a question." Indeed. But in fact you got solutions for two different interpretations (Greg's is what you wanted). That is what I meant when I said that clarity in asking the question is important. 3. > I have gotte

Re: [R] system command to a specific shell (bash)

2012-04-16 Thread Justin Haynes
Thanks Jeff, but I'm running a python program that expects certain functionality that bash provides and sh doesn't... I can just stop using github checkouts and use system packages though and fix this. I'm mostly wondering where the "shell" command went in base R... it sounds like it completely s

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
Thanks Greg, I think this may be what I'm after but the documentation for it isn't particularly clear. I hate it when someone documents a piece of code saying it works kinda like some other code (running elsewhere, of course) making the tacit assumption that everybody will immediately know what th

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
Thanks Petr, I'm after T1 + T2 + T3 + ... and your solution is giving a list of n items each containing sum(T[i]). I guess I should have been clearer in stating what I need. Cheers, DAV -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On

Re: [R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
Thanks Gunter, I mean what I think is the normal definition of 'sum' as in: T1 + T2 + T3 + ... It never occurred to me that there would be a question. I have gotten the impression that a for loop is very inefficient. Whenever I change them to lapply calls there is a noticeable improvement in

Re: [R] Problems with subset, droplevels and lm: variable lengths differ

2012-04-16 Thread Peter Ehlers
On 2012-04-16 10:43, Michael Friendly wrote: [Env: R 2.14.2 / Win Xp] In the script below, I want to select some variables from rrcov::OsloTransect, delete cases with any missing data, and subset the data frame Oslo to remove cases for two levels of the factor litho that occur with low frequenc

Re: [R] system command to a specific shell (bash)

2012-04-16 Thread Jeff Newmiller
You could make a hash bang bash script that sources the file and then proceeds to do whatever you want. Bourne shell should have no problems invoking another shell. --- Jeff NewmillerThe .

Re: [R] Problems with subset, droplevels and lm: variable lengths differ

2012-04-16 Thread Joshua Wiley
Hi Michael, Just a silly error, it should be: mod1 <- lm(cbind(Cu, Fe, K, Mg, Mn, P, Zn) ~ litho + forest + weather, data=Oslo) quoted you get a 1 x 7 character matrix you are trying to regress on. Cheers, Josh On Mon, Apr 16, 2012 at 10:43 AM, Michael Friendly wrote: > [Env:  R 2.14.2 / Win

Re: [R] Survival Curves

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 1:02 PM, robgriffin247 wrote: actually, maybe I haven't quite solved this - the plot doesn't appear to include the 23 that are still alive at the end. I have tried using a status variable (1 or 0 dependant upon survival as in page 800, roughly, in the R book) ... Call

[R] Problems with subset, droplevels and lm: variable lengths differ

2012-04-16 Thread Michael Friendly
[Env: R 2.14.2 / Win Xp] In the script below, I want to select some variables from rrcov::OsloTransect, delete cases with any missing data, and subset the data frame Oslo to remove cases for two levels of the factor litho that occur with low frequency. The checks I run on my new data frame O

Re: [R] Survival Curves

2012-04-16 Thread robgriffin247
actually, maybe I haven't quite solved this - the plot doesn't appear to include the 23 that are still alive at the end. I have tried using a status variable (1 or 0 dependant upon survival as in page 800, roughly, in the R book) ... Call: survfit(formula = Surv(ssl$long, ssl$status) ~ ssl$sex)

[R] Creating a point pattern with spatstat

2012-04-16 Thread AMFTom
I have presence/absence data in the following format: 1 2 3 4 5 6 7 8 9 10 11 12 1 1 1 1 1 1 1 1 1 1 1 1 0 2 1 1 1 1 0

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-16 Thread Gene Leynes
Bill, Yes! The time variable was the issue. I should have mentioned that, but I didn't want to open the door to the fact that I should probably be using time series analysis instead of linear regression. Because of the time offset, I felt comfortable subtracting out the minimum of the observed

Re: [R] Survival Curves

2012-04-16 Thread robgriffin247
Hi David thanks for the help, i was just looking back to say I have found my solution (i think) and as you suggested survfit was the way to go. my solution was this: model<-survfit(Surv(a$longevity)~a$sex) plot(model,ylab="proportion alive",xlab="time (days)",col=c("red","blue")) -- View this mes

Re: [R] Cluster Analysis

2012-04-16 Thread David L Carlson
At the R command prompt ?kmeans (for info on the R equivalent to FASTCLUS) ?hclust (for info on the R equivalent to CLUSTER) Install package clusterSim and look at function index.G1 for the Calinski-Harabasz pseudo F-statistic -- David L Carlson Assoc

Re: [R] Approximately how big is an installation of all packages.

2012-04-16 Thread Prof Brian Ripley
Note that the answer also depends on the platform (Uwe probably has two archs on Windows and no debug info in his DLLs), whether you byte-compile the packages, the optimization flags you use when compiling CRAN is around 3 - 4GB depending on the platform. Specifically, 3.5GB for x86_64

[R] system command to a specific shell (bash)

2012-04-16 Thread Justin Haynes
I need to run a bash command, but when you call system() the default shell is sh (see my sessionInfo below). I found the shell command ( http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/base/html/shell.html) but it seems to be disappeared in current versions of R? I am running all this from R C

Re: [R] packages install dependencies

2012-04-16 Thread Uwe Ligges
On 16.04.2012 15:41, mail.bioi...@fr.netgrs.com wrote: Hello R-Members I have to install several R packages on a Unix server which doesn't have internet connection. I downloaded some packages manually and I installed it from source using the command R CMD INSTALL and it's work but in some

Re: [R] Approximately how big is an installation of all packages.

2012-04-16 Thread Uwe Ligges
On 16.04.2012 16:16, Keith Weintraub wrote: Can you tell me the size of those 3 packages separately? These are 5000 packages. If you want to kniow, why don't you try out? I have them in one library only. Uwe Ligges That is CRAN, BioC software, BioC data. If you can only give me CRAN vs

[R] formatting sub-second intervals

2012-04-16 Thread Gene Leynes
I would like to suggest that there is some documentation missing from strptime. There appears to be a way to show second decimals by using "%OS4" (change the number to get more or less decimals), but it's not mentioned anywhere that I can find. After a long time searching and experimenting I fina

Re: [R] Effeciently sum 3d table

2012-04-16 Thread Bert Gunter
Define "sum" . Do you mean you want to get a single sum for each array? -- get marginal sums for each array? -- get a single array in which each value is the sum of all the individual values at the position? Due thought and consideration for those trying to help by formulating your query carefully

[R] warning message: coxme with package multcomp

2012-04-16 Thread Simon Tragust
Hi I'm encountering an error/warning when doing multiple comparisons with the package multcomp on a coxme model. My data: I'm looking at the removal of brood from the nest according to three treatments I applied on the brood. The brood and the workers caring about the brood in the nest, belong

Re: [R] Coding columns for survival analysis

2012-04-16 Thread Alexander Shenkin
Jim, This was very helpful - thank you! I really like the use of diff and cumsum - those haven't been in my toolkit until now. Your solution came close, but I needed to keep "NAs" when the tree hadn't been found yet, or when it had already died. So, for posterity, here's the code I ended up wit

Re: [R] Effeciently sum 3d table

2012-04-16 Thread Greg Snow
Look at the Reduce function. On Mon, Apr 16, 2012 at 8:28 AM, David A Vavra wrote: > I have a large number of 3d tables that I wish to sum > Is there an efficient way to do this? Or perhaps a function I can call? > > I tried using do.call("sum",listoftables) but that returns a single value. > > S

Re: [R] How to adjust the distance between legend and the plot (xyplot)

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 11:43 AM, Jun Shen wrote: Dear list, As the title indicates if I draw the legend outside of the plot, how do I adjust the distance between the legend and the plot? The default setting is too close. Thanks. From the help page: "just A character or numeric vector of l

Re: [R] Survival Curves

2012-04-16 Thread David Winsemius
On Apr 16, 2012, at 10:24 AM, robgriffin247 wrote: Hello I'm trying to make survival curves for some longevity data - 100 males and 100 females, some of which are still living (not dead at the end of survey) I would like to make sex specific survival curves as time on the X axis, proport

[R] How to adjust the distance between legend and the plot (xyplot)

2012-04-16 Thread Jun Shen
Dear list, As the title indicates if I draw the legend outside of the plot, how do I adjust the distance between the legend and the plot? The default setting is too close. Thanks. Here is the sample code I have == xyplot(1~1,key=list(space=

Re: [R] Effeciently sum 3d table

2012-04-16 Thread Petr Savicky
On Mon, Apr 16, 2012 at 10:28:43AM -0400, David A Vavra wrote: > I have a large number of 3d tables that I wish to sum > Is there an efficient way to do this? Or perhaps a function I can call? > > I tried using do.call("sum",listoftables) but that returns a single value. > > So far, it seems onl

Re: [R] Compiling graphics into the same PDF file

2012-04-16 Thread Yihui Xie
Just FYI: if you use the knitr package (http://yihui.name/knitr/demo/rstudio/), you do not need fig=TRUE; knitr will not create Rplots.pdf either. For the plot files, I do not understand why they should not be generated -- how is LaTeX supposed to insert them into the final PDF output if they are

Re: [R] Seemingly simple "lm" giving unexpected results

2012-04-16 Thread William Dunlap
Instead of changing the tolerance of the qr decomposition you could use poly(x1,df=1) to center and scale x1. The coefficients will be different but the predictions will be fine (because the centering and scaling information is stored in the fitted model as the "predvars" attribute of the terms co

[R] Survival Curves

2012-04-16 Thread robgriffin247
Hello I'm trying to make survival curves for some longevity data - 100 males and 100 females, some of which are still living (not dead at the end of survey) I would like to make sex specific survival curves as time on the X axis, proportion alive on the Y, and a line for each sex (two lines) Dat

Re: [R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-16 Thread Enrico Colosimo
But it is very very unlikely to have a time with survival probability of 0. in a real data set. It would be necessary huge data set. A Monte Carlo simulation could put a little more light in this issue? 2012/4/16 Frank Harrell > Just generate some data where the estimated survival probabilit

Re: [R] Help - Importing data from txt and xlsx files

2012-04-16 Thread AMFTom
Hi all, it turns out I had left absent data as a blank space instead of filling it with a zero. Now I am able to import data. Thanks for all your help, I'm sure I will be calling on your expertise in future. Tom -- View this message in context: http://r.789695.n4.nabble.com/Help-Importing-data

Re: [R] Compiling graphics into the same PDF file

2012-04-16 Thread damiloveu
Thanks, Ista. I inserted fig=TRUE to the chunk and it did work. However, it generated each plot into separate files in the directory as well. I have much more to learn soon. Wuyi -- View this message in context: http://r.789695.n4.nabble.com/Compiling-graphics-into-the-same-PDF-file-tp456058

[R] apply() and sample()

2012-04-16 Thread Patrick Presi
Hi All, I am developing an epidemiological model at animal level. > head(all.herds) ID herd age status status2 dry dry.per pasture id 1 11 3 s s lac 4 1 1 2 21 8 s s lac 4 1 2 3 31 30 s s lac 4 1 3 4 4

[R] packages install dependencies

2012-04-16 Thread mail.bioinfo
Hello R-Members I have to install several R packages on a Unix server which doesn't have internet connection. I downloaded some packages manually and I installed it from source using the command R CMD INSTALL and it's work but in some cases I can't install the package because of the depende

[R] ggplot2: scale_shape_manual

2012-04-16 Thread Brian Smith
Hi, I was trying to replicate one of the graphs given on the ggplot2 website. I have given a sample code below. I would like to combine the legends, since each color is uniquely mapped to a shape. ### library(ggplot2) leaves <- letters[1:8] mat <- matrix(sample(1:1000,32),nrow=16,nco

[R] Effeciently sum 3d table

2012-04-16 Thread David A Vavra
I have a large number of 3d tables that I wish to sum Is there an efficient way to do this? Or perhaps a function I can call? I tried using do.call("sum",listoftables) but that returns a single value. So far, it seems only a loop will do the job. TIA, DAV _

Re: [R] Approximately how big is an installation of all packages.

2012-04-16 Thread Keith Weintraub
Can you tell me the size of those 3 packages separately? That is CRAN, BioC software, BioC data. If you can only give me CRAN vs the rest that's fine too. Whatever is easiest. Thanks, KW -- On Apr 16, 2012, at 9:12 AM, Uwe Ligges wrote: > > > On 16.04.2012 00:16, Keith Weintraub wrote: >> F

Re: [R] Problems loading siar package

2012-04-16 Thread Gary Roemer
Thanks Uwe, I'll give it a whirl. Best, Gary Gary Roemer Associate Professor Dept. Fish, Wildlife & Conservation Ecology New Mexico State University Las Cruces, NM 88003 Off: 575-646-3394 Fax:575-646-1281 groe...@nmsu.edu http://web.nmsu.edu/~groemer/ On Apr 16, 2012,

Re: [R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-16 Thread Terry Therneau
On 04/14/2012 05:00 AM, r-help-requ...@r-project.org wrote: Am replicating in R an analysis I did earlier using SAS. See this as a test of whether I'm ready to start using R in my day-to-day work. ? Just finished replicating a Kaplan Meier analysis. Everything seems to work out fine except for

Re: [R] Installation of R 2.15.0

2012-04-16 Thread R. Michael Weylandt
Certainly in theory, though the CRAN installers might over-write the old version automatically. [I'm pretty sure they do for mac, don't know about Windows] The way to ensure both versions remain will depend on the OP's unstated OS. Michael On Mon, Apr 16, 2012 at 6:57 AM, ya wrote: > Hi Partha,

Re: [R] Problems loading siar package

2012-04-16 Thread Uwe Ligges
On 16.04.2012 01:36, Gary Roemer wrote: PS The version of "siar" on my old computer is 4.0, the new version is 4.1.3 - could the latter be corrupt? Try to reinstall both mvtnorm and siar from sources again. Looks lie your mvtnorm installation is broken. Uwe Ligges Thanks, Gary -- V

Re: [R] Approximately how big is an installation of all packages.

2012-04-16 Thread Uwe Ligges
On 16.04.2012 00:16, Keith Weintraub wrote: Folks, If you know the answer great. If you can tell me which command to use to find out that information please let me know. If this is the wrong forum, my apologies. What is your definition of all packages? If you mean almost all CRAN and Bi

Re: [R] Censoring data

2012-04-16 Thread Terry Therneau
On 04/14/2012 05:00 AM, r-help-requ...@r-project.org wrote: Hello, ?I want to estimate weibull parameters with 30% censored data. I have below the code for the censoring ?but how it must be put into the likelihood equation to obtain the desire estimate is where i have a problem with, ?can some

  1   2   >