Re: [R] day, month, year functions

2006-08-18 Thread Gregor Gorjanc
Gabor Grothendieck wrote: On 8/17/06, Martin Maechler [EMAIL PROTECTED] wrote: Gregor == Gregor Gorjanc [EMAIL PROTECTED] on Fri, 11 Aug 2006 00:27:27 + (UTC) writes: [snip] There are two problems: 1. as.POSIXlt is not generic. (This problem may not be too important given

Re: [R] R Site Search directly from Firefox's address bar

2006-08-18 Thread Romain Francois
Le 17.08.2006 20:56, Adrian Dusa a écrit : On Thursday 17 August 2006 21:41, Peter Dalgaard wrote: [...] Breaks the feature that you get to www.r-project.org just by typing r, though... It breaks also every usage of the google feeling lucky default behaviour which is really useful

Re: [R] R Site Search directly from Firefox's address bar

2006-08-18 Thread Adrian Dusa
On Friday 18 August 2006 10:08, Romain Francois wrote: Le 17.08.2006 20:56, Adrian Dusa a écrit : [...] It breaks also every usage of the google feeling lucky default behaviour which is really useful I think. There are R related firefox search plugins on mycroft. Find more info on that on

[R] Odd behaviour of R

2006-08-18 Thread Hiroto Miyoshi
Dear R-users I need your help. I am agonised by the odd behaviour of R described below In the following program, data.frame work contains no rows, when Pb set to 0.3 and 0.7 data-read.csv(output.csv,header=TRUE) for(N in c(20,40,80,160,320,640,1280)){ for(Pb in seq(0.1,0.9,0.1)){

[R] using R to perform a word count - syntax refinement and incorrect number of dimensions error

2006-08-18 Thread Bob Green
Hello, I am hoping someone can advise me regarding an error message I received and if needed, refine some syntax. I am wanting to calculate the word count for each row of a dataframe. Below, I have 3 variables (V3.PD, V3.HD, V3.LP) which I want to obtain a word count for, by each row which

[R] Maximum length of R GUI input line?

2006-08-18 Thread Eric Fegraus
Hello, I'm using R 2.3.1 on Windows. I'm generating some very long SQL statements. I do this by using paste() which will contain many strings and variables. I'm getting an error when the the total line length is longer than about 1013 characters. For example, it works with the line

Re: [R] fitting truncated normal distribution

2006-08-18 Thread Schweitzer, Markus
Thank you Sundar, Yes, always integers. By demand data I meant the amount of ordered products in a certain period. Therefore, x is a vector of periods (i.e. Weeks in a year) In my example we could see an article, that has only been ordered in two weeks within one year. All the zeros show, that

Re: [R] Odd behaviour of R

2006-08-18 Thread Roger Bivand
On Fri, 18 Aug 2006, Hiroto Miyoshi wrote: Dear R-users I need your help. I am agonised by the odd behaviour of R described below In the following program, data.frame work contains no rows, when Pb set to 0.3 and 0.7 data-read.csv(output.csv,header=TRUE) for(N in

Re: [R] Maximum length of R GUI input line?

2006-08-18 Thread Philippe Grosjean
You should put your SQL query in a variable, and use this variable in your call. Something like: MyQuery - bla bla bla MyQuery - paste(MyQuery, more bla bla) # doMyRequest(MyQuery) Best, Philippe Grosjean Eric Fegraus wrote: Hello, I'm using R 2.3.1 on Windows. I'm generating

Re: [R] Maximum length of R GUI input line?

2006-08-18 Thread Prof Brian Ripley
On Fri, 18 Aug 2006, Philippe Grosjean wrote: You should put your SQL query in a variable, and use this variable in your call. Something like: MyQuery - bla bla bla MyQuery - paste(MyQuery, more bla bla) # doMyRequest(MyQuery) Indeed. For the record, R has an limit of 1024 chars

[R] rotating axis labels in plot with multiple plots

2006-08-18 Thread Karin Lagesen
I have a plot like this, consisting of 18 different vioplots: (monospaced font) - - - - - - lab |16 | |13 | |10 | | 7 | | 4 | | 1 | - - - - - - lab |17 | |14 | |11 | | 8 | | 5 | | 2 | - - - - - - lab |18 | |15 |

Re: [R] ARMA(1,1) for panel data

2006-08-18 Thread Spencer Graves
For normal panel data, the standard R tool is the nlme package, documented in Pinheiro and Bates (2000) Mixed-Effects Models for S and S-Plus (Springer). See the examples in ?corARMA. I recommend you spend some quality time with Pinheiro and Bates (2000). If you do that, I

Re: [R] NLS and IV

2006-08-18 Thread Spencer Graves
RSiteSearch(grogger) produced nothing, which suggests that the paper you cite is NOT cited in a help page in any package contributed to CRAN. However, RSiteSearch(instrumental variables) just produced 31 hits for me, among which #11 was for systemfit{systemfit}, which mentions

[R] 4^2 factorial help

2006-08-18 Thread Correia, L, Mr [EMAIL PROTECTED]
To whom it may concern: I am trying a factorial design a system of mine that has two factors. Each factor was set at four different levels, with one replication for each of the combinations. My data is as follows: A B Response 16002.5

Re: [R] using R to perform a word count - syntax refinement and incorrect number of dimensions error

2006-08-18 Thread jim holtman
'wc1' is a vector and not a matrix. The reference 'wc1[,1]' is not legal: wc1 -c(V3.PD, V3.HD, V3.LP) dim(wc1) NULL wc1[,1] Error in wc1[, 1] : incorrect number of dimensions What is it that you are trying to do? On 8/18/06, Bob Green [EMAIL PROTECTED] wrote: Hello, I am hoping someone

Re: [R] 4^2 factorial help

2006-08-18 Thread Paul Smith
On 8/18/06, Correia, L, Mr [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: To whom it may concern: I am trying a factorial design a system of mine that has two factors. Each factor was set at four different levels, with one replication for each of the combinations. My data is as follows:

Re: [R] fitting truncated normal distribution

2006-08-18 Thread Sundar Dorai-Raj
Hi, Markus, One other suggestion is to add the lower argument to fitdistr: fitdistr(x, dtnorm0, start = list(mean = 0, sd = 1), lower = 0) where dtnorm0 is defined as before. This indicates to fitdistr that the optimization should be constrained. See ?optim for details. --sundar Schweitzer,

[R] Insert rows - how can I accomplish this in R

2006-08-18 Thread Sachin J
Hi, I have following dataframe. Column A indicates months. DF - structure(list(A = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 7, 8, 11, 12, 1, 2, 3, 4, 5, 8), B = c(0, 0, 0, 8, 0, 19, 5, 19, 0, 0, 0, 11, 0, 8, 5, 11, 19, 8, 11, 10, 0, 8, 36, 10, 16, 10, 22)), .Names =

Re: [R] 4^2 factorial help

2006-08-18 Thread Liaw, Andy
If you really want the quadratic terms, you need to keep those variables as numeric, instead of factors. (You might also want to look into something like the central composite designs.) summary() and coef() on the resulting fitted object should give you want you need. Things like these are

Re: [R] Lattice package par.settings/trellis.par.settings questions

2006-08-18 Thread Haynes, Maurice \(NIH/NICHD\) [E]
I am also trying to learn about lattice plots. To get a succinct listing of the names of the lists of default parameter settings, try: names(trellis.par.get()) To get a succinct listing of all the default parameter settings, try: str(trellis.par.get()) HTH, Maurice Haynes -Original

Re: [R] Variance Components in R

2006-08-18 Thread Iuri Gavronski
Harold, I don't have a grouping variable. And yes, persons can be an important source of variance, and they are the resp variable. rating is the response.variable in the model you specified below. aov perhaps could give me distorted results, because of unbalanced data (what estimation method it

Re: [R] Insert rows - how can I accomplish this in R

2006-08-18 Thread Gabor Grothendieck
Here are two solutions. In both we break up DF into rows which start with 1. In solution #1 we create a new data frame with the required sequence for A and zeros for B and then we fill it in. In solution #2 we convert each set of rows to a zoo object z where column A is the times and B is the

Re: [R] Insert rows - how can I accomplish this in R

2006-08-18 Thread Sachin J
Gabor, Thanks a lot for the help. The 1st method works fine. In 2nd method I am getting following error. do.call(rbind, by(DF, cumsum(DF$A == 1), f)) Error in zoo(, time(as.ts(z)), z, fill = 0) : unused argument(s) (fill ...) Unable to figure out the cause. Thanks,

Re: [R] Insert rows - how can I accomplish this in R

2006-08-18 Thread Gabor Grothendieck
I did run it so I am not sure how the error crept in. Anyways, I have fixed it and a corrected version is below. --- Here are two solutions. In both we break up DF into rows which start with 1. In #1 we create a new data frame with the required sequence for A and zeros for B and then we fill

[R] lmList and missing values

2006-08-18 Thread Henrik Parn
Dear all, I have a question on handling of missing values in lmList. My data set have continuous predictor and response, x and y, and a grouping variable group.id. All these variables have NAs and the data set also has several other variables that also contains NAs. To create the

[R] as.data.frame(cbind()) transforming numeric to factor?

2006-08-18 Thread Tom Boonen
Dear List, why does as.data.frame(cbind()) transform numeric variables to factors, once one of the other variablesused is a character vector? # x.1 - rnorm(10) x.2 - c(rep(Test,10)) Foo - as.data.frame(cbind(x.1)) is.factor(Foo$x.1) Foo - as.data.frame(cbind(x.1,x.2)) is.factor(Foo$x.1) # I

[R] Query: how to modify the plot of acf

2006-08-18 Thread Stefano Sofia
I need to modify the graph of the autocorrelation. I tried to do it through plot.acf but with no success. 1. I would like to get rid of the lag zero 2. I would like to have numbers on the x-axis only at lags 12, 24, 36, 48, 60, ... Could anybody help me in this? Any help will be appreciated

Re: [R] Lattice package par.settings/trellis.par.settings questions

2006-08-18 Thread Deepayan Sarkar
On 8/17/06, Debarchana Ghosh [EMAIL PROTECTED] wrote: Hi All, I'm trying to modify some of the default graphic parameters in a conditional histogram. While I was able to change the default grey background to white, I couldn't change the axis.font or the xlab font. The default background is

[R] R-update - what about packages and ESS?

2006-08-18 Thread Christian Hennig
Hi there, it seems that if I update R, it doesn't find previously installed packages anymore and is also not found by ESS. Actually the update has been done by our system administrator who assumed that there would be no problems with these things (I don't have root access to this system) and

Re: [R] Lattice package par.settings/trellis.par.settings questions

2006-08-18 Thread Deepayan Sarkar
On 8/17/06, Anupam Tyagi [EMAIL PROTECTED] wrote: Please read about lattice.par.settings, and not trellis.par.settings. Trellis is in S/S-plus. As far as I know, there's no such thing as lattice.par.settings. ``Trellis''-compatible things in the lattice package have the same names as the

Re: [R] as.data.frame(cbind()) transforming numeric to factor?

2006-08-18 Thread Marc Schwartz (via MN)
On Fri, 2006-08-18 at 10:41 -0400, Tom Boonen wrote: Dear List, why does as.data.frame(cbind()) transform numeric variables to factors, once one of the other variablesused is a character vector? # x.1 - rnorm(10) x.2 - c(rep(Test,10)) Foo - as.data.frame(cbind(x.1)) is.factor(Foo$x.1)

Re: [R] as.data.frame(cbind()) transforming numeric to factor?

2006-08-18 Thread Prof Brian Ripley
On Fri, 18 Aug 2006, Tom Boonen wrote: Dear List, why does as.data.frame(cbind()) transform numeric variables to factors, once one of the other variablesused is a character vector? # x.1 - rnorm(10) x.2 - c(rep(Test,10)) Foo - as.data.frame(cbind(x.1)) is.factor(Foo$x.1) Foo -

Re: [R] as.data.frame(cbind()) transforming numeric to factor?

2006-08-18 Thread Gabor Grothendieck
In R version 2.4.0 Under development (unstable) (2006-08-08 r38825) one can do this: as.data.frame(cbind(x.1,x.2),stringsAsFactors = FALSE) On 8/18/06, Tom Boonen [EMAIL PROTECTED] wrote: Dear List, why does as.data.frame(cbind()) transform numeric variables to factors, once one of the

Re: [R] as.data.frame(cbind()) transforming numeric to factor?

2006-08-18 Thread Tom Boonen
Thanks everybody. I recognize my mistake now. I think as.data.frame(cbind(x.1,x.2),stringsAsFactors = FALSE) would be a good idea. Tom On 8/18/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Fri, 18 Aug 2006, Tom Boonen wrote: Dear List, why does as.data.frame(cbind()) transform

Re: [R] R-update - what about packages and ESS?

2006-08-18 Thread Richard M. Heiberger
ESS finds R by one of two mechanisms. If R is in your PATH, then ESS will find it. Or, if you have explicitly set the emacs variable inferior-R-program-name, in .emacs, site-start.el, or ess-site.el, then ESS will find R. My guess is that you have explicitly set inferior-R-program-name to your

[R] apply least angle regression to generalized linear models

2006-08-18 Thread Mike Wolfgang
Hello list, I've been searching around trying to find whether somebody has written such a package of least angle regression on generalized linear models, like what Lasso2 package does. The extension to generalized linear models is briefly discussed in the comment by D. Madigan and G. Ridgeway. Is

Re: [R] R-update - what about packages and ESS?

2006-08-18 Thread Prof Brian Ripley
Without knowing your OS this is hard to answer (and is the wrong list for the ESS question). For Windows users, the packages part is covered in the rw-FAQ. For Unix-alikes, it all depends how the update was done, but normal package update mechanisms (such as RPM) will not wipe out previously

[R] Boxplot Help

2006-08-18 Thread Ana Patricia Martins
Hello R-users and developers, Once again, I'm asking for your help. I can identify outliers in boxplot with this instruction result - boxplot( Income ~ Sex, col = lightgray, data=dados) if (length(result$out)) text(result$group, result$out, result$out, pos = 4, col = red) But I

Re: [R] apply least angle regression to generalized linear models

2006-08-18 Thread Marc Schwartz (via MN)
On Fri, 2006-08-18 at 11:17 -0400, Mike Wolfgang wrote: Hello list, I've been searching around trying to find whether somebody has written such a package of least angle regression on generalized linear models, like what Lasso2 package does. The extension to generalized linear models is

Re: [R] R-update - what about packages and ESS?

2006-08-18 Thread Christian Hennig
Thanks for the answers so far. I have to go through this with my system administrator. The system is slackware linux. For Unix-alikes, it all depends how the update was done, but normal package update mechanisms (such as RPM) will not wipe out previously installed R packages: nor will 'make

[R] dataframe of unequal rows

2006-08-18 Thread Sachin J
Hi, How can I read data of unequal number of observations (rows) as is (i.e. without introducing NA for columns of less observations than the maximum. Example: AB C D 110 1 12 210 3 12 310 4 12 410 510 Thanks in advance.

[R] [Fwd: Trend test and test for homogeneity of odd-ratios]

2006-08-18 Thread Jacques VESLOT
I partly answered my question since independence_test() function in coin package apparently do Cochran-Armitage trend test just like Eric Lecoutre's function tabletrend() - slightly modified here: independence_test(pheno ~ geno, data = dat2, teststat = quad, scores = list(geno = c(0, 1,

Re: [R] dataframe of unequal rows

2006-08-18 Thread Berton Gunter
How do you indicate which fields are present in a record with less than the full number? Via known delimiters for all fields? Via the order of values (fields are filled in order and only the last fields in a record can therefore be missing)? If the former, see the sep parameter in read.table()

Re: [R] apply least angle regression to generalized linear models

2006-08-18 Thread Liaw, Andy
I believe `lars' does not currently fit glms. For that you'll probably need to look at `glar', at: http://www.insightful.com/Hesterberg/glars/default.asp HTH, Andy From: Marc Schwartz On Fri, 2006-08-18 at 11:17 -0400, Mike Wolfgang wrote: Hello list, I've been searching around

Re: [R] apply least angle regression to generalized linear models

2006-08-18 Thread Marc Schwartz (via MN)
Andy, Upon further review of the documentation for lars, you are correct. Thanks for the pointer to the work by Tim et al. Regards, Marc On Fri, 2006-08-18 at 12:48 -0400, Liaw, Andy wrote: I believe `lars' does not currently fit glms. For that you'll probably need to look at `glar', at:

Re: [R] as.data.frame(cbind()) transforming numeric to factor?

2006-08-18 Thread Martin Maechler
Tom == Tom Boonen [EMAIL PROTECTED] on Fri, 18 Aug 2006 11:16:45 -0400 writes: Tom Thanks everybody. I recognize my mistake now. Tom I thinkas.data.frame(cbind(x.1,x.2),stringsAsFactors = FALSE) Tom would be a good idea. I think data.frame(x.1, x.2 = I(x.2)) would

Re: [R] dataframe of unequal rows

2006-08-18 Thread Sachin J
Bert, I tried readLines. It reads the data as is, but cant access individual columns. Still cant figure out how to accomplish this. An example would be of great help. PS: How do you indicate which fields are present in a record with less than the full number? - Via known delimiters

Re: [R] dataframe of unequal rows

2006-08-18 Thread Berton Gunter
test.txt: V1V2V3V4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 The fields are delimited by tab characters (\t) In R: read.table(choose.files(),sep='\t',head=TRUE) V1 V2 V3 V4 1 1 2 3 4

Re: [R] Boxplot Help

2006-08-18 Thread Gabor Grothendieck
Try this: result - boxplot(Petal.Length ~ Species, iris) if (length(result$out)) text(result$group, result$out, match(result$out, iris$Petal.Length), pos = 4, col = red) If the outliers can be non-unique then match is not enough. In that case assume that the nth occurrence of any value in

[R] Floating point imprecision in sum() under R-2.3.1?

2006-08-18 Thread Brahm, David
After upgrading to R-2.3.1 on Linux Redhat, I was suprised by this: R x - c(721.077, 592.291, 372.208, 381.182) R sum(x) - 2066.758 [1] 4.547474e-13 Now I understand that floating point arithmetic is not precise, but 1) the result is exactly 0 in R-2.2.1 (patched) on the same machine, 2)

Re: [R] Query: how to modify the plot of acf

2006-08-18 Thread Matthias Braeunig
Hi Stefano, the manual tells us that we can access components of an acf object directly by acf.obj[.], but assignment ]- does not work this way. One way of doing what you want is to assign NA to x$acf[x$lag==0] like so: x - acf(runif(100)) x$acf[1] - NA plot(x) But I suppose what you actually

Re: [R] Floating point imprecision in sum() under R-2.3.1?

2006-08-18 Thread Roger D. Peng
I think you want to look at sum(x)/2066.758 - 1 which on my Linux box is 2.2e-16. -roger Brahm, David wrote: After upgrading to R-2.3.1 on Linux Redhat, I was suprised by this: R x - c(721.077, 592.291, 372.208, 381.182) R sum(x) - 2066.758 [1] 4.547474e-13 Now I understand that

[R] Permutations with replacement

2006-08-18 Thread Jesse Albert Canchola
Is there a simple function or process that will create permutations with replacement? I know that using the combinat package ## begin R code ## library(combinat) m - t(array(unlist(permn(3)), dim = c(3, 6))) # we can get the permutations, for example 3!=6 # gives us m [,1]

Re: [R] Floating point imprecision in sum() under R-2.3.1?

2006-08-18 Thread Brahm, David
I was concerned by this result (new in R-2.3.1): R x - c(721.077, 592.291, 372.208, 381.182) R sum(x) - 2066.758 [1] 4.547474e-13 But after Roger Peng's [EMAIL PROTECTED] insightful comment that the relative difference (sum(x)/2066.758 - 1) is exactly what is expected, I'm convinced that sum()

[R] Permutations with replacement

2006-08-18 Thread Jesse Albert Canchola
Is there a simple function or process that will create a matrix of permutations with replacement? I know that using the combinat package ## begin R code ## library(combinat) m - t(array(unlist(permn(3)), dim = c(3, 6))) # we can get the permutations, for example 3!=6 # gives us m

[R] multivariate analysis by using lme

2006-08-18 Thread Hui-Ju Tsai
Dear R users, I have a data structure as follows: id two res1 res2 c1 c2 inter 1 -0.786093166 1 0 1 2 6 3 -0.308495749 1 0 0 1 2 5

Re: [R] Permutations with replacement

2006-08-18 Thread davidr
If you also want 1,1,1 and so on, the number of these is n^n, (n choices for each of n slots.) In that case, you could use hcube from combinat. David L. Reiner Rho Trading Securities, LLC Chicago IL 60605 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

[R] Affy: problems using neweS

2006-08-18 Thread John Tillinghast
At least for R 2.3.1, neweS requires that all of the variables have names that correspond to the colnames of the matrix. That's fine, I know about that, and I use a modified version of neweS that puts the names in there. It works well with data from most sources. However, we tried reading in the

[R] list of lists to a data.frame

2006-08-18 Thread Rajarshi Guha
Hi, I have a situation where I have a list of lists. Each list can contain elements of different types (but each one will be a scalar) say of double, integer or character. However the elements of each list are always in the same order: x - list('a', 1, 2) y - list('b', 3, 4) z - list('c', 5, 6)

Re: [R] Floating point imprecision in sum() under R-2.3.1?

2006-08-18 Thread Berton Gunter
But after Roger Peng's [EMAIL PROTECTED] **insightful** comment that the ... but as we are not in that other S language dialect, maybe it should be his **peRceptive** comment. ;-) (Sorry -- it's Friday) -- Bert Gunter __ R-help@stat.math.ethz.ch

Re: [R] list of lists to a data.frame

2006-08-18 Thread Marc Schwartz (via MN)
On Fri, 2006-08-18 at 16:44 -0400, Rajarshi Guha wrote: Hi, I have a situation where I have a list of lists. Each list can contain elements of different types (but each one will be a scalar) say of double, integer or character. However the elements of each list are always in the same order:

Re: [R] Permutations with replacement

2006-08-18 Thread Daniel Nordlund
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jesse Albert Canchola Sent: Friday, August 18, 2006 1:02 PM To: r-help Subject: [R] Permutations with replacement Is there a simple function or process that will create permutations with

Re: [R] Boxplot Help

2006-08-18 Thread Gabor Grothendieck
In reviewing this I found an error in the case that there is an outlier in one group with an equal value in another group that is not an outlier.Also the iris example does not have duplicate outliers so its not a very good test. Here is a much shorter version that does not have the cited