[R] Quantiles from vectors

2007-12-03 Thread jimbib webber
Each number in the list belowresides in a quantile. When put in order, there are 10 numbers, so the first is in the 0.1 quantile, the second in the 0.2 etc. Lets say we have 10 examples of systolic blood pressure from 30 year olds: 104,95,106,105,110,150,101,98,85,104 This is a random

Re: [R] Controlling Postscript output, size and orientation

2007-12-03 Thread Prof Brian Ripley
Please do tell us exactly what you are doing via a reproducible example (see the footer to every R-help message). I added paper=special to postscript() to make this easier: are you using it? From the help page The postscript produced for a single R plot is EPS (_Encapsulated

[R] Attempt at package documentation on debian: link to data.frame broken

2007-12-03 Thread Johannes Graumann
Hello, I'm trying to document this little package I'm working on and have the following issue: one of the man files (*.Rd) contains this bit \value{ Returns a \code{\link[base]{data.frame}} representing the tabular data. } The resulting link is broken on my debian system. It points to

[R] Help with a Loop

2007-12-03 Thread stathelp
I am having trouble getting a loop to work for the following problem. Any help would be much appreciated. Thanks. I need to find the slope and intercept from the linear regression of Drug Level on Day by Participant. There are a total of 37 Participants. I need to store the Participant, Label,

Re: [R] Help with a Loop

2007-12-03 Thread Dimitris Rizopoulos
look at function lmList() from package 'nlme', e.g., # say 'dat' is you data.frame library(nlme) fm - lmList(DrugLevel ~ Day | Participant, data = dat) fm summary(fm) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic

Re: [R] Attempt at package documentation on debian: link to data.frame broken

2007-12-03 Thread Prof Brian Ripley
On Mon, 3 Dec 2007, Johannes Graumann wrote: Hello, I'm trying to document this little package I'm working on and have the following issue: one of the man files (*.Rd) contains this bit \value{ Returns a \code{\link[base]{data.frame}} representing the tabular data. } The resulting

Re: [R] odfWeave error

2007-12-03 Thread Emmanuel Charpentier
Cleber N. Borges a écrit : hello all, I trying to use the package 'odfWeave' and I get the follow error: ### error message # ... Removing content.xml Post-processing the contents Error in .Call(RS_XML_Parse, file,

Re: [R] Rating R Helpers

2007-12-03 Thread Pablo G Goicoechea
I'm just a R user who joined the list searching solution for a problem. I do not think rating helpers is a good idea. For once, they do it freely; no need to harrash (?) anybody. On the other hand, it could have the opposite effect; people afraid to get a bad rating do not post

[R] help on qcc

2007-12-03 Thread Thorsten Muehge
Hello R Experts, I started to work with the qcc package and it wprks quite nicely. Heres My Code: n - c(55,5,94,25,10,15,15,40,44,34,90,114,204,37,30,28,12,68,64,29,24,14,31,16,62,45,55,20,24,14,9,19,76,57,55,42,6, 54,32,117,19,32,9,11,13,31,27,33,44,28) x -

[R] ggplot2: Choosing colours

2007-12-03 Thread ONKELINX, Thierry
Dear useRs, I'm trying to specify the colour of a factor with ggplot2. The example below gets me close to what I want, but it's missing a legend. Any ideas? Thanks, Thierry library(ggplot2) dataset - data.frame(x = rnorm(40), y = runif(40), z = gl(4, 10, labels = LETTERS[1:4])) ggplot(data =

Re: [R] Attempt at package documentation on debian: link to data.frame broken

2007-12-03 Thread Johannes Graumann
Prof Brian Ripley wrote: So you are talking about the HTML conversion of your help (.Rd) file? (Links appear in other versions too.) The HTML links are intended to be used via help.start(), not directly, and I think you find it actually points to ../../base/html/data.frame.html, which is

Re: [R] Attempt at package documentation on debian: link to data.frame broken

2007-12-03 Thread Prof Brian Ripley
On Mon, 3 Dec 2007, Johannes Graumann wrote: Prof Brian Ripley wrote: So you are talking about the HTML conversion of your help (.Rd) file? (Links appear in other versions too.) The HTML links are intended to be used via help.start(), not directly, and I think you find it actually points

Re: [R] Help with a Loop

2007-12-03 Thread Gabor Grothendieck
There are three ways listed here: https://stat.ethz.ch/pipermail/r-help/2007-May/132866.html On Dec 2, 2007 5:33 PM, stathelp [EMAIL PROTECTED] wrote: I am having trouble getting a loop to work for the following problem. Any help would be much appreciated. Thanks. I need to find the slope

Re: [R] Attempt at package documentation on debian: link to data.frame broken

2007-12-03 Thread Johannes Graumann
posted mailed Prof Brian Ripley wrote: Using non-linked HTML file: style sheet and hyperlinks may be incorrect - which is what happens ... how to switch to linked HTML file? It all works via help.start() (as I did say), at least in a reliable R front end. Running help.start() is how you

Re: [R] Help with tables

2007-12-03 Thread Alejandro Rodríguez
Hello everyone. I want to thank you for your response. I tried this on weekend to attack my problem: 1) Turned into factors all my variables to tabulate: infec1-bamas$P2_A infec2-bamas$P2_B infec3-bamas$P2_C aglomera-bamas$QCL_1 Where bamas is my data

Re: [R] comparison of two vectors

2007-12-03 Thread Ben Bolker
tintin_et_milou wrote: Hello, I have a vector of two columns like this: m/ZI 1000.235 125 1000.356 126.5 ... and a second vector with only one column: m/Z 995.547 1000.320 ... For each value of the second vector I want to associate the

Re: [R] Attempt at package documentation on debian: link to data.frame broken

2007-12-03 Thread Prof Brian Ripley
On Mon, 3 Dec 2007, Johannes Graumann wrote: posted mailed Prof Brian Ripley wrote: Using non-linked HTML file: style sheet and hyperlinks may be incorrect - which is what happens ... how to switch to linked HTML file? It all works via help.start() (as I did say), at least in a reliable

[R] Why is the program too slow?

2007-12-03 Thread Jian Zhang
Hi,everyone. I use the following program calculates Fisher's alpha from counts of individuals and species. The program is wrote by Prof. Kyle Harm. However, when I run the program, it can work very quickly sometimes, but it can not work very well sometimes. It depends on the counts of

Re: [R] Attempt at package documentation on debian: link to data.frame broken

2007-12-03 Thread Prof Brian Ripley
On Mon, 3 Dec 2007, Johannes Graumann wrote: Hmmm, I see. This is all local. So there does not seem to be a way to make any old R installation that loads the package initialize this functionality, so that the help files will be correctly interlinked directly after require or library? How do

Re: [R] ggplot2: Choosing colours

2007-12-03 Thread Domenico Vistocco
qplot(data=dataset, x, y, colour=z) ONKELINX, Thierry wrote: Dear useRs, I'm trying to specify the colour of a factor with ggplot2. The example below gets me close to what I want, but it's missing a legend. Any ideas? Thanks, Thierry library(ggplot2) dataset - data.frame(x =

Re: [R] Attempt at package documentation on debian: link to data.frame broken

2007-12-03 Thread Johannes Graumann
Hmmm, I see. This is all local. So there does not seem to be a way to make any old R installation that loads the package initialize this functionality, so that the help files will be correctly interlinked directly after require or library? How do other packages manage that? Joh On Monday 03

Re: [R] Why is the program too slow?

2007-12-03 Thread Ben Bolker
zhang jian wrote: Hi,everyone. I use the following program calculates Fisher's alpha from counts of individuals and species. The program is wrote by Prof. Kyle Harm. However, when I run the program, it can work very quickly sometimes, but it can not work very well sometimes. It depends

Re: [R] ggplot2: Choosing colours

2007-12-03 Thread ONKELINX, Thierry
Dear Domenico, It looks like my question wasn't very clear. I want to specify the colours meself. Colour = z will use default colours and I'd like to change those. I need to change them into red, green, blue and black instead of pink, brown, green and blue. The solution should have the layout

[R] Linear Regression, Data is a list

2007-12-03 Thread livia
Hello, I would like to perform a linear regression and the data is a list.e.g lm(list$abc~., data=list) or lm(abc~., data=list), which would give the same result. The problem is I would like to call the response variable in a more general form. What I try to achieve is sth like

Re: [R] Why is the program too slow?

2007-12-03 Thread Dimitris Rizopoulos
try RSiteSearch(Fisher's alpha) which indicates that there is the fishers.alpha() function in package 'untb' that does the same thing, e.g., fishers.alpha(1000, 70) fishers.alpha(1580, 30) fishers.alpha(1000, 7) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student

Re: [R] ggplot2: Choosing colours

2007-12-03 Thread hadley wickham
Hi Thierry, Have a look at http://had.co.nz/ggplot2/scale_identity. (The way you are currently doing it only works because you are not using any kind of grouping/facetting, and I'm thinking about adding an explicit message/warning for this case) Hadley On 12/3/07, ONKELINX, Thierry [EMAIL

[R] cor(data.frame) infelicities

2007-12-03 Thread Michael Friendly
In using cor(data.frame), it is annoying that you have to explicitly filter out non-numeric columns, and when you don't, the error message is misleading: cor(iris) Error in cor(iris) : missing observations in cov/cor In addition: Warning message: In cor(iris) : NAs introduced by coercion It

Re: [R] help on qcc

2007-12-03 Thread David Winsemius
Thorsten Muehge [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED] Hello R Experts, I started to work with the qcc package and it wprks quite nicely. Heres My Code: n - c(55,5,94,25,10,15,15,40,44,34,90,114,204,37,30,28,12,68,64,29,24,14,31 ,16,62,45,55,20,24,14,9,19,76,57,55,42,6,

Re: [R] cor(data.frame) infelicities

2007-12-03 Thread Gabor Grothendieck
You can calculate the Kendall rank correlation with such a matrix so you would not want to exclude factors in that case: cor(iris, method = kendall) Sepal.Length Sepal.Width Petal.Length Petal.WidthSpecies Sepal.Length 1. -0.076996790.7185159 0.6553086 0.670

[R] linking C/C++ external libraries.

2007-12-03 Thread Jarrod Hadfield
Hi Everyone, I'm trying to load some C++ code using dyn.load but I'm getting unresolved symbols associated with some external libraries (CSparse). I gather this is something to do with linking as the the code compiles fine. However, I've passed

[R] find the numerical of acf

2007-12-03 Thread fancy hou
I want to know how to use R to get the numerical values of the estimated ACF b(k) and PACF bkk ? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] ggplot2: Choosing colours

2007-12-03 Thread ONKELINX, Thierry
Thanks Hadley. The page you referred to was actually http://had.co.nz/ggplot2/scale_identity.html The solution to my problem was library(ggplot2) dataset - data.frame(x = rnorm(40), y = runif(40), z = gl(4, 10, labels = LETTERS[1:4])) dataset$MyColour - factor(dataset$z, labels = c(red, green,

Re: [R] find the numerical of acf

2007-12-03 Thread Henrique Dallazuanna
Perhaps: acf(rnorm(100), plot=FALSE)$acf[,,1] pacf(rnorm(100), plot=FALSE)$acf[,,1] On 02/12/2007, fancy hou [EMAIL PROTECTED] wrote: I want to know how to use R to get the numerical values of the estimated ACF b (k) and PACF b kk ? __

[R] permutation tests of regression trees

2007-12-03 Thread Roland Knapp
I'm interested in performing permutation tests of regression tree models (my models are developed using rpart). The package rpart.permutation is not available for Windows, so I am wondering if there are any alternative packages available (a search of R-project.org did not turn up anything).

Re: [R] Linear Regression, Data is a list

2007-12-03 Thread Henrique Dallazuanna
If i understand your question, you can try this: lapply(paste(lis$, names(lis), ~ . , sep=), lm, data=lis) On 03/12/2007, livia [EMAIL PROTECTED] wrote: Hello, I would like to perform a linear regression and the data is a list.e.g lm(list$abc~., data=list) or lm(abc~., data=list), which

[R] restore NAs in residuals

2007-12-03 Thread rem la
Dear All, I have two vectors: tt = c(6.87, 7.43, 6.4, 4.5, 5.5, 5.87, NA, NA, NA, 7.7) year = 1966:1975 Residuals lm(tt~year)$res do not contain NAs for the three years of missing temperature tt. Is there a simple way to get these NAs back into the residual's vector? Thank you, Sorama

Re: [R] restore NAs in residuals

2007-12-03 Thread Gabor Grothendieck
Try this: resid(lm(tt~year, na.action = na.exclude)) 1 2 3 4 5 6 7 0.7114894 1.2231383 0.1447872 -1.8035638 -0.8519149 -0.5302660 NA 8 9 10 NA NA 1.1063298 On Dec 3, 2007 10:31

Re: [R] Linear Regression, Data is a list

2007-12-03 Thread Gabor Grothendieck
See: http://www.nabble.com/matrix-(column-wise)-multiple-regression-t4862261.html On Dec 3, 2007 8:58 AM, livia [EMAIL PROTECTED] wrote: Hello, I would like to perform a linear regression and the data is a list.e.g lm(list$abc~., data=list) or lm(abc~., data=list), which would give the same

Re: [R] restore NAs in residuals

2007-12-03 Thread Prof Brian Ripley
You need to use na.action=na.exclude, _and_ to use the proper extractor function residuals() rather than pick up a component of the fitted object by partial matching. See ?residuals.lm and ?naresid On Mon, 3 Dec 2007, rem la wrote: Dear All, I have two vectors: tt = c(6.87, 7.43, 6.4,

Re: [R] using color coded colorbars for bar plots

2007-12-03 Thread hadley wickham
On 12/2/07, Jim Lemon [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi Jim, Thanks for getting back to me so quickly. I did look at color.legend, but that seems to plot colored blocks for the observations (in this case the mean) and not for the color.scale (which represents

Re: [R] Problem with scan() from UTF-8 encoded URL

2007-12-03 Thread john seers (IFR)
Hello Works fine for me: data -scan(file='http://en.wikipedia.org/wiki/Special:Recentchanges',what='c haracter') Read 3581 items So I don't think it is the Wikipedia end. Regards John Seers --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf

Re: [R] linking C/C++ external libraries.

2007-12-03 Thread Dirk Eddelbuettel
On 3 December 2007 at 14:54, Jarrod Hadfield wrote: | I'm trying to load some C++ code using dyn.load but I'm getting | unresolved symbols associated with some external libraries | (CSparse). I gather this is something to do with linking as the the | code compiles fine. However, I've

[R] Problem with scan() from UTF-8 encoded URL

2007-12-03 Thread EUROPOL
Hallo, I am trying to import a website and structure it from within R: The following code: data - scan(file='http://en.wikipedia.org/wiki/Special:Recentchanges',what='character') results in the error: Error in file(file, r) : unable to open connection In addition: Warning message: cannot

Re: [R] linking C/C++ external libraries.

2007-12-03 Thread Jarrod Hadfield
Hi Dirk, ldd is not bringing up csparse which suggests that it is a linking problem. For liking I used both the SHLIB and INSTALL comands using - L (see below), but both generate the same problem. Cheers, Jarrod [EMAIL PROTECTED] ~]$ R CMD SHLIB ~/Work/AManal2/src/SStest.cc -L/

[R] Plotting monthly timeseries with an x-axis in time format

2007-12-03 Thread vittorio
I have the following timeseries tab = str(tab) mts [1:23, 1:2] 79.5 89.1 84.9 75.7 72.8 ... - attr(*, dimnames)=List of 2 ..$ : NULL ..$ : chr [1:2] Ipex...I Omel...E - attr(*, tsp)= num [1:3] 2006 2008 12 - attr(*, class)= chr [1:2] mts ts tab

[R] overlapping labels

2007-12-03 Thread Biscarini, Filippo
Good evening, I am trying to add labels to the point of a simple plot, using the text() function; the problem is that sometimes, if two points are too close to each other, labels overlap and are no longer readable. I was wondering whether there are options that I can use to prevent this

Re: [R] speeding up likelihood computation

2007-12-03 Thread Deepankar Basu
Hi Jim, Thanks for your suggestion. My guess is that most of the time is taken by various kinds of assignments that I am making using loops; and these can be done without loops. In a follow-up post, I will try to explain in greater detail each part of my code (especially the parts where

Re: [R] Rating R Helpers

2007-12-03 Thread Mike Prager
John Sorkin [EMAIL PROTECTED] wrote: I believe we need to know the following about packages: (1) Does the package do what it purports to do, i.e. are the results valid? (2) Have the results generated by the package been validate against some other statistical package, or hand-worked example?

Re: [R] using color coded colorbars for bar plots

2007-12-03 Thread Bert Gunter
... but the best option is not to do this kind of technicolor extravaganza at all! See ?dotplot (in lattice) and ?dotchart for better alternatives. Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hadley

Re: [R] Problem with scan() from UTF-8 encoded URL

2007-12-03 Thread EUROPOL
, Thank you for trying. Strange. I am using R version 2.6.0 Patched (2007-11-09 r43408) on OSX and it is not working. I guess it has something to do with the language settings. However. Regards Marc Schwenzer john seers (IFR) wrote: Hello Works fine for me: data

Re: [R] using color coded colorbars for bar plots

2007-12-03 Thread hadley wickham
On 12/3/07, Bert Gunter [EMAIL PROTECTED] wrote: ... but the best option is not to do this kind of technicolor extravaganza at all! Yes, good point! And of a course of a scatterplot of mean vs variance will best reveal the relationship between the two variables. Hadley -- http://had.co.nz/

Re: [R] overlapping labels

2007-12-03 Thread Duncan Murdoch
On 12/3/2007 12:21 PM, Biscarini, Filippo wrote: Good evening, I am trying to add labels to the point of a simple plot, using the text() function; the problem is that sometimes, if two points are too close to each other, labels overlap and are no longer readable. I was wondering whether

Re: [R] speeding up likelihood computation

2007-12-03 Thread Deepankar Basu
Jim and others, As far as I can see the computation of certain conditional probabilities (required for computing my likelihood function) is what is slowing down the evaluation of the likelihood function. Let me explain what these conditional probabilities are and how I am (no doubt inefficiently)

[R] Fwd: source('clipboard')

2007-12-03 Thread Fernando Saldanha
In the code below the first source command works fine, but the second does not, as can be seen from the error message. Is there a way to have the second command work? I am using R 2.6.1 on Windows Vista. (The command that is in the clipboard is just x - 3) source(clipboard, echo = F)

[R] Installing packages

2007-12-03 Thread Dani Valverde
Hello, I have a problem when making packages with version 2.6.1. I have a package which I could install in version 2.5.1. I have made some modifications of the package, and I would like to install it to 2.6.1. I check the package with R CMD check, I build it with R CMD build and when I try to

[R] Efficient computation of average covariance matrix over a list

2007-12-03 Thread Rick DeShon
Hi All. I would like to compute a separate covariance matrix for a set of variables for each of the levels of a factor and then compute the average covariance matrix over the factor levels. I can loop through this computation but I need to perform the calculation for a large number of levels and

Re: [R] cor(data.frame) infelicities

2007-12-03 Thread Gabor Grothendieck
You are right but I was just trying to stick to the same example. In reality it would be ok as long as its an ordered factor. One could restrict it to those of class ordered. On Dec 3, 2007 1:58 PM, Liaw, Andy [EMAIL PROTECTED] wrote: I'd call that another infelicity. Species is supposed to

[R] coplot and xyplot and panel functions

2007-12-03 Thread Monica Pisica
Hi, I wrote a panel function called panelwhite.corplot. If i use this function in a coplot is working fine, but if i use same function with xyplot i get the error: Error using packet 1: plot.new has not been called yet . and so on filling all my plots. So with: coplot(be~ch|dbh1,

[R] Putting a NULL in a list (as cannot pass NA to C++)

2007-12-03 Thread Rees, David
Hi, If I do the following I can have a NULL in a list x - list( 1, list(3,NULL,4), 5 ) x [[1]] [1] 1 [[2]] [[2]][[1]] [1] 3 [[2]][[2]] NULL [[2]][[3]] [1] 4 [[3]] [1] 5 This is a good thing for me as it can be passed through into C++ where I can know the value is missing. (Can't seem to

Re: [R] cor(data.frame) infelicities

2007-12-03 Thread Liaw, Andy
I'd call that another infelicity. Species is supposed to be nominal, not ordinal, so rank correlation wouldn't make much sense. So what does cor(, method=kendall) do? It looks like it simply uses the underlying numeric code. (Change Species to numerics and you'll see the same answer.)

Re: [R] about col in heatmap.2

2007-12-03 Thread Earl F. Glynn
affy snp [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] For example, it should go from very red---red---less red---darkgreen---very green coinciding with the descending order of values, just like the very left panel shown in

Re: [R] Plotting monthly timeseries with an x-axis in time format

2007-12-03 Thread Gabor Grothendieck
This can be done with plot.zoo and a panel function: tab - ts(cbind(A = c(79.47, 89.13, 84.86, 75.68, 72.82, 78.87, 93.46, 78.18, 82.46, 77.25, 80.95, 84.39, 81.7, 74.76, 65.29, 60.3, 66.59, 73.19, 92.39, 65.76, 77.45, 74.22, 101.36, 100.01), B = c(77.95, 76.73, 51.2, 51.86, 51.29, 49.45, 53.88,

[R] difficulties getting coef() to work in some lmer() calls

2007-12-03 Thread David Park
I'm working with Andrew Gelman on a book project and we're having some difficulties getting coef() to work in some lmer() calls. Some versions of the model work and some do not. For example, this works (in that we can run the model and do coef() from the output): R2 - lmer(y2 ~ factor(z.inc) +

[R] [R-pkgs] new package 'bvls', update of 'nnls'

2007-12-03 Thread Katharine Mullen
A new package 'bvls' is available on CRAN. The package provides an R interface to the Stark-Parker algorithm for bounded-variable least squares (BVLS) that solves A x = b with the constraint l = x = u under least squares criteria, where l,x,u \in R^n, b \in R^m and A is an m \times n matrix. The

Re: [R] overlapping labels

2007-12-03 Thread Gavin Simpson
Duncan Murdoch wrote: On 12/3/2007 12:21 PM, Biscarini, Filippo wrote: Good evening, I am trying to add labels to the point of a simple plot, using the text() function; the problem is that sometimes, if two points are too close to each other, labels overlap and are no longer readable. I

Re: [R] coplot and xyplot and panel functions

2007-12-03 Thread Deepayan Sarkar
On 12/3/07, Monica Pisica [EMAIL PROTECTED] wrote: Hi, I wrote a panel function called panelwhite.corplot. If i use this function in a coplot is working fine, but if i use same function with xyplot i get the error: Error using packet 1: plot.new has not been called yet . and so on

Re: [R] comparison of two vectors

2007-12-03 Thread tintin_et_milou
Thanks for your help, but there is some more problem. The two vectors have not the same length so there is a problem with cbind. I give you an example. My first vector is g[g[,1]2035 g[,1]2050,] M.Z Intensity 2035.836 652.9494 2035.939 664.5841 2036.043 696.0554 2036.146

Re: [R] Controlling Postscript output, size and orientation

2007-12-03 Thread Nathan Vandergrift
Prof Brian Ripley wrote: Please do tell us exactly what you are doing via a reproducible example (see the footer to every R-help message). That code was in my original message, here it is again: par(bg=yellow, lab=c(10,6,7), #mai=c(1.25, 1, 0.2, 0.2),

[R] Make error while installing R 2.6.1 on GNU/linux

2007-12-03 Thread Dieter Best
Hello there, I am having trouble installing R-2.6.1 on GNU/linux. Here is how I configure and run it: ./configure --with-x=no --enable-R-shlib make The configure step is uneventful, the tail end of make follows. Does anyone have any experience with that? Thanks a lot in advance for any

[R] Efficient computation of average covariance matrix over a list

2007-12-03 Thread Rick DeShon
Hi All. I would like to compute a separate covariance matrix for a set of variables for each of the levels of a factor and then compute the average covariance matrix over the factor levels. I can loop through this computation but I need to perform the calculation for a large number of levels and

Re: [R] Putting a NULL in a list (as cannot pass NA to C++)

2007-12-03 Thread Charles C. Berry
On Mon, 3 Dec 2007, Rees, David wrote: Hi, If I do the following I can have a NULL in a list x - list( 1, list(3,NULL,4), 5 ) x [[1]] [1] 1 [[2]] [[2]][[1]] [1] 3 [[2]][[2]] NULL [[2]][[3]] [1] 4 [[3]] [1] 5 This is a good thing for me as it can be passed through into C++

Re: [R] question about extreme value distribution

2007-12-03 Thread Avril Coghlan
Dear Greg, thank you for your reply - that is very helpful! regards Avril Greg Snow [EMAIL PROTECTED] wrote: As an alternative you could try quantile regression (find a regression line for the 95th percentile), if the relationship between max(y) and x is only due to more points (and therefore

[R] R-help google group

2007-12-03 Thread Vincent Nijs
I made a google group archive of current and future R-help posts at http://groups.google.com/group/r-help-archive If you are signed-up for the R-help mailing list with a gmail account you can reply to posts through the google group pages. Note that this is not a separate mailing-list, just a copy

Re: [R] Plotting monthly timeseries with an x-axis in time format

2007-12-03 Thread vittorio
Unfortunately something doesn't work: tab - ts(cbind(A = c(79.47, 89.13, 84.86, 75.68, 72.82, 78.87, 93.46, + 78.18, 82.46, 77.25, 80.95, 84.39, 81.7, 74.76, 65.29, 60.3, + 66.59, 73.19, 92.39, 65.76, 77.45, 74.22, 101.36, 100.01), B = c(77.95, + 76.73, 51.2, 51.86, 51.29, 49.45, 53.88, 47.96,

[R] Ordering the levels of a vector

2007-12-03 Thread Judith Flores
Hi, I have a vector in a data frame that looks something like this: day-c('Day -1','Day 6','Day 10') This vector specifies the order in which several panel will appear in a lattice plots. But the order in which such plots will appear will be the following: Day -1, Day 10, Day 6. Which

Re: [R] Ordering the levels of a vector

2007-12-03 Thread Deepayan Sarkar
On 12/3/07, Judith Flores [EMAIL PROTECTED] wrote: Hi, I have a vector in a data frame that looks something like this: day-c('Day -1','Day 6','Day 10') This vector specifies the order in which several panel will appear in a lattice plots. But the order in which such plots will

Re: [R] Ordering the levels of a vector

2007-12-03 Thread Marc Schwartz
On Mon, 2007-12-03 at 13:21 -0800, Judith Flores wrote: Hi, I have a vector in a data frame that looks something like this: day-c('Day -1','Day 6','Day 10') This vector specifies the order in which several panel will appear in a lattice plots. But the order in which such

Re: [R] cor(data.frame) infelicities

2007-12-03 Thread Michael Friendly
Returning to my original post, I still believe that a basic work-horse like cor(data.frame) with the default method=pearson should try to do something more useful in this case than barf with a misleading error message if the data frame contains character variables. To paraphrase Einstein,

Re: [R] Ordering the levels of a vector

2007-12-03 Thread Gabor Grothendieck
Try mixedsort in the gtools package. On Dec 3, 2007 4:21 PM, Judith Flores [EMAIL PROTECTED] wrote: Hi, I have a vector in a data frame that looks something like this: day-c('Day -1','Day 6','Day 10') This vector specifies the order in which several panel will appear in a lattice

Re: [R] Help with tables

2007-12-03 Thread T.K.
1. If you would like to use your way, you can reduce the steps by assigning the common factor levels to all three variables in step 1). Then, all the tables will have the same dimension, so you can completely skip step 3) and 4). Then, the code would be slightly more general but not general

[R] R-help google group archive

2007-12-03 Thread Vincent
I made a google group archive of current and future R-help posts at http://groups.google.com/group/r-help-archive If you are signed-up for the R-help mailing list with a gmail account you can post/reply through the google group pages. Note that this is not a separate mailing-list, just a copy of

Re: [R] fitting power model in nls()

2007-12-03 Thread Gabor Grothendieck
I played around with this a bit more and noticed that the plinear algorithm of nls converged using nearly every starting value I tried. In fact A = 0 was the only starting value that I could find that did not converge. Note that with plinear you only specify the starting values for non-linear

Re: [R] modeling time series with ARIMA

2007-12-03 Thread Gad Abraham
eugen pircalabelu wrote: Good afternoon! I'm trying to model a time series on the following data, which represent a monthly consumption of juices: x-scan() 1: 2859 3613 3930 5193 4523 3226 4280 3436 3235 3379 3517 6022 13: 4465 4604 5441 6575 6092 6607 6390 6150 6488

Re: [R] strsplit on comma, with a trailing comma in input

2007-12-03 Thread Benilton Carvalho
my understanding is that this behavior is known (the help file mentions something along these lines in the example). i'd use something like: theText - a,,b, theText - gsub(\\,$, , , theText) and then use strsplit() on theText b On Dec 3, 2007, at 6:22 PM, dankelley wrote: I have a

[R] strsplit on comma, with a trailing comma in input

2007-12-03 Thread dankelley
I have a comma-separated data file in which trailing commas sometimes occur. I am using strsplit to extract the data from this file, and it seems great except in cases with trailing comma characters. The example below illustrates. What I'd like is to get a fourth element in the answer, being

Re: [R] strsplit on comma, with a trailing comma in input

2007-12-03 Thread Peter Dalgaard
dankelley wrote: I have a comma-separated data file in which trailing commas sometimes occur. I am using strsplit to extract the data from this file, and it seems great except in cases with trailing comma characters. The example below illustrates. What I'd like is to get a fourth element in

Re: [R] strsplit on comma, with a trailing comma in input

2007-12-03 Thread Gabor Grothendieck
Try appending another comma: strsplit(paste(a,,b,, ,, sep = ), ,) On Dec 3, 2007 6:22 PM, dankelley [EMAIL PROTECTED] wrote: I have a comma-separated data file in which trailing commas sometimes occur. I am using strsplit to extract the data from this file, and it seems great except in

Re: [R] strsplit on comma, with a trailing comma in input

2007-12-03 Thread dankelley
This works perfectly. Thanks! Peter Dalgaard wrote: Hmm, I don't think strsplit can do that. However: scan(textConnection(a,,b,), sep=,, what=) Read 4 items [1] a b -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of

[R] 3D array

2007-12-03 Thread threshold
Hi, I deal with 3D array say: , , 1 [,1] [,2] [,3] [,4] [,5] [1,]147 10 13 [2,]258 11 14 [3,]369 12 15 , , 2 [,1] [,2] [,3] [,4] [,5] [1,] 16 19 22 25 28 [2,] 17 20 23 26 29 [3,] 18 21 24 27 30 , , 3

Re: [R] 3D array

2007-12-03 Thread Benilton Carvalho
say your array is called no.named.array. then: no.named.array[no.named.array == 0] - NA rowMeans(no.named.array, dims=2, na.rm=T) b On Dec 3, 2007, at 7:24 PM, threshold wrote: Hi, I deal with 3D array say: , , 1 [,1] [,2] [,3] [,4] [,5] [1,]147 10 13 [2,]25

[R] Junk or not Junk

2007-12-03 Thread Loren Engrav
So a message from Benilton Carvalho [EMAIL PROTECTED] (sent by [EMAIL PROTECTED]) arrives and goes in the Junk Mail even tho I have set @r-project.org to not be junk Why does this go in Junk mail if @r-project.org is defined as not junk? -- If we knew what we were doing, it would not be

[R] color palette from red to blue passing white

2007-12-03 Thread Linda Smith
Hi All, I am looking for a color palette like this: http://www.ncl.ucar.edu/Applications/Images/h_long_5_lg.png I think I found out how some time ago (something like Colors[1:n]), but when I now wanna use it, I could not remember how I did it. Does anyone know which package I could use? Many

Re: [R] color palette from red to blue passing white

2007-12-03 Thread jim holtman
see if this is what you need: require(lattice) x - matrix(1:100,10) levelplot(x,col.regions=colorRampPalette(c('dark red','white','dark blue'))) On Dec 3, 2007 5:41 PM, Linda Smith [EMAIL PROTECTED] wrote: Hi All, I am looking for a color palette like this:

Re: [R] Junk or not Junk

2007-12-03 Thread Duncan Murdoch
On 03/12/2007 8:56 PM, Loren Engrav wrote: So a message from Benilton Carvalho [EMAIL PROTECTED] (sent by [EMAIL PROTECTED]) arrives and goes in the Junk Mail even tho I have set @r-project.org to not be junk Why does this go in Junk mail if @r-project.org is defined as not junk?

Re: [R] color palette from red to blue passing white

2007-12-03 Thread Achim Zeileis
On Mon, 3 Dec 2007, jim holtman wrote: see if this is what you need: require(lattice) x - matrix(1:100,10) levelplot(x,col.regions=colorRampPalette(c('dark red','white','dark blue'))) Instead of colorRampPalette(), you could also use diverge_hcl() in package vcd to get a

[R] Problem with a global variable

2007-12-03 Thread Thomas L Jones, PhD
From: Thomas Jones I have several user-defined functions. As is standard practice, I am defining a logical vector named idebug in order to control debugging printouts. For example, if idebug [1] has the value TRUE, such-and-such debugging printouts are enabled. After the function works, some

Re: [R] Problem with a global variable

2007-12-03 Thread Gabor Grothendieck
You may wish to use the options command. You can create your own options, not just use pre-existing ones. Please read the last line of every message to r-help. On Dec 4, 2007 12:51 AM, Thomas L Jones, PhD [EMAIL PROTECTED] wrote: From: Thomas Jones I have several user-defined functions. As