[R] Cochran-Armitage

2008-12-12 Thread robert-mcfadden
Hello, Which package allows to use Cochrana-Armitage trend test? I tried to search for but I found only package coin in which there is no explicit function. Best, RobMac __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Complex integration in R

2008-12-12 Thread Robin Hankin
Hi Borja library(elliptic) ?myintegrate HTH rksh Borja Soto Varela wrote: Dear R-user I need a function to approximate a complex integration. My function is: aprox2=function(s,x,rate){ dexp(x,rate)*exp(-s*x) } where argument s is a complex number. I can't use the integrate function b

Re: [R] The end of Matlab

2008-12-12 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > On 11/12/2008 9:45 PM, Mike Rowe wrote: >> Greetings! >> >> I come to R by way of Matlab. One feature in Matlab I miss is its >> "end" keyword. When you put "end" inside an indexing expression, it >> is interpreted as the length of the variable along the dimension being >>

Re: [R] i graph library: how can generates a fully connected graph from a similarity matrix

2008-12-12 Thread Gábor Csárdi
On Fri, Dec 12, 2008 at 2:10 AM, dinesh kumar wrote: > Dear R users > > I have a similarity matrix 100X100. I used this matrix as adjacency matrix > to generate igraph graph object. Its a fully connected graph. The similarity > score is the weight of the edge. Now I want to remove all possible low

Re: [R] The end of Matlab

2008-12-12 Thread Prof Brian Ripley
On Fri, 12 Dec 2008, Duncan Murdoch wrote: On 11/12/2008 9:45 PM, Mike Rowe wrote: Greetings! I come to R by way of Matlab. One feature in Matlab I miss is its "end" keyword. When you put "end" inside an indexing expression, it is interpreted as the length of the variable along the dimension

Re: [R] The end of Matlab

2008-12-12 Thread Duncan Murdoch
On 12/12/2008 3:41 AM, Wacek Kusnierczyk wrote: Duncan Murdoch wrote: On 11/12/2008 9:45 PM, Mike Rowe wrote: Greetings! I come to R by way of Matlab. One feature in Matlab I miss is its "end" keyword. When you put "end" inside an indexing expression, it is interpreted as the length of the v

Re: [R] problem with legend

2008-12-12 Thread Jim Lemon
valeria pedrina wrote: hi all, I want to do a plot and put the legend on the left of y axis this is my code: x<-seq(1980,2005,1) plot(x,tfa_ita,type="l",col=1,xlim=c(1979,2005),ylim=c(0.2,1.7),xlab="",ylab="",main="Totale Attivita` Finanziarie") lines(x,tfa_spa,type="l",col=2) lines(x,tfa_aus,t

[R] recursive List extraction question

2008-12-12 Thread Dominik.Cullmann
Dear all, I've got a list L <- list(L1 = list (foo = "bar" , SL = NULL ) , L2 = list ( foo = "bar" , SL = list (SSL1 = list (DF = data.frame(val = 21, foo = "bar") , DFOO = list(foo = "foo

Re: [R] snowfall sfInit error

2008-12-12 Thread chibco
Thanks On Thu, Dec 11, 2008 at 10:19 AM, Jochen Knaus wrote: > Dear Mr. Ripley, > > indeed that it true. sfInit() currently have a bug on Windows depending on > the usage of the Linux tools and the broken Exceptionhandling. Too bad I > never tested it accordingly on Windows (as we do not have any

[R] repeated two ways anova

2008-12-12 Thread Cecilia Chandra
Hi there, I have a question regarding a data set that looks like the following: 8 repeated measurements for 3 dosage levels. However, the measurements for each dosage levels are taken on a different group of subjects. example: subject time dosage measure 11     1  1

[R] Concordance Index - interpretation

2008-12-12 Thread K F Pearce
Hello everyone. This is a question regarding generation of the concordance index (c index) in R using the function rcorr.cens. In particular about interpretation of its direction and form of the 'predictor'. One of the arguments is a "numeric predictor variable" ( presumably this is just a *si

Re: [R] The end of Matlab

2008-12-12 Thread Claudia Beleites
Dear list, > Learning to use the power of R's indexing and functios like head() and > tail() (which are just syntactic sugar) will probably lead you not to miss > this. However, how do I exclude the last columns of a data.frame or matrix (or, in general, head and tail for given dimensions of an a

Re: [R] recursive List extraction question

2008-12-12 Thread Henrique Dallazuanna
Try this: rapply(L, c)[grep("\\.val$", names(rapply(L, c)))] On Fri, Dec 12, 2008 at 7:55 AM, wrote: > Dear all, > I've got a list > L <- list(L1 = list > (foo = "bar" > , SL = NULL > ) > , L2 = list > ( > foo = "bar" > , SL = l

Re: [R] Downloading Reuters data from R

2008-12-12 Thread Shubha Vishwanath Karanth
Thank you very much for this. But since I don't know much of DLL, I am kind of a stuck with how to proceed with 'reuters_ts1.zip'. This zip file contains the 'reuters_ts.dll' file. dyn.load("reuters_ts.dll") generates the error, > dyn.load("Z:\\reuters_ts1\\package\\reuters_ts.dll") Error in inDL

Re: [R] Downloading Reuters data from R

2008-12-12 Thread Rory.WINSTON
Shubha I suspect it may be because it cannot find a dependent DLL. I'll email you off-list and we can work through it. Cheers Rory Rory Winston RBS Global Banking & Markets Office: +44 20 7085 4476 -Original Message- From: Shubha Vishwanath Karanth [mailto:shub...@ambaresearch.com] Se

Re: [R] Cochran-Armitage

2008-12-12 Thread Chuck Cleland
On 12/12/2008 3:29 AM, robert-mcfad...@o2.pl wrote: > Hello, > Which package allows to use Cochrana-Armitage trend test? I tried to search > for but I found only package coin in which there is no explicit function. But there is this example in coin: ### Cochran-Armitage trend test for proporti

Re: [R] ref card for data manipulation?

2008-12-12 Thread Liviu Andronic
On Thu, Dec 11, 2008 at 1:38 PM, Vitalie Spinu wrote: > Tom Short's card is an excellent one but it does not cover high level > packages like plyr, reshape, DoBy, and a few base data.manip functions are > not there as well. > I'm not sure whether this can (partially) fill the gap, but Quick-R [1]

[R] save as ascii

2008-12-12 Thread Rina Oldager Miehs
Hello r-help I want to save my dataframe as an ascii file. a bit of my data frame: > vmsrina[1:100,] CKRDYRNR CHRNR cowno dek lakt flow peakflow 1 3596600182 35966 182 9383 3.0527442 3.18 2 3596600182 35966 182 9393 1.8978755 3.06 3 3596600182 35966

Re: [R] The end of Matlab

2008-12-12 Thread Patrick Burns
How about: x[, -seq(to=ncol(x), length=n)] Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User") Claudia Beleites wrote: Dear list, Learning to use the power of R's indexing and functios like head() an

[R] 1st Call for Papers - 2nd International Symposium on Distributed Computing and Artificial Intelligence (DCAI'09)

2008-12-12 Thread Nora Muda
To the R users community: (We apologize for multiples copies) (Please distribute) --- 1st Call for Papers - 2nd International Symposium on Distributed Computing and Artificial Intelligence (DCAI'09) June 10th - 12th , 2009 -

Re: [R] save as ascii

2008-12-12 Thread Duncan Murdoch
On 12/12/2008 6:58 AM, Rina Oldager Miehs wrote: Hello r-help I want to save my dataframe as an ascii file. a bit of my data frame: vmsrina[1:100,] CKRDYRNR CHRNR cowno dek lakt flow peakflow 1 3596600182 35966 182 9383 3.0527442 3.18 2 3596600182 35966 182 939

Re: [R] The end of Matlab

2008-12-12 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > On 12/12/2008 3:41 AM, Wacek Kusnierczyk wrote: >> >> but this 'general rule' is not really adhered to in r! one example >> already discussed here at length is subset: >> >> subset(data.frame(...), select=a) >> >> what will be selected? column named "a", or columns named b

Re: [R] The end of Matlab

2008-12-12 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > On 11/12/2008 9:45 PM, Mike Rowe wrote: > >> >> this.matrix[3:end,end] >> >> would be equivalent to: >> >> this.matrix[3:nrow(this.matrix),ncol(this.matrix)] # or >> this.matrix[3:dim(this.matrix)[1],dim(this.matrix)[2]] >> >> As you can see, the R version requires more ty

Re: [R] The end of Matlab

2008-12-12 Thread hadley wickham
> From which you might conclude that I don't like the design of subset, and > you'd be right. However, I don't think this is a counterexample to my > general rule. In the subset function, the select argument is treated as an > unevaluated expression, and then there are rules about what to do with

Re: [R] Extracting the name of an object into a character string and vice versa

2008-12-12 Thread Philip Whittall
I am still struggling to map a character string to an object name and vice versa in R. I thought the as.name() function might work, but observe the following behaviour ... > attach(warpbreaks) > levels(tension) [1] "L" "M" "H" > levels(as.name("tension")) NULL > objectname<-as.name("tension") >

Re: [R] Extracting the name of an object into a character string and vice versa

2008-12-12 Thread Gabor Grothendieck
Its a FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f On Fri, Dec 12, 2008 at 8:30 AM, Philip Whittall wrote: > > I am still struggling to map a character string to an object name and > vice versa in R. > I thought the as.name() function might work,

Re: [R] Cochran-Armitage

2008-12-12 Thread Peter Dalgaard
Chuck Cleland wrote: > On 12/12/2008 3:29 AM, robert-mcfad...@o2.pl wrote: >> Hello, >> Which package allows to use Cochrana-Armitage trend test? I tried to search >> for but I found only package coin in which there is no explicit function. > > But there is this example in coin: > > ### Cochra

[R] Functions in R like lincom and nlcom of Stata

2008-12-12 Thread Marc Marí Dell'Olmo
Hello all, Does anyone know if there exists any function in R that resembles the "lincom" and "nlcom" of STATA?. These functions computes point estimates, standard errors, significance levels, confidence intervals, etc. for linear and non linear combinations of previous estimated parameters. Down

Re: [R] The end of Matlab

2008-12-12 Thread Claudia Beleites
Am Freitag 12 Dezember 2008 13:10:20 schrieb Patrick Burns: > How about: > > x[, -seq(to=ncol(x), length=n)] Doing it is not my problem. I just agree with Mike in that I would like if I could do shorter than: x[, 1 : (ncol(x) - n)] which I btw prefer to your solution. Also, I don't have a pro

Re: [R] setting the R_Libs gives warning message from Rgui.exe

2008-12-12 Thread Uwe Ligges
Daren Tan wrote: Hi, I keep getting the error message and a pop-up window for selecting CRAN mirror server from Rgui.exe after setting the R_Libs Warning in install.packages(necessary[!installed], dep = T) : argument 'lib' is missing: using 'D:/Program Files/R/R-2.8.0.libs' This is a w

[R] Fwd: Re: The end of Matlab (sorry, I messed up a sentence)

2008-12-12 Thread Claudia Beleites
-- Weitergeleitete Nachricht -- Betreff: Re: [R] The end of Matlab Datum: Freitag 12 Dezember 2008 Von: Claudia Beleites An: r-help@r-project.org Am Freitag 12 Dezember 2008 13:10:20 schrieb Patrick Burns: > How about: > > x[, -seq(to=ncol(x), length=n)] Doing it is not my prob

[R] Error message when starting TINN-R

2008-12-12 Thread Richardson, Patrick
When R starts I get the following error message Warning message: In grep(paste("[{]TclEval ", topic, "[}]", sep = ""), tclvalue(.Tcl("dde services TclEval {}")), : argument 'useBytes = TRUE' will be ignored Has anyone else run into this issue and is there any way to can fix this? Thanks, Patri

Re: [R] Error message when starting TINN-R

2008-12-12 Thread Prof Brian Ripley
And the *Error* message was (that was a warning)? The warning comes from some contributed code, probably in Tinn-R. Please find out where it is and ask the maintainer for a fix. But it looks harmless enough. On Fri, 12 Dec 2008, Richardson, Patrick wrote: When R starts I get the following

Re: [R] The end of Matlab

2008-12-12 Thread Wacek Kusnierczyk
Claudia Beleites wrote: > Am Freitag 12 Dezember 2008 13:10:20 schrieb Patrick Burns: > >> How about: >> >> x[, -seq(to=ncol(x), length=n)] >> > Doing it is not my problem. I just agree with Mike in that I would like if I > could do shorter than: > > x[, 1 : (ncol(x) - n)] > > which I bt

Re: [R] Error message when starting TINN-R

2008-12-12 Thread Richardson, Patrick
I have asked the maintainer for a fix and didn't get a reply, which is why I posted to the list to see if there were any other ideas. Sorry to bother. . . with my warning message. Patrick -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Friday, December 1

Re: [R] The end of Matlab

2008-12-12 Thread Duncan Murdoch
On 12/12/2008 8:25 AM, hadley wickham wrote: From which you might conclude that I don't like the design of subset, and you'd be right. However, I don't think this is a counterexample to my general rule. In the subset function, the select argument is treated as an unevaluated expression, and the

Re: [R] assign()ing within apply

2008-12-12 Thread Thompson, David (MNR)
Any tips? DaveT. >-Original Message- >From: Thompson, David (MNR) >Sent: December 9, 2008 04:03 PM >To: 'r-help@r-project.org' >Subject: assign()ing within apply > >Hello, > >I'm trying to convert a character column in several dataframes >to lower case. > >### ># ># Sample data and 'spp

Re: [R] The end of Matlab

2008-12-12 Thread Wacek Kusnierczyk
>> Wacek: >> >> >>> x[3:] >>> instead of >>> x[3:length(x)] >>> x[3:end] >>> >>> >> I don't think that would help: >> what to use for end - 3 within the convention that negative values mean >> exclusion? >> >> >> >> > > might seem tricky, but not impossible: > > x[-2]

Re: [R] Please help me in Converting this from C# to R [C1]

2008-12-12 Thread Taoufik NADIFI
Please, can you tell me if you know how can i use the library Igraph in C# ? Thanks Nadifi Taoufik * This message and any attachments (the "message") are con...{{dropped:15}} __ R-

[R] How-To capture and handle errors with R

2008-12-12 Thread mauede
The following error occurs every now and then by calling a function of wmTSA package: Error in `row.names<-.data.frame`(`*tmp*`, value = c("1", "0")) : invalid 'row.names' length I would greatly appreciate some guidelines about how to catch such an error upon its occurrence and have it handl

Re: [R] Row order in plot

2008-12-12 Thread qroberts
Thanks very much for the replies. Both suggestions worked perfectly. That's one more step towards understanding R. Thanks again. -- View this message in context: http://www.nabble.com/Row-order-in-plot-tp20962774p20974800.html Sent from the R help mailing list archive at Nabble.com. __

[R] preprocessCore

2008-12-12 Thread irene . vicari
Bonjour! Je suis en train de faire un projet utilisant Affymatrix mais j'ai un problème à télécharger un package depuis R: une fois que je télécharge le package et je demande de faire "rma" ca sort l'erreur suivante et je n'ai aucune idée de comment je pourrais faire. > library(preprocessCore) >

[R] Eror handling with R

2008-12-12 Thread mauede
Is there any way to handle errors retuened by R functions ... something like the exception handling in C++ ? Thank you so much, Maura Alice Messenger ;-) chatti anche con gli amici di Windows Live Messenger e tutti i telefonini TIM! Vai su http://maileservizi.alice.it/alice_messenger/index.htm

[R] Support vector model?

2008-12-12 Thread Celine Carret
Dear All, Apologies for sending this email to both list, but at this point I'm not sure which one could help me the most. I have 4 sets of data, 1 test and 3 different sets of controls. The measurements are binary, with a matrix of 0 and 1 I'm measuring across time (rows, ~815) the behaviour of

Re: [R] How to generate a prediction equation for a stratified survival model that was fitted by cph() in Design package

2008-12-12 Thread Yu, Changhong
Dear Dr. Harrell, Thanks for response so quickly. Here is example code to illustrate the problem. > n <- 1000 > set.seed(731) > age <- 50 + 12*rnorm(n) > label(age) <- "Age" > sex <- factor(sample(c('Male','Female'), n, + rep=TRUE, prob=c(.6, .4))) > cens <- 15*runif(n) > h <- .02*e

Re: [R] setting the R_Libs gives warning message from Rgui.exe

2008-12-12 Thread Daren Tan
I have managed to get rid the two warning messages simply by uninstalling and installing again R. Very likely that I disrupted the installation of a large package. > Date: Fri, 12 Dec 2008 15:07:38 +0100 > From: lig...@statistik.tu-dortmund.de > To: dare...@hotmail.com > CC: r-h...@stat.math.e

Re: [R] Extracting the name of an object into a character string and vice versa

2008-12-12 Thread Simon Pickett
paste() ?paste - Original Message - From: "Philip Whittall" To: Sent: Friday, December 12, 2008 1:30 PM Subject: Re: [R] Extracting the name of an object into a character string and vice versa I am still struggling to map a character string to an object name and vice versa in R

[R] DSC 2009: Now open for registration and abstract submission

2008-12-12 Thread Peter Dalgaard
Re. Workshop on Directions in Statistical Computing, Copenhagen 13-14 July 2009. http://www.r-project.org/dsc-2009 The web interface for registration and submission of abstracts is now open. (The site is still under construction in a number of respects. In particular, we haven't negotiated disco

Re: [R] The end of Matlab

2008-12-12 Thread Claudia Beleites
> > Wacek: > >> x[3:] > >> instead of > >> x[3:length(x)] > >> x[3:end] > > > > I don't think that would help: > > what to use for end - 3 within the convention that negative values mean > > exclusion? > > might seem tricky, but not impossible: > > x[-2] > # could mean 'all except for 2nd', as it i

Re: [R] Eror handling with R

2008-12-12 Thread Sarah Goslee
Is try() what you're looking for? Sarah On Fri, Dec 12, 2008 at 5:43 AM, wrote: > Is there any way to handle errors retuened by R functions ... something like > the exception handling in C++ ? > > Thank you so much, > Maura > > Alice Messenger ;-) chatti anche con gli amici di Windows Live Mes

Re: [R] The end of Matlab

2008-12-12 Thread Gabor Grothendieck
Here is how to emulate matlab end in R in the case of matrices. Rather than redefine the matrix class (which would be a bit intrusive) we just define a subclass of matrix called matrix2. Note in the examples that matrix2 survives some operations such as + but not others such as crossprod so in th

[R] character count

2008-12-12 Thread Ista Zahn
Dear list, I have a variable that consists of typed responses. I wish to compute a variable equal to the number of characters in the original variable. For example: > x <- c("convert this to 32 because it has 32 characters", "this one has 22 > characters", "12 characters") [Some magic function h

Re: [R] The end of Matlab

2008-12-12 Thread Claudia Beleites
I just realized that my idea of doing something without going into the extraction functions itself won't work :-( it was a nice dream, though. The reason is that there is no general way to find out what the needed length is: At least I'm just writing a class where 2 kinds of columns are involve

Re: [R] ref card for data manipulation?

2008-12-12 Thread Vitalie Spinu
On Fri, 12 Dec 2008 12:43:17 +0100, Liviu Andronic wrote: I'm not sure whether this can (partially) fill the gap, but Quick-R [1] has a decent overview of data manipulation, and is essentially a reference card. The maintainer of the Web site is open to improvements, so it might make sense to

Re: [R] character count

2008-12-12 Thread Claudia Beleites
nchar (c("convert this to 47 because it has 47 characters", "this one has 26 characters", "13 characters")) HTH Claudia -- Claudia Beleites Dipartimento dei Materiali e delle Risorse Naturali Università degli Studi di Trieste Via Alfonso Valerio 6/a I-34127 Trieste phone: +39 (0 40) 5 58-34 47

Re: [R] The end of Matlab

2008-12-12 Thread Wacek Kusnierczyk
Claudia Beleites wrote: >>> Wacek: >>> x[3:] instead of x[3:length(x)] x[3:end] >>> I don't think that would help: >>> what to use for end - 3 within the convention that negative values mean >>> exclusion? >>> >> might seem tricky, but not impossible:

[R] Odp: character count

2008-12-12 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 12.12.2008 16:31:10: > Dear list, > I have a variable that consists of typed responses. I wish to compute > a variable equal to the number of characters in the original variable. > For example: > > > x <- c("convert this to 32 because it has 32 charact

Re: [R] Odp: character count

2008-12-12 Thread Gabor Grothendieck
On Fri, Dec 12, 2008 at 11:00 AM, Petr PIKAL wrote: > Hi > > > r-help-boun...@r-project.org napsal dne 12.12.2008 16:31:10: > >> Dear list, >> I have a variable that consists of typed responses. I wish to compute >> a variable equal to the number of characters in the original variable. >> For exam

Re: [R] Odp: character count

2008-12-12 Thread Henrique Dallazuanna
Or : nchar(gsub("[[:space:]]", "", x)) On Fri, Dec 12, 2008 at 2:00 PM, Petr PIKAL wrote: > Hi > > > r-help-boun...@r-project.org napsal dne 12.12.2008 16:31:10: > > > Dear list, > > I have a variable that consists of typed responses. I wish to compute > > a variable equal to the number of cha

Re: [R] character count

2008-12-12 Thread Ista Zahn
Thanks to everyone who responded. This turns out to be amazingly easy. To count characters including spaces: nchar(x) To count characters excluding spaces: nchar(gsub(" *","",x)) Thanks! On Fri, Dec 12, 2008 at 11:00 AM, Petr PIKAL wrote: > Hi > > > r-help-boun...@r-project.org napsal dne 12.12.

[R] What packages have impute method ?

2008-12-12 Thread Daren Tan
Besides the impute package, are there others that have alternative impute approaches ? I hope to compare their performances. Thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

[R] Functions in R like lincom and nlcom of Stata

2008-12-12 Thread Marc Marí Dell'Olmo
Hello all, Does anyone know if there exists any function in R that resembles the "lincom" and "nlcom" of STATA?. These functions computes point estimates, standard errors, significance levels, confidence intervals, etc. for linear and non linear combinations of previous estimated parameters. Down

[R] mixed model nested ANOVA

2008-12-12 Thread Sebpe De Smedt
Hi, I'm working on leaf characteristics of trees. Each tree is characterised by about 10 leaf traits. The trees were sampled at 9 different locations (about 20 to 30 trees/location, NOT balanced), grouped in 3 different climatic zones (Sahelian, Soudanian and Guinean) (NOT balanced). Further, eac

Re: [R] character count

2008-12-12 Thread Gabor Grothendieck
On Fri, Dec 12, 2008 at 11:05 AM, Ista Zahn wrote: > Thanks to everyone who responded. This turns out to be amazingly easy. > To count characters including spaces: > nchar(x) > To count characters excluding spaces: > nchar(gsub(" *","",x)) The * is unnecessary. > > Thanks! > > On Fri, Dec 12, 20

Re: [R] converting multiple columns from POSIX* to Date

2008-12-12 Thread Farrel Buchinsky
Something strange. The lapply only processed the first row and then wrote that value to every row of the original dataframe. It is as if the lapply is indeed processing every item on the list, namely each column, but the ifelse or the as.Date is getting messed up. Not only is it only processing the

Re: [R] The end of Matlab

2008-12-12 Thread Greg Snow
Just to muddy the waters a bit further. Currently we can do things like: > pascal.tri <- numeric(0) > class(pascal.tri) <- 'pasctri' > > `[.pasctri` <- function(x, ...) { + dots <- list(...) + n <- dots[[1]] + row <- choose(n, 0:n) + if(length(dots) > 1) { + row <- row[ dots[[2]] ] + } + row + }

Re: [R] The end of Matlab

2008-12-12 Thread hadley wickham
On Fri, Dec 12, 2008 at 8:41 AM, Duncan Murdoch wrote: > On 12/12/2008 8:25 AM, hadley wickham wrote: >>> >>> From which you might conclude that I don't like the design of subset, and >>> you'd be right. However, I don't think this is a counterexample to my >>> general rule. In the subset functi

Re: [R] converting multiple columns from POSIX* to Date

2008-12-12 Thread Farrel Buchinsky
I got the whole thing to work, with Hadley Wickham's help. is.POSIXt <- function(x) inherits(x, "POSIXt") dates <- sapply(df, is.POSIXt) df[dates] <-lapply(df[dates], as.Date) Farrel Buchinsky On Fri, Dec 12, 2008 at 11:26, Farrel Buchinsky wrote: > > Something strange. The lapply only proce

Re: [R] The end of Matlab

2008-12-12 Thread Vitalie Spinu
On Fri, 12 Dec 2008 17:38:13 +0100, hadley wickham wrote: You could also imagine similar iterators for random sampling, like samp(0.2) to choose 20% of the indices, or boot(0.8) to choose 80% with replacement. first(n) could also be useful, selecting the first min(n, length(vector)) observatio

[R] T-mode PCA

2008-12-12 Thread Victor Homar
Hi, We are trying to classify atmospheric patterns using PCA and kmeans. In T-mode, the (non-normalized) loadings of the PCs are used as input variables for the k-means classification. As first step we perform PCA using "princomp" but the computed loadings produced by princomp are normalized

[R] How to mimic select.list using RGtk2/gWidgetsRGtk2?

2008-12-12 Thread ronggui
I want to write a function mimic the function of select.list(), here is my preliminary version. select <- function(x,multiple=TRUE,...){ ans<-new.env() g <- gwindow(title=title,wid=200,heigh=500) x1<-ggroup(FALSE,con=g) x2<-gtable(x,multiple=multiple,con=x1,expand=TRUE) gbutton("OK",con=x1,handler

Re: [R] The end of Matlab

2008-12-12 Thread Duncan Murdoch
On 12/12/2008 11:38 AM, hadley wickham wrote: On Fri, Dec 12, 2008 at 8:41 AM, Duncan Murdoch wrote: On 12/12/2008 8:25 AM, hadley wickham wrote: From which you might conclude that I don't like the design of subset, and you'd be right. However, I don't think this is a counterexample to my ge

Re: [R] The end of Matlab

2008-12-12 Thread hadley wickham
On Fri, Dec 12, 2008 at 11:18 AM, Duncan Murdoch wrote: > On 12/12/2008 11:38 AM, hadley wickham wrote: >> >> On Fri, Dec 12, 2008 at 8:41 AM, Duncan Murdoch >> wrote: >>> >>> On 12/12/2008 8:25 AM, hadley wickham wrote: > > From which you might conclude that I don't like the design of su

Re: [R] The end of Matlab

2008-12-12 Thread hadley wickham
On Fri, Dec 12, 2008 at 11:11 AM, Vitalie Spinu wrote: > On Fri, 12 Dec 2008 17:38:13 +0100, hadley wickham > wrote: > >> You could also imagine similar iterators for random sampling, like >> samp(0.2) to choose 20% of the indices, or boot(0.8) to choose 80% >> with replacement. first(n) could a

Re: [R] spatial AR and ARIMA

2008-12-12 Thread Roger Bivand
Erin Hodgess gmail.com> writes: > > Dear R People: > > Are there functions for spatial AR and ARIMA models in R, please? Would looking at the "Spatial" task view on your CRAN mirror help? If by AR you mean simultaneous or conditional autoregressive models using spatial weights (or moving ave

Re: [R] The end of Matlab

2008-12-12 Thread Gabor Grothendieck
On Fri, Dec 12, 2008 at 12:11 PM, Vitalie Spinu wrote: > On Fri, 12 Dec 2008 17:38:13 +0100, hadley wickham > wrote: > >> You could also imagine similar iterators for random sampling, like >> samp(0.2) to choose 20% of the indices, or boot(0.8) to choose 80% >> with replacement. first(n) could a

Re: [R] The end of Matlab

2008-12-12 Thread Duncan Murdoch
On 12/12/2008 12:23 PM, hadley wickham wrote: On Fri, Dec 12, 2008 at 11:18 AM, Duncan Murdoch wrote: On 12/12/2008 11:38 AM, hadley wickham wrote: On Fri, Dec 12, 2008 at 8:41 AM, Duncan Murdoch wrote: On 12/12/2008 8:25 AM, hadley wickham wrote: From which you might conclude that I don

[R] Make installed packages available to new R version

2008-12-12 Thread Roy Robertson
After installing a new version of R, how do I make the packages that I have already installed and use on the old version available to the new version? Thank you, Roy Robertson __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinf

Re: [R] The end of Matlab

2008-12-12 Thread hadley wickham
>> Oh yes, that's a good point. But wouldn't the following do the job? >> >> "&.selector" <- function(a, b) { >> function(n) a(n) & b(n) >> } >> >> or >> >> "&.selector" <- function(a, b) { >> function(n) intersect(a(n), b(n)) >> } >> >> depending on whether selectors return logical or numeric v

Re: [R] Make installed packages available to new R version

2008-12-12 Thread Vitalie Spinu
Have a look at this http://thread.gmane.org/gmane.comp.lang.r.general/87014/focus=133050 it is safer to have all you packages reinstalled once you have updated R. HTH. On Fri, 12 Dec 2008 18:47:33 +0100, Roy Robertson wrote: After installing a new version of R, how do I make the packages th

Re: [R] candisc plotting

2008-12-12 Thread Pete Shepard
Dear Michael, You haven't told us what your data is, and we can only surmise -- not very helpful for you and annoying for those who try to help. Apologies, I am brand new to R and this mailing list. Will try to be more concise. Here is my data a NEW verion of my data: Curvature Diameter Qu

Re: [R] The end of Matlab

2008-12-12 Thread Duncan Murdoch
On 12/12/2008 1:06 PM, hadley wickham wrote: Oh yes, that's a good point. But wouldn't the following do the job? "&.selector" <- function(a, b) { function(n) a(n) & b(n) } or "&.selector" <- function(a, b) { function(n) intersect(a(n), b(n)) } depending on whether selectors return logical

Re: [R] The end of Matlab

2008-12-12 Thread Claudia Beleites
> evens() & last(5) wouldn't x[evens()][last(5)] do the & already? or is different, though. Claudia -- Claudia Beleites Dipartimento dei Materiali e delle Risorse Naturali Università degli Studi di Trieste Via Alfonso Valerio 6/a I-34127 Trieste phone: +39 (0 40) 5 58-34 47 email: cbelei...@un

Re: [R] Make installed packages available to new R version

2008-12-12 Thread Mike Prager
Roy Robertson wrote: > After installing a new version of R, how do I make the packages that I > have already installed and use on the old version available to the new > version? Here is my solution. It has worked over many releases of R, though it will probably require one initial re-installat

Re: [R] The end of Matlab

2008-12-12 Thread Greg Snow
That depends on what you want evens() & last(5) to mean. Does that mean the last 5 evens (returning 5 values) or the values in the last 5 that are also even items (returning either 2 or 3 values depending on if the structure has an odd or even number of elements). It could be interpreted eithe

[R] loop with dates

2008-12-12 Thread Fernando Bizuet
Hello, I am trying to do a loop with dates, but when I try to use the index is not a date. Fcorte <- as.Date('2008/11/30',format = "%Y/%m/%d") fini <- Fcorte + 1 ffin <- seq(fini,by='months',length=2)[2] - 1 for (i in seq(fini,to = ffin, by='days')) print (weekdays(i)) # i does

Re: [R] The end of Matlab

2008-12-12 Thread hadley wickham
> My end would be the output of your end(). If there are no args and no local > context, I don't see the need for it to be a function call. It would just > be defined as something like > > end <- structure( function(n) c(rep(FALSE, n-1), TRUE), class="selector") Oh, I see what you mean. > I'm n

Re: [R] loop with dates

2008-12-12 Thread Henrique Dallazuanna
Try this: weekdays(seq(fini,to = ffin, by='days')) or in a loop: sapply(as.character(seq(fini,to = ffin, by='days')), function(d)weekdays(as.Date(d))) On Fri, Dec 12, 2008 at 4:55 PM, Fernando Bizuet wrote: > Hello, > > I am trying to do a loop with dates, but when I try to use the inde

Re: [R] loop with dates

2008-12-12 Thread Gabor Grothendieck
Try iterating over the index rather than the value of each component: s <- seq(fini,to = ffin, by='days') for (i in seq_along(s)) print(s[[i]]) On Fri, Dec 12, 2008 at 1:55 PM, Fernando Bizuet wrote: > Hello, > > I am trying to do a loop with dates, but when I try to use the index is not > a da

Re: [R] Odp: character count

2008-12-12 Thread Petr PIKAL
Ok, I knew somebody come with regex solution. My regex skills are limited so I do not use it very often. Regards Petr r-help-boun...@r-project.org napsal dne 12.12.2008 17:03:38: > On Fri, Dec 12, 2008 at 11:00 AM, Petr PIKAL wrote: > > Hi > > > > > > r-help-boun...@r-project.org napsal dne 1

[R] prevalence ratio and confidence intervals

2008-12-12 Thread Roberta Pereira Niquini
Hi everybody, I would like to estimate prevalence ratio and confidence intervals. I tried to do a log-binomial regression, but there was a failure of convergence. Now, I would like to learn how to do a poisson regression with robust variance. I am trying to estimate coefficients with poisson r

Re: [R] Make installed packages available to new R version

2008-12-12 Thread Prof Brian Ripley
You have not told us your OS (despite the posting guide). For Windows this is covered in the rw-FAQ. Similar advice would apply on a Unix-alike. For Mac OS X, see the recent archives of the R-sig-mac list. E.g. the strangely titled threads (look in a threaded view) around https://stat.ethz

Re: [R] loop with dates

2008-12-12 Thread Jagat.K.Sheth
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Fernando Bizuet > Sent: Friday, December 12, 2008 12:55 PM > To: r-help@r-project.org > Subject: [R] loop with dates > > Hello, > > I am trying to do a loop with dates, but w

Re: [R] assign()ing within apply

2008-12-12 Thread Thompson, David (MNR)
Thanks Jorge, I am aware of the method you suggest, however, it's not quite what I was asking for. I was attempting to do this change on 56 dataframes, so I attempted to do so with a list of all rather than each individually. Thanks, DaveT. From: Jorg

[R] ANNOUNCE: 2009 John M. Chambers Statistical Software Award

2008-12-12 Thread J.R. Lockwood
John M. Chambers Statistical Software Award - 2009 Statistical Computing Section American Statistical Association The Statistical Computing Section of the American Statistical Association announces the competition for the John M. Chambers Statistical Software Award. In 1998 the Association for Co

Re: [R] The end of Matlab

2008-12-12 Thread Vitalie Spinu
On Fri, 12 Dec 2008 18:27:02 +0100, hadley wickham wrote: or may be just mtcars[cyl>3&last(20)] or this is already too far? This would be a considerable extension because then the selector would need to know about all other variables in the dataset, and you'd need someway of combining selec

Re: [R] mixed model nested ANOVA

2008-12-12 Thread Andrew Robinson
Hi Sebpe, the analysis of the data that you describe could be a complex and lengthy process, in which decisions that you are confronted by are affected by previous decisions that you have made. I recommend obtaining the assistance of a statistician, preferably a local one whose door you can knock

[R] Avoiding multiple outputs using RODBC package

2008-12-12 Thread Brigid Mooney
I am using R as a data manipulation tool for a SQL database. So in some of my R scripts I use the RODBC package to retreive data, then run analysis, and use the sqlSave function in the RODBC package to store the results in a database. There are two problems I want to avoid, and they are highly re

[R] Help with a permutation test

2008-12-12 Thread Grant Gillis
Hello List and thanks in advance for all of your help, I am trying implement a permutation test of a multinomial logistic regression ('multinom' within the nnet package). In the end I want to compare the parameter estimate from my data to the distribution of randomized parameter estimates. I ha

Re: [R] character count

2008-12-12 Thread Carlos Cuartas
Hi Ista, one way could be: ncharacters<-unlist(lapply(x,function(x)nchar(gsub(' ','',x ncharacters From: Ista Zahn To: r-help@r-project.org Sent: Friday, December 12, 2008 10:31:10 AM Subject: [R] character count Dear list, I have a variable that consists

  1   2   >