Re: [R] any alternatives for complex for-loops?

2008-11-11 Thread David Winsemius
y <- rep(NA, length(x)) a <- 2:length(x) y[a] <- complexFn( x[a-1], x[a] ) > y [1] NA 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 -- David Winsemius On Nov 12, 2008, at 12:48 AM, Kinoko wrote: Thanks for the replies Sorry for being unclear. I am asking if there is a way to process a vector in a

[R] Congratulations, Ross!

2008-11-11 Thread John Maindonald
"Associate Professor Ihaka, of the Department of Statistics, was recognised with the Royal Society’s Pickering medal for his part in developing the statistical computing software R. R, created over 15 years ago by Dr Ihaka and colleague Robert Gentleman (now at the Fred Hutchinson Cancer Re

Re: [R] .Random.seed is double

2008-11-11 Thread Prof Brian Ripley
On Wed, 12 Nov 2008, Piero Visconti wrote: Hi I am experiencing a problem with the random number generator. When I call any function that involve RNG such as "runif" or "sample" I get this error: .Random.seed is not an integer vector but of type 'double' I can't coerce the random seed and it's

Re: [R] read.table with many blanks (reposting)

2008-11-11 Thread David Winsemius
If you do not have any separators in the original file, than you need to read it as a fixed width format for which you need read.fwf. Since there are no commas in your file you certainly would not want to use read.csv You are still sending html-formatted mail, so its possible that you ha

[R] .Random.seed is double

2008-11-11 Thread Piero Visconti
Hi I am experiencing a problem with the random number generator. When I call any function that involve RNG such as "runif" or "sample" I get this error: .Random.seed is not an integer vector but of type 'double' I can't coerce the random seed and it's recommended not to alter it anyway. Can anyb

Re: [R] strsplit (regex)

2008-11-11 Thread Gabor Grothendieck
You can do this one even more easily without regular expressions like this: substring(v, 1, 2) substring(v, 3) or with regexps: sub("(..).*", "\\1", v) sub("..(.*)", "\\1", v) or in one line using strapply in the gsubfn package: library(gsubfn) # see http://gsubfn.googlecode.com out <- strapp

Re: [R] Retrieving x argument name from a trellis object in R 2.8.0

2008-11-11 Thread Deepayan Sarkar
On 11/11/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Dear all, > > let consider the following function: > > Fun1 <- function() { > library(lattice) > plot1 <- 1:10~1:10 > pl1 <- xyplot(plot1) > return(pl1$call$x) > } > > In R 2.5.0 (or older version) we have > > > Fun1() > plot

Re: [R] any alternatives for complex for-loops?

2008-11-11 Thread Erik Iverson
Hello, Well, in this case, you're simply applying a rolling mean with window of 2. Package 'zoo' has the rollmean function that does exactly this sort of thing install.packages("zoo") library(zoo) x <- 1:10 rollmean(x, 2) Then, check out the source for rollmean by simply typing rollmean.de

Re: [R] any alternatives for complex for-loops?

2008-11-11 Thread Kinoko
Thanks for the replies Sorry for being unclear. I am asking if there is a way to process a vector in a way that uses references to other elements of the same vector. And doing this without a for-loop. Here is a running code: complexFn <- function(a,b){ c <- (a+b)/2 return(c) } x <- 1:10 y

Re: [R] exponential of a matrix

2008-11-11 Thread seanpor
Good morning, Try expm() in the Matrix package by Douglas Bates and Martin Maechler http://www.stats.bris.ac.uk/R/web/packages/Matrix/index.html Note that there is a revised version of that paper, refer: Cleve Moler and Charles Van Loan (2003) Nineteen dubious ways to compute the exponential of

[R] read.table with many blanks (reposting)

2008-11-11 Thread keunhchoi
Thanks Jim for pointing out how to properly ask. Here is is my question and a small subset of the data and output. I have a data set with many blanks. The blanks should be replaced with zero once imported. I tried read.table, read.csv (R 2.8 version),or scan, but none was successful. Any suggestio

Re: [R] An example of the boxplot thickness problem

2008-11-11 Thread Deepayan Sarkar
On 11/11/08, Kenneth Roy Cabrera Torres <[EMAIL PROTECTED]> wrote: > Hi R users: > > I reproduce the problem that I have with the > boxplot thickness: > -- > # A data frame: > set.seed(123) > cont1<-c(rnorm(10,1),rnorm(5,3),rnorm

[R] gam help (really a vegan question)

2008-11-11 Thread stephen sefick
What does Generalized Cross Validation score mean. I preform and ordisurf on an ordination (nmds) with an environmental variable. I am trying to figure out "how well" the environmental varibles predict/explain the sites placements in species space. Any help would be greatly appreciated. Any poi

Re: [R] any alternatives for complex for-loops?

2008-11-11 Thread Ray Brownrigg
Well, there is an implicit for loop, expressed by: x[i] = complexFn(x[i-1], x[i-2]) But my response is along the lines of: It really depends what your "..." is. How about something like (pseudo-code again): x[1] <- something x[2] <- something_else x = complexFn(x) so the vectorisation is tak

Re: [R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread Berwin A Turlach
G'day Peter, On Wed, 12 Nov 2008 00:42:36 +0100 Peter Dalgaard <[EMAIL PROTECTED]> wrote: > > On 12/11/2008, at 11:29 AM, Peter Dalgaard wrote: > >> > >> Not that one again! For at least one other value of one, the > >> expectation is the opposite: Factor levels do not go away just > >> because t

[R] An example of the boxplot thickness problem

2008-11-11 Thread Kenneth Roy Cabrera Torres
Hi R users: I reproduce the problem that I have with the boxplot thickness: -- # A data frame: set.seed(123) cont1<-c(rnorm(10,1),rnorm(5,3),rnorm(12,5),rnorm(14,3),rnorm(4,5)) categ1<-factor(c(rep("A",10+5+12),rep("B",14+4))) categ2<

Re: [R] Debug command-how to use

2008-11-11 Thread Rahul-A.Agarwal
Thanks a lot...I realised where I was going wrongif I declare debug = F then my problem is getting solved. -Original Message- From: jim holtman [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2008 9:12 AM To: Agarwal, Rahul-A Cc: r-help@r-project.org Subject: Re: [R] Debu

Re: [R] Debug command-how to use

2008-11-11 Thread jim holtman
What is 'debug' defined as? Include at least the assignment or 'str(debug)'. If you have not assigned anything to it, then 'debug' is a function in the basic set of R functions and may be giving you a message like: > if (debug) 1 Error in if (debug) 1 : argument is not interpretable as logical >

[R] 2^k designs "anova"

2008-11-11 Thread Kenneth Roy Cabrera Torres
Hi R users: How can I obtain the same "anova" table for the effects for a 2^k experiment design that MINITAB shows (and authors recommends Box, Hunter, & Hunter). http://www.stat.psu.edu/online/development/stat503/06_2k/04_2k_unreplicate.html Here is the code that I use for this case: D<-C<-B<

[R] 3D trajectory plot?

2008-11-11 Thread Chris Jarman
Hello, I'm attempting to create a smooth, 3D plot of a trajectory (rather than the cloud or wireframe functions). I would rather the individual data points not be visible. I've had no luck finding this on the graphics or help pages. Thank you in advance. Chris Some example data, just in case:

[R] Debug command-how to use

2008-11-11 Thread Rahul-A.Agarwal
I am getting this error could any one tell me why? if(debug) cat("rahul") Error in if (debug) cat("rahul") : argument is not interpretable as logical __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] any alternatives for complex for-loops?

2008-11-11 Thread hadley wickham
On Tue, Nov 11, 2008 at 8:30 PM, Kinoko <[EMAIL PROTECTED]> wrote: > Dear list, > > Is there a way to do something like the following pseudo-code - > without for loop? There isn't a for loop in your code! Hadley > > complexFn <- function(a,b){ > ... > return(c) > } > > x[i] = complexFn(x[i-1],

[R] Export PMML from R - step by step - 1 minute video

2008-11-11 Thread MZ
We recently produced a video which shows how easy it is to export PMML from R. If you are interested in learning more about the Predictive Model Markup Language (PMML) standard and how to use it with R, please take a look at: R to PMML Export Video Tutorial http://adapasupport.zementis.com/2008/1

Re: [R] Citing R in journal articles (or the failure to)

2008-11-11 Thread Kinoko
Achim, thank you. My careless mistake. citation("tweedie") __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, se

[R] Problem with  urca package

2008-11-11 Thread hassen62
Dear R users, I have the joined txt file in the following direct directory C:// I have written the following lines: library(urca); PIBTUN<-read.table("C:/AF.txt", header=F); ur.df(PIBTUN,type='none',lags=1) but I have obtained the following message: Error in embed(z, lags) : 'x' is not a vector or

[R] any alternatives for complex for-loops?

2008-11-11 Thread Kinoko
Dear list, Is there a way to do something like the following pseudo-code - without for loop? complexFn <- function(a,b){ ... return(c) } x[i] = complexFn(x[i-1], x[i-2]) I have found "filter" but would like to do something more complicated than multiplication with x[i-1] and x[i-2]. Thank

Re: [R] multiple "next" in for loops?

2008-11-11 Thread Kinoko
from the top of my head (ugly but works). jumps 5 if i==2 or i==8 j = 0 for(i in 1:15){ if((i==2)||(i==8)){ print(i) j=i+5 next } if (i>=j){ print(i) }else{ next } } __ R-help@r-project.org ma

[R] read.table with many blanks

2008-11-11 Thread keunhchoi
Dear members, I have a data set with many blanks. The blanks should be replaced with zero once imported. I tried read.table, read.csv (R 2.8 version),or scan, but none was successful. Any suggestion, please.. thanks. Keun-Hyung [[alternative HTML version deleted]] __

Re: [R] Citing R in journal articles (or the failure to)

2008-11-11 Thread Achim Zeileis
On Tue, 11 Nov 2008, Kinoko wrote: Just a few words... I usually cite softwares, especially if they are opensource (and encourage everyone to do so). Of course I would not append references for rkward or kile to my bib (neither word or excel). While the response of the researcher using your so

Re: [R] multiple "next" in for loops?

2008-11-11 Thread Duncan Murdoch
On 11/11/2008 8:16 PM, remko duursma wrote: Dear R list, I was wondering if there is an easy fix to this problem (there are workarounds, as always): Within a for loop, we can use "next" to skip to the next index, but how can we skip the next n indices? So, I would like something that looks

Re: [R] Citing R in journal articles (or the failure to)

2008-11-11 Thread Kinoko
Just a few words... I usually cite softwares, especially if they are opensource (and encourage everyone to do so). Of course I would not append references for rkward or kile to my bib (neither word or excel). While the response of the researcher using your software is not convincing, you can easi

Re: [R] problem with urca package

2008-11-11 Thread Achim Zeileis
On Wed, 12 Nov 2008, [EMAIL PROTECTED] wrote: Dear R users, I have the joined txt file in the following direct directory C:// I have written the following lines: library(urca); PIBTUN<-read.table("C:/AF.txt", header=F); ur.df(PIBTUN,type='none',lags=1) but I have obtained the following message:

[R] multiple "next" in for loops?

2008-11-11 Thread remko duursma
Dear R list, I was wondering if there is an easy fix to this problem (there are workarounds, as always): Within a for loop, we can use "next" to skip to the next index, but how can we skip the next n indices? So, I would like something that looks like; for(i in 1:10){ if(somecondition)n

Re: [R] problem with urca package

2008-11-11 Thread cruz
is this what you expect? > ur.df(PIBTUN$V1,type='none',lags=1) ### # Augmented Dickey-Fuller Test Unit Root / Cointegration Test # ### The value of the test statistic is: 6.252

[R] problem with urca package

2008-11-11 Thread hassen62
Dear R users, I have the joined txt file in the following direct directory C:// I have written the following lines: library(urca); PIBTUN<-read.table("C:/AF.txt", header=F); ur.df(PIBTUN,type='none',lags=1) but I have obtained the following message: Error in embed(z, lags) : 'x' is not a vector or

[R] different results with plot.glm vs. plot.glm(which=c(2))

2008-11-11 Thread Effie Greathouse
I am running GLM models using the gamma family. For example: model <-glm(y ~ x, family=Gamma(link="identity")) I am getting different results for the normal Q-Q plot and the Scale-Location plot if I run the diagnostic plots without specifying the plot vs. specifying the plot ... e.g., "plot(model

Re: [R] scanning text file to extract particular word

2008-11-11 Thread remko duursma
Hi Sit, # Read the data: dat <- scan(textConnection(" 0.293290E-05 0.117772E-05 -0.645205 *rs2282755* 0.307521E-05 0.000314 0.412997 *rs1336838* 0.484017E-05 0.218311 0.188669 *rs2660664 rs967785* 0.977861E-05 0.070474 0.294653

[R] scanning text file to extract particular word

2008-11-11 Thread phoebe kong
Hi all, I'm wondering if you know a function that allow me to scan through a whole text file, extracting words start with "rs". For example, below is format of the text file, I would like to extract those words start with "rs" ORDINARY REGRESSION: BEST LASSO PREDICTORS PREDICTORMA

[R] R: R: Hidden Markov Models

2008-11-11 Thread mauede
Thank you for your prompt answer. The breathing signal observations are the amplitude values as a function of time and phase. According to our model the hidden states are the different breathing types. Subjects, whose respiratiion process is regular, are likely to breathe, keeping the same cycle

Re: [R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread Peter Dalgaard
Rolf Turner wrote: On 12/11/2008, at 11:29 AM, Peter Dalgaard wrote: Ben Bolker wrote: Sometime soon when I have the time and energy I will start campaigning for an additional "drop" argument to subset that does what one expects (!!??) with subsetted factor variables ... Not that one ag

Re: [R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread Rolf Turner
On 12/11/2008, at 11:29 AM, Peter Dalgaard wrote: Ben Bolker wrote: Sometime soon when I have the time and energy I will start campaigning for an additional "drop" argument to subset that does what one expects (!!??) with subsetted factor variables ... Not that one again! For at least on

Re: [R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread hadley wickham
> That's why (I think) it should be an *** optional argument > with default set to FALSE *** ... it's clear from the past traffic > on the list (I won't take the time to dig up the thread > references right now) that there is at the very least > a significant minority of users who expect the oppos

Re: [R] Citing R in journal articles (or the failure to)

2008-11-11 Thread Achim Zeileis
Peter: I was reading a paper recently in which I was surprised to see an R package of mine obviously used, without acknowledgement. Indeed, R itself was used without any acknowledgment. So I contact the author about these issues, who said (in part): Regarding the R packages, I used the "tw

Re: [R] exponential of a matrix

2008-11-11 Thread David Winsemius
In 2004 Martyn Plummer said that functionality was available in packages msm (as MatrixExp) and Lindsey's rmutils (as mexp) David Firth also offered: http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic/firth/software/mexp -- David Winsemius On Nov 11, 2008, at 5:20 PM, Terry Therneau

Re: [R] exponential of a matrix

2008-11-11 Thread Peter Dalgaard
Terry Therneau wrote: Is the matrix exponential available in some package? Multiple. At least Matrix and msm. One of Jim Lindsey's too, but I think that's one of the more dubious ones. The cannonical reference is "Nineteen dubious ways to take the exponential of a matrix". (Love that ti

Re: [R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread Ben Bolker
Peter Dalgaard wrote: > Ben Bolker wrote: > >> >> Sometime soon when I have the time and energy I will start >> campaigning for an additional "drop" argument to subset that >> does what one expects (!!??) with subsetted factor variables ... > > Not that one again! For at least one other value o

Re: [R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread Peter Dalgaard
Ben Bolker wrote: Sometime soon when I have the time and energy I will start campaigning for an additional "drop" argument to subset that does what one expects (!!??) with subsetted factor variables ... Not that one again! For at least one other value of one, the expectation is the opposit

[R] Citing R in journal articles (or the failure to)

2008-11-11 Thread Peter Dunn
Hi all I was reading a paper recently in which I was surprised to see an R package of mine obviously used, without acknowledgement. Indeed, R itself was used without any acknowledgment. So I contact the author about these issues, who said (in part): Regarding the R packages, I used the "twe

[R] Checks for partial matching (was Re: Variable passed to function not used in function in select=... in subset)

2008-11-11 Thread Prof Brian Ripley
On Tue, 11 Nov 2008, Duncan Murdoch wrote: On 11/11/2008 2:56 PM, Bert Gunter wrote: Ummm... as today is still Armistice day (in my time zone, anyway), maybe we should call a truce and end this flame war... I haven't seen very many flames -- there have been disagreements, but generally i

[R] exponential of a matrix

2008-11-11 Thread Terry Therneau
Is the matrix exponential available in some package? The cannonical reference is "Nineteen dubious ways to take the exponential of a matrix". (Love that title) Terry T. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

[R] Producing a matrix of values

2008-11-11 Thread Andrew McFadden
I all I am trying to create a matrix for a network diagram: # 1. The following produces two dataframes. The table "place" is a dataframe of all places made from "tra" a tracing table that has the source place and destination place. The table "details" is a dataframe of all source and destination

Re: [R] Updating from an Old to a New version of R

2008-11-11 Thread Erich Neuwirth
On Windows, you also can use Gabor Grothendieck's copydir which is part of his utility set batchfiles available in the "Other" part of CRAN. It copies all packages which are available in a source tree but not available in a target tree from the source tree to the target tree. Then you still have to

Re: [R] data which has different size of elements in each row

2008-11-11 Thread Marc Schwartz
on 11/11/2008 03:39 PM phoebe kong wrote: > Hi all, > > I have problem reading in a text file as follow. > > The following data has not column header. I tried the following > command but failed, > > temp<-read.table("data.txt",header=F) > > An error message stated that line 3 did not have 4 ele

[R] data which has different size of elements in each row

2008-11-11 Thread phoebe kong
Hi all, I have problem reading in a text file as follow. The following data has not column header. I tried the following command but failed, temp<-read.table("data.txt",header=F) An error message stated that line 3 did not have 4 elements. 0.293290E-05 0.117772E-05 -0.645205 rs22

Re: [R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread Ben Bolker
Rolf Turner auckland.ac.nz> writes: [snip] > > But I think that the best approach would be to include a warning in > the documentation of subset, to the effect: ``There are subtle and > difficult issues involved in the use of this function. If you don't > understand the

[R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread Terry Therneau
I've read the back and forth this morning, and I have to side with Vince. 1. Functions that re-interpret their arguments are very dangerous. The original question involved a well formed call to a function, which returned the wrong answer. Bug, design flaw, whatever -- it's a mistake and the

Re: [R] strsplit (regex)

2008-11-11 Thread Hans W. Borchers
stephen sefick gmail.com> writes: > > #how do I break these up into first two letters (RM), number, and then > the last part > #is there an easily accessible regex tutorial on the internet? For regular expressions, the perl man pages at are quite good and

[R] [R-pkgs] trip package: version 1.1-2

2008-11-11 Thread Michael Sumner
Hello, A long overdue update to the 'trip' package is now on CRAN. o New function forceConstraints() to impose the common problems found in track data of duplicated records, and duplicated time stamps. o Bug fix to speedfilter() which would never finish for trips of 3 locations. o Clean up of

[R] congratulations, Ross

2008-11-11 Thread Thomas Lumley
from: http://www.royalsociety.org.nz/Site/news/media_releases/2008/honours08full.aspx#90569-36 Pickering Medal To recognise excellence and innovation in the practical application of technology. Awarded by the Royal Society of New Zealand. Awardee: Associate Professor Ross Ihaka, Departmen

Re: [R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread Terry Therneau
Rolf, Fair comments, mostly. > By and large the difficulties arise only in obscure contexts, when > the user is trying to do something sophisticated. But in the case at hand, the user was doing something simple, and got caught when the function tried to be overly clever. That's rather

[R] read.table not clearing colClasses

2008-11-11 Thread Skewes,Aaron
I am attempting to created colClasses for several tables, then read only specific columns. There are two different table layouts that I am working with. If I use exclusively one layout, the script works perfectly, but if I mix the layouts, it fails to grab the correct columns form layout that is

Re: [R] RES: Multiple XY Lines Plot

2008-11-11 Thread Philipp Pagel
> # prepare some example data > x <- 1:25 > df <- data.frame(w1=x, w2=x+0.5, h1=x^2, h2=3*x+1.3) > > # use matplot to graph all data at once > matplot(df[,c('w1','w2')], df[,c('h1','h2')], type='l', lty=c('solid', > 'dotted')) Oh - and matplot uses different line types anyway, so specifying lty

Re: [R] R design (was "Variable passed to function not used in function in select)

2008-11-11 Thread Rolf Turner
On 12/11/2008, at 4:28 AM, Terry Therneau wrote: I've read the back and forth this morning, and I have to side with Vince. Well, I've read back and forth this morning and I have to side with Berwin Turlach --- whose postings were, I thought, extremely well expressed.

Re: [R] [Rd] is.matrix

2008-11-11 Thread Wacek Kusnierczyk
hadley wickham wrote: > On Tue, Nov 11, 2008 at 1:58 PM, Wacek Kusnierczyk > <[EMAIL PROTECTED]> wrote: > >> hadley wickham wrote: >> >>> On Tue, Nov 11, 2008 at 1:42 PM, Wacek Kusnierczyk >>> <[EMAIL PROTECTED]> wrote: >>> >>> hadley wickham wrote: >> |

Re: [R] Variable passed to function not used in function in select=... in subset

2008-11-11 Thread Duncan Murdoch
On 11/11/2008 2:56 PM, Bert Gunter wrote: Ummm... as today is still Armistice day (in my time zone, anyway), maybe we should call a truce and end this flame war... I haven't seen very many flames -- there have been disagreements, but generally it's been quite civil. Certainly I don't think

Re: [R] standard errors for predict.nls?

2008-11-11 Thread Ben Bolker
Here's how far I've gotten. It's a start, but I can't so far find a way to extract the actual thing we want -- the bootstrap confidence intervals on the predictions. I apologize for not taking the time to go read up on the boot library etc. etc. (I *have* RTFM, but I haven't backtracked to th

Re: [R] RES: Multiple XY Lines Plot

2008-11-11 Thread Philipp Pagel
On Tue, Nov 11, 2008 at 05:11:05PM -0200, Rodrigo Aluizio wrote: > Philipp you actually solved my problem when you mentioned matplot function. > I hadn't read anything about it before, when you mentioned I searched and > I'm getting what I need, now it's just a question of minor adjustments. > > B

Re: [R] Reading tables using a truncated name

2008-11-11 Thread hadley wickham
Which can be simplified to: paths <- dir(path = filePath, pattern = "^test_", full = T) lapply(paths, read.csv) Hadley On Tue, Nov 11, 2008 at 2:01 PM, <[EMAIL PROTECTED]> wrote: > Hi all, > > Thanks everyone for your advice. They have been helpful. > > Just for the record, I am using ... > > l

Re: [R] Reading tables using a truncated name

2008-11-11 Thread chibco
Hi all, Thanks everyone for your advice. They have been helpful. Just for the record, I am using ... lapply(dir(path = filePath, pattern = "^test_"), function(x){read.table(file = paste(filePath, x, sep = ""), sep = ",", header = TRUE) } ) to load the files kind regards Chibisi On Tue, Nov

Re: [R] Variable passed to function not used in function in select=... in subset

2008-11-11 Thread Bert Gunter
Ummm... as today is still Armistice day (in my time zone, anyway), maybe we should call a truce and end this flame war... Cheers, Bert -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Berwin A Turlach Sent: Tuesday, November 11, 2008 9:31 AM To: Duncan M

Re: [R] spearman metric for hierarchical clustering

2008-11-11 Thread Erik Iverson
package Hmisc, function varclus, see ?varclus after loading the package. Examples also in Harrell's book, "Regression Modeling Strategies". Bernd Jagla wrote: I need to calculate a hierarchical clustering using the spearman metric. Is there such functionality within R, and if so can you give m

Re: [R] Variable passed to function not used in function in select=... in subset

2008-11-11 Thread Thomas Lumley
Some of the uses of non-standard evaluation are undoubtedly a problem in R. Probably the worst is in model.frame, because it is much harder to work around. I have never used subset(,select=) and hence have never been at risk of confusion (if you don't like how it works, I suggest you do the s

[R] spearman metric for hierarchical clustering

2008-11-11 Thread Bernd Jagla
I need to calculate a hierarchical clustering using the spearman metric. Is there such functionality within R, and if so can you give me an example on how to use it? Thanks, Bernd [[alternative HTML version deleted]] __ R-help@r-project

[R] strsplit (regex)

2008-11-11 Thread stephen sefick
#how do I break these up into first two letters (RM), number, and then the last part #is there an easily accessible regex tutorial on the internet? v = (structure(1:122, .Label = c("RM215Temp", "RM215SpCond", "RM215DO.Conc", "RM215Depth", "RM215pH", "RM215ORP", "RM215Turbidity.", "RM215Battery", "

[R] Truncated multivariate normal distribution

2008-11-11 Thread James Dean Santos Junior
Dear all There is some package with generation of truncated multivariate normal samples? Best regards, -- James Dean Oliveira dos Santos Jr. MsC em Estatística, UNICAMP (2007) BsC em Estatística, UFAM (2004) [[alternative HTML version deleted]]

[R] RES: Multiple XY Lines Plot

2008-11-11 Thread Rodrigo Aluizio
Philipp you actually solved my problem when you mentioned matplot function. I hadn't read anything about it before, when you mentioned I searched and I'm getting what I need, now it's just a question of minor adjustments. Below is a simple solution that I will now improve. matplot(Perfil$3.W,Perf

Re: [R] Preparing data for display

2008-11-11 Thread Stavros Macrakis
On Mon, Nov 10, 2008 at 9:32 PM, jim holtman <[EMAIL PROTECTED]> wrote: > Have you tried 'do.call(rbind,)'? Thanks for the suggestion! This works nicely. Another member of the list also suggested this approach (in private mail). Another useful suggestion was matplot. I'm still working on mas

Re: [R] Multiple XY Lines Plot

2008-11-11 Thread Philipp Pagel
> Hi list, I?m trying to plot lines in the same graphic. There are lots of > similar topic on the list history. I?ve read about xyplot (lattice) and > other ways to do that but I only got complex error messages, and wasn?t able > even to start a decent R scrip. There are several ways to plot multi

Re: [R] Variable passed to function not used in function in select=... in subset

2008-11-11 Thread Peter Dalgaard
Berwin A Turlach wrote: > G'day Duncan, > > On Tue, 11 Nov 2008 09:37:57 -0500 > Duncan Murdoch <[EMAIL PROTECTED]> wrote: > >> I think this tension is a fundamental part of the character of S and >> R. But it is also fundamental to R that there are QC tests that apply >> to code in packages: so

Re: [R] Variable passed to function not used in function in select=... in subset

2008-11-11 Thread Wacek Kusnierczyk
Gavin Simpson wrote: > >> my whole posting is an attempt, may you try to notice. >> >> vQ >> > > Did you read what you wrote. And you still wonder why you get little > response from certain quarters? > > 1) Don't say "no further comment" - that is quite arrogant to think that > you are right a

Re: [R] how to export results of rcorr into excel

2008-11-11 Thread Dieter Menne
shixin hotmail.com> writes: > > I try to export the outputs of rcorr into excel. but I got error message,"cannot coerce class "rcorr" into a > data.frame". Actually i just need export part of results of this analysis,e.g. p-values or stat-values. library(Hmisc) x <- c(-2, -1, 0, 1, 2) y <- c(4,

Re: [R] simulate data with binary outcome and correlated predictors

2008-11-11 Thread Greg Snow
You could generate all the data as continuous using the idea below, then use the cut function to change some of the normal continuous variables into binary or ordinal variables. It is less clear exactly what the correlation means in this case, but the variables would still have a relationship.

Re: [R] Reading tables using a truncated name

2008-11-11 Thread Dieter Menne
gmail.com> writes: > I am trying to read a bunch of csv files using read.table() that are named > "test_xx.csv" where "xx" has no particular pattern. Is there a way > of reading all the files by specifying a truncated file name e.g. "test_" > with some wild card characters, or would I ha

Re: [R] Variable passed to function not used in function in select=... in subset

2008-11-11 Thread Wacek Kusnierczyk
Gavin Simpson wrote: > > I've found several of these discussions involving Wacek's questions very > enlightening at times; once you get past the "it doesn't work as I > expect so is wrong" attitude. > just one fix: my attitude is 'it doesn't work as i imagine an average user would expect it s

Re: [R] Variable passed to function not used in function in select=... in subset

2008-11-11 Thread Berwin A Turlach
G'day Duncan, On Tue, 11 Nov 2008 09:37:57 -0500 Duncan Murdoch <[EMAIL PROTECTED]> wrote: > I think this tension is a fundamental part of the character of S and > R. But it is also fundamental to R that there are QC tests that apply > to code in packages: so writing new tests that detect danger

[R] Multiple XY Lines Plot

2008-11-11 Thread Rodrigo Aluizio
Hi list, I’m trying to plot lines in the same graphic. There are lots of similar topic on the list history. I’ve read about xyplot (lattice) and other ways to do that but I only got complex error messages, and wasn’t able even to start a decent R scrip. Well I have some paired information (each H W

Re: [R] Reading tables using a truncated name

2008-11-11 Thread Henrique Dallazuanna
Try this: sapply(dir(patt="^test_"), read.table, sep = ";", header = TRUE) On Tue, Nov 11, 2008 at 3:06 PM, <[EMAIL PROTECTED]> wrote: > Dear all, > > I am trying to read a bunch of csv files using read.table() that are named > "test_xx.csv" where "xx" has no particular pattern. Is there

Re: [R] Reading tables using a truncated name

2008-11-11 Thread hadley wickham
?dir Hadley On Tue, Nov 11, 2008 at 11:06 AM, <[EMAIL PROTECTED]> wrote: > Dear all, > > I am trying to read a bunch of csv files using read.table() that are named > "test_xx.csv" where "xx" has no particular pattern. Is there a way > of reading all the files by specifying a truncated fi

Re: [R] Variable passed to function not used in function in select=... in subset

2008-11-11 Thread Berwin A Turlach
On Tue, 11 Nov 2008 12:53:31 +0100 Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > but seriously, when one buys a complicated device one typically reads > a quick start guide, and makes intuitive assumptions about how the > device will work, turning back to the reference when the expectations > fai

[R] Retrieving x argument name from a trellis object in R 2.8.0

2008-11-11 Thread vincenzo . 2 . di-iorio
Dear all, let consider the following function: Fun1 <- function() { library(lattice) plot1 <- 1:10~1:10 pl1 <- xyplot(plot1) return(pl1$call$x) } In R 2.5.0 (or older version) we have > Fun1() plot1 but starting from R 2.5.1 until the latest R 2.8.0 we obtain instead > Fun1() NULL

[R] Reading tables using a truncated name

2008-11-11 Thread chibco
Dear all, I am trying to read a bunch of csv files using read.table() that are named "test_xx.csv" where "xx" has no particular pattern. Is there a way of reading all the files by specifying a truncated file name e.g. "test_" with some wild card characters, or would I have to laboriously c

Re: [R] Manipulation in timeSeries object:how to use the function "applySeries" by daily?

2008-11-11 Thread Jeff Ryan
Take a look at xts, a time series class that extends zoo and is compatible (forward and backwards) with all major time-series classes, including timeSeries from Rmetrics. It has a few functions that may be of interest: ?endpoints ?period.apply It may also be useful to use the Fortran-based aggr

Re: [R] Question about Sort

2008-11-11 Thread Wen Huang
Thanks a lot Professor Ripley! I did not go into much of the details in the help page and was hoping somebody could have a quick answer. The answer you provided is indeed helpful! Thank you. On Nov 11, 2008, at 10:40 AM, Prof Brian Ripley wrote: On Tue, 11 Nov 2008, Wen Huang wrote: Hi

Re: [R] Variable passed to function not used in function in select=... in subset

2008-11-11 Thread Berwin A Turlach
On Tue, 11 Nov 2008 11:27:30 +0100 Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > Berwin A Turlach wrote: > > Why is it worth asking this if nobody else asks it? Most notably a > > certain software company in Redmond, Washington, which is famous for > > carrying on with bad designs and bugs all

Re: [R] Question about Sort

2008-11-11 Thread Prof Brian Ripley
On Tue, 11 Nov 2008, Wen Huang wrote: Hi, I am wondering if there is an option to control how R sort characters on different machines. Yes, and it is described on the help page for sort: The sort order for character vectors will depend on the collating sequence of the locale in us

Re: [R] Plot matrix

2008-11-11 Thread Henrique Dallazuanna
See ?matplot On Tue, Nov 11, 2008 at 10:31 AM, mentor_ <[EMAIL PROTECTED]> wrote: > > Hi, > > I would like to plot the rows of a matrix. > Is there a better way as doing it in the following way?: > > plot(matrix[1,], type="l") > for (i in 2:dim(matrix)[1]) { >lines(matrix[i,], type="l") >

[R] Plot matrix

2008-11-11 Thread mentor_
Hi, I would like to plot the rows of a matrix. Is there a better way as doing it in the following way?: plot(matrix[1,], type="l") for (i in 2:dim(matrix)[1]) { lines(matrix[i,], type="l") } Cheers -- View this message in context: http://www.nabble.com/Plot-matrix-tp20438584p20438584.

[R] "NA" in predict(...., prediction.interval=TRUE)

2008-11-11 Thread CCordeiro
Dear Rlist, In my work I frequently use functions: HoltWinters() and predict(). Last week I have installed R 2.8.0 and a problem occurs: # the data serie<-ts(c(3128,3444,3428,3803,3044,3427,3246,3505,3052,3613,3555,3675,3267,3601,3501,3855), frequency = 4, start = c(1987, 1),end=c(1990,4)) serie

[R] how to export results of rcorr into excel

2008-11-11 Thread shixin
Hi, I try to export the outputs of rcorr into excel. but I got error message,"cannot coerce class "rcorr" into a data.frame". Actually i just need export part of results of this analysis,e.g. p-values or stat-values. Does anyone have sort of exprience before or you can help on how to export

[R] Question about Sort

2008-11-11 Thread Wen Huang
Hi, I am wondering if there is an option to control how R sort characters on different machines. For example, on my Mac OS X > sort(c("H", "a"), decreasing = TRUE) [1] "a" "H" The same command on a Linux machine gives me > sort(c("H", "a"), decreasing = TRUE) [1] "H" "a" I don't know if th

  1   2   >