Re: [R] noise in time series

2009-01-14 Thread Dieter Menne
David Riano ucdavis.edu> writes: > I have two time series. Both measure the same thing and I would like > to determine which one is noisier. > Would it be a good measure of the noise in each time series the > absolute lag difference? > Is this a good measure? Any other measure I could use? You

Re: [R] Precision in R

2009-01-14 Thread dos Reis, Marlon
Hi, I attached the files I'm using, it may help. I'm using Windows XP > sessionInfo() R version 2.6.0 (2007-10-03) i386-pc-mingw32 locale: LC_COLLATE=English_New Zealand.1252;LC_CTYPE=English_New Zealand.1252;LC_MONETARY=English_New Zealand.1252;LC_NUMERIC=C;LC_TIME=English_New Zealand.1252 attac

Re: [R] Precision in R

2009-01-14 Thread dos Reis, Marlon
I'm using: "solve(a, b, tol, LINPACK = FALSE, ...)" Therefore,tol ==.Machine$double.eps >.Machine$double.eps [1] 2.220446e-16 It explains why 'solve' works for 'tcp1' but not for 'tcp2': eigen(tcp1)$values [1] 5.208856e+09 2.585816e+08 -3.660671e-06 -3.660671e-06/5.208856e+09 [1] -7.027783e

Re: [R] Interface to open source Reporting tools

2009-01-14 Thread Dieter Menne
srinivasa raghavan gmail.com> writes: > I am interested to generate dashboard and reports based on data from MS > Access. These reports need to be posted on a weekly basis to the web. The > reporting interface should provide facilities for "what if" scenarios. > > Is it possible to interface

[R] Confidence Intervals for Poisson

2009-01-14 Thread John Kerpel
Hi folks! I run the following code to get a CI for a Poisson with lambda=12.73 library(MASS) set.seed(125) x <- rpois(100,12.73) lambda_hat<-fitdistr(x, dpois, list(lambda=12))$estimate #Confidence Intervals - Normal Approx. alpha<-c(.05,.025,.01) for(n in 1:length(alpha)) { LowerCI<-mean(x

[R] Question about correct syntax to use with nlme / nlmer

2009-01-14 Thread Assaf oron
Hi, I turn to the help list after spending hours on the package help, looking online, asking colleagues and trying various versions on R itself. The work I need help on involves a confidentiality contract, so I am limited in details on the specific model I used. However, my problem is really simp

[R] noise in time series

2009-01-14 Thread David Riano
Hi! I have two time series. Both measure the same thing and I would like to determine which one is noisier. Would it be a good measure of the noise in each time series the absolute lag difference? Is this a good measure? Any other measure I could use? Thanks for help :) David Riano Center for

[R] misalignment of x-axis when overlaying two plots using latticeExtra

2009-01-14 Thread Sean Zhang
Dear R-helpers: I am an entry-level R user and have a question related to overlaying a barchart and and a xyplot using latticeExtra. My problem is that when I overlay them I fail to align their x-axes. I show my problem below through an example. #the example data frame is provided below ve

Re: [R] Precision in R

2009-01-14 Thread David Winsemius
I am seeing different behavior than don Reis on my installation as well: mtx is the same as his WBtWB > mtx <- matrix(c(1916061939, 2281366606, 678696067, 2281366606, 3098975504, 1092911209, 678696067, 1092911209, 452399849), ncol=3) > > mtx [,1] [,2] [,3] [1,] 1916061

[R] Last working lme4?

2009-01-14 Thread Russell Pierce
This evening I ran into the problem Chuck Clifton referred to in message 86 of Volume 71 Issue 9 of this list. That is, objects created by lmer change after calling pvals.fnc on that lmer object when using lme4 version 0.999375-16 and 0.999375-28. This is somewhat troublesome. The bug tracker on

Re: [R] Precision in R

2009-01-14 Thread Charles C. Berry
Marlon, Are you using a current version of R? sessionInfo()? It would help if you had something we could _fully_ reproduce. Taking the _printed_ values you have below (WBtWB) and adding or subtracting what you have printed as the difference of the two visually equal matrices ( say Delta ) ,

Re: [R] Precision in R

2009-01-14 Thread dos Reis, Marlon
Thanks Nath, I get the following results: system.time(tcp1 <- tcrossprod(WB)) user system elapsed 0 0 0 > system.time(tcp2 <- crossprod(t(WB))) user system elapsed 0 0 0 > all.equal(tcp1, tcp2,check.attributes=FALSE) [1] TRUE But, when I try the in

Re: [R] Kaplan-Meier Plot

2009-01-14 Thread Marc Schwartz
on 01/14/2009 03:32 PM John Lande wrote: > dear all, > > I want to plot a kaplan Meier plot with the following functions, but I fail > to produce the plot I want: > > library(survival) > tim <- (1:50)/6 > ind <- runif(50) > ind[ind > 0.5] <- 1; ind[ind < 0.5] <- 0; > MS <- runif(50) > pred <- vec

[R] Moving a Data Frame Column

2009-01-14 Thread jimdare
Dear R-Users if I have a data frame (or zoo data) as follows: Run Bike Walk Drive 1 2 7 5 5 2 4 2 8 3 2 1 How can I re-order it so that it reads: Drive Run Bike Walk 5 1 2 7 2 5 2 4 1 8 3 2

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-14 Thread stephen sefick
Also notice that the q in Aquarium is hidden. Is there a way to make this not happen? thanks Stephen Sefick On Wed, Jan 14, 2009 at 10:18 PM, stephen sefick wrote: > #I am putting a test together for an introductory biology class and I > would like to put different cross hatching inside of each

[R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-14 Thread stephen sefick
#I am putting a test together for an introductory biology class and I would like to put different cross hatching inside of each bar for the bar plot below color <- c("Brightly Colored", "Dull", "Neither") lizards <- c(277, 70, 3) liz.col <- data.frame(color, lizards) qplot(color, lizards, data=liz

Re: [R] Zoo Plot Can't Get Rid of Box

2009-01-14 Thread jimdare
Thanks for that :) Gabor Grothendieck wrote: > > Its hard coded in but you can circumvent it if you really want like this: > > library(zoo) > > # make a copy of plot.zoo > plot.zoo <- zoo:::plot.zoo > environment(plot.zoo) <- .GlobalEnv > box <- list > > z <- zoo(1:5) > plot(z, bty = "n") >

Re: [R] Precision in R

2009-01-14 Thread Albyn Jones
Yes, computing WB.%*%t(WB) may be the problem, by either method. if the goal is to compute the inverse of WB%*%t(WB), you should consider computing the singular value or QR decomposition for the matrix WB. If WB = Q%*%R, where Q is orthogonal, then WB %*% t(WB) =R %*%t(R), and the inverse of

Re: [R] Precision in R

2009-01-14 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've recently been working with cross products etc. You should try the following function: tcp1 <- tcrossprod(WB) or tcp2 <- crossprod(t(WB)) Both should be the same (check for equality accounting for some floating point imprecision): all.equal(tcp1

[R] Precision in R

2009-01-14 Thread dos Reis, Marlon
Dear All, I'm preparing a simple algorithm for matrix multiplication for a specific purpose, but I'm getting some unexpected results. If anyone could give a clue, I would really appreciate. Basically what I want to do is a simple matrix multiplication: (WB) %*% t(WB). The WB is in the disk so I com

[R] Kaplan-Meier Plot

2009-01-14 Thread John Lande
dear all, I want to plot a kaplan Meier plot with the following functions, but I fail to produce the plot I want: library(survival) tim <- (1:50)/6 ind <- runif(50) ind[ind > 0.5] <- 1; ind[ind < 0.5] <- 0; MS <- runif(50) pred <- vector() pred[MS < 0.3] <- 0; pred[MS >= 0.3] <- 1 df <- as.data.f

Re: [R] Partial sort?

2009-01-14 Thread andrew
I had a similar misunderstanding of using partial in sort() a while back when I was trying to sort by columns, a la Excel. In this case, I ended up using the order() function, eg: require(stats) swiss[order(rownames(swiss)), ] #sort by location swiss[order(swiss$fertility), ] #sort by fertility

[R] Kaplan-Meier Plot

2009-01-14 Thread John Lande
dear all, I want to plot a kaplan Meier plot with the following functions, but I fail to produce the plot I want: library(survival) tim <- (1:50)/6 ind <- runif(50) ind[ind > 0.5] <- 1; ind[ind < 0.5] <- 0; MS <- runif(50) pred <- vector() pred[MS < 0.3] <- 0; pred[MS >= 0.3] <- 1 df <- as.data.f

Re: [R] remove columns containing all zeros (or other value)

2009-01-14 Thread andrew
or this x[,!(colSums(abs(x)) == 0)] On Jan 15, 10:00 am, Marc Schwartz wrote: > Careful: > > x <- matrix(c(1, 5, 3, 2, 1, 4, -1, 0, 1), >             ncol = 3, nrow = 3) > > > x > >      [,1] [,2] [,3] > [1,]    1    2   -1 > [2,]    5    1    0 > [3,]    3    4    1 > > > x[, colSums(x) != 0] >

[R] R package tests

2009-01-14 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I was wondering if anyone could point me in the right direction for reading up on writing tests in R. I'm writing some functions for inclusion into a package and would like to test them to ensure they're doing what I expect them to do. Are these app

Re: [R] Zoo Plot Can't Get Rid of Box

2009-01-14 Thread Gabor Grothendieck
Its hard coded in but you can circumvent it if you really want like this: library(zoo) # make a copy of plot.zoo plot.zoo <- zoo:::plot.zoo environment(plot.zoo) <- .GlobalEnv box <- list z <- zoo(1:5) plot(z, bty = "n") rm(box) On Wed, Jan 14, 2009 at 7:16 PM, jimdare wrote: > > Hi, > > I a

[R] Zoo Plot Can't Get Rid of Box

2009-01-14 Thread jimdare
Hi, I apologise for the stupid question but how to you get rid of the box around a plot in the package zoo? I can't seem to find an equivalent for bty="l" i.e. just x and y axis. Cheers James -- View this message in context: http://www.nabble.com/Zoo-Plot-Can%27t-Get-Rid-of-Box-tp21468452p214

Re: [R] Can't find files after install package (Windows)

2009-01-14 Thread bcbob43
I uninstalled and then re-installed R using all the defaults and that seemed to do the trick. I was able to install the gcl package from the Packages menu and run the demo. -- View this message in context: http://www.nabble.com/Can%27t-find-files-after-install-package-%28Windows%29-tp2146360

Re: [R] TSP package and Concorde

2009-01-14 Thread Michael Martin
__ 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, self-contained, reproducible code.

Re: [R] Partial sort?

2009-01-14 Thread Duncan Murdoch
Duncan Murdoch wrote: rkevinbur...@charter.net wrote: This is definitely a newbie question but from the documentation I have not been able to figure out what the partial sort option on the sort method does. I have read and re-read the documentation and looked at the examples but for some r

Re: [R] Partial sort?

2009-01-14 Thread Duncan Murdoch
rkevinbur...@charter.net wrote: This is definitely a newbie question but from the documentation I have not been able to figure out what the partial sort option on the sort method does. I have read and re-read the documentation and looked at the examples but for some reason it doesn't register.

Re: [R] Can't find files after install package (Windows)

2009-01-14 Thread Duncan Murdoch
bcbob43 wrote: Phil Spector wrote: Unless you issue the statement library(gcl) the gcl package will not be available in the current session. Using demo does not load the package; only library() does. I should have mentioned that I did try that and got the following result: lib

Re: [R] Partial sort?

2009-01-14 Thread Prof Brian Ripley
1) Unless you know what you are doing, you don't want to use it since the speed advantage is small at best. 2) Suppose you want the median of 2n+1 values. Then all you need is a value with n others to the left and n to the right. That is a partially sorted vector. Example set.seed(123) x

Re: [R] Partial sort?

2009-01-14 Thread Bill.Venables
Specifying a partial sort allows you to specify a re-arrangement of the data into groups where all the values in any group are guaranteed to be at least as large as any value in the previous group. Within the groups themselves, though, the values are not sorted. Here is an example: > x <- rou

Re: [R] How to compute p-Values

2009-01-14 Thread David Winsemius
On Jan 14, 2009, at 4:27 PM, Andreas Klein wrote: Ok... I set up the problem by some code as requested: Example: x <- rnorm(100) mean_x <- mean(x) mean_boot <- numeric(1000) for (i in 1:1000) { mean_boot[i] <- mean(sample(x,100,replace=TRUE)) } How can I compute the p-Value out of mea

Re: [R] remove columns containing all zeros (or other value)

2009-01-14 Thread Marc Schwartz
Careful: x <- matrix(c(1, 5, 3, 2, 1, 4, -1, 0, 1), ncol = 3, nrow = 3) > x [,1] [,2] [,3] [1,]12 -1 [2,]510 [3,]341 > x[, colSums(x) != 0] [,1] [,2] [1,]12 [2,]51 [3,]34 Not quite the result wanted... :-) Try th

[R] Partial sort?

2009-01-14 Thread rkevinburton
This is definitely a newbie question but from the documentation I have not been able to figure out what the partial sort option on the sort method does. I have read and re-read the documentation and looked at the examples but for some reason it doesn't register. Would someone attempt to explain

Re: [R] Logical function to turn missing values to 0's

2009-01-14 Thread Jorge Ivan Velez
Dear rafamoral, Try this: x[is.na(x)]<-0 HTH, Jorge On Wed, Jan 14, 2009 at 5:32 PM, rafamoral wrote: > > I have a dataset which contains some missing values, and I need to replace > them with zeros. I tried using the following: > > x <- matrix(data=rep(c(1,2,3,NA),6), ncol=6, nrow=6) > > y <-

Re: [R] coercing a list into matrix

2009-01-14 Thread Steven McKinney
Hi Ken, If your lists are not too large something such as this can work: > matrixFromList <- function(listX) t(sapply(listX, function(x, n) c(x, rep(NA, > n))[1:n], n = max(sapply(listX, length > matrixFromList(list(c(3,2,3),c(6,5))) [,1] [,2] [,3] [1,]323 [2,]65

Re: [R] Logical function to turn missing values to 0's

2009-01-14 Thread Gustavo Carvalho
Hello rafamoral, Try this: ifelse(is.na(x),0,x) On Wed, Jan 14, 2009 at 8:32 PM, rafamoral wrote: > > I have a dataset which contains some missing values, and I need to replace > them with zeros. I tried using the following: > > x <- matrix(data=rep(c(1,2,3,NA),6), ncol=6, nrow=6) > > y <- matr

[R] Logical function to turn missing values to 0's

2009-01-14 Thread rafamoral
I have a dataset which contains some missing values, and I need to replace them with zeros. I tried using the following: x <- matrix(data=rep(c(1,2,3,NA),6), ncol=6, nrow=6) y <- matrix(data=0, ncol=ncol(x), nrow=nrow(x)) for(i in 1:nrow(x)) { for(j in 1:ncol(x)) { y[i,j] <- ifelse(x[i,j]==NA

Re: [R] remove columns containing all zeros (or other value)

2009-01-14 Thread Gustavo Carvalho
Sorry for the double post, but this is probably faster: x[, colSums(x) != 0] On Wed, Jan 14, 2009 at 8:22 PM, Gustavo Carvalho wrote: > You can also try this: > > x[,-(which(colSums(x) == 0))] > > Cheers, > > Gustavo. > > On Wed, Jan 14, 2009 at 8:01 PM, Anthony Dick wrote: >> Hello- >> >> I wo

Re: [R] Can't find files after install package (Windows)

2009-01-14 Thread bcbob43
Phil Spector wrote: > > Unless you issue the statement > > library(gcl) > > the gcl package will not be available in the current session. > Using demo does not load the package; only library() does. > > I should have mentioned that I did try that and got the following result: > library(gcl

Re: [R] coercing a list into matrix

2009-01-14 Thread Marc Schwartz
on 01/14/2009 03:50 PM Lo, Ken wrote: > Dear list, > > I have a list of number sequences. Each number sequence has different > numbers of elements. Is there a quick way (other than to iterate > through the entire list) way to coerce list to matrix with NAs filling > in the short sequences? > >

Re: [R] remove columns containing all zeros (or other value)

2009-01-14 Thread Gustavo Carvalho
You can also try this: x[,-(which(colSums(x) == 0))] Cheers, Gustavo. On Wed, Jan 14, 2009 at 8:01 PM, Anthony Dick wrote: > Hello- > > I would like to remove the columns of a matrix that contain all zeros. For > example, from > x<-matrix(c(1,5,3,2,1,4,0,0,0), ncol=3,nrow=3) > > I would like t

Re: [R] remove columns containing all zeros (or other value)

2009-01-14 Thread Jorge Ivan Velez
Hi Anthony, Try this: x[,apply(x,2,function(x) !all(x==0))] HTH, Jorge On Wed, Jan 14, 2009 at 5:01 PM, Anthony Dick wrote: > Hello- > > I would like to remove the columns of a matrix that contain all zeros. For > example, from > x<-matrix(c(1,5,3,2,1,4,0,0,0), ncol=3,nrow=3) > > I would l

Re: [R] Can't find files after install package (Windows)

2009-01-14 Thread Phil Spector
Unless you issue the statement library(gcl) the gcl package will not be available in the current session. Using demo does not load the package; only library() does. - Phil Spector Statistical Computing Facility

[R] remove columns containing all zeros (or other value)

2009-01-14 Thread Anthony Dick
Hello- I would like to remove the columns of a matrix that contain all zeros. For example, from x<-matrix(c(1,5,3,2,1,4,0,0,0), ncol=3,nrow=3) I would like to remove the third column. However, because this is in a loop I need a way to first determine which columns are all zeros, and only the

[R] coercing a list into matrix

2009-01-14 Thread Lo, Ken
Dear list, I have a list of number sequences. Each number sequence has different numbers of elements. Is there a quick way (other than to iterate through the entire list) way to coerce list to matrix with NAs filling in the short sequences? An example of what I mean is this: A <- list(c(3,2,3)

Re: [R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread Matthew Pettis
Thank you very much -- this was very helpful for differentiating among the aggregating methods! Matt On Wed, Jan 14, 2009 at 3:42 PM, Marc Schwartz wrote: > on 01/14/2009 02:51 PM Matthew Pettis wrote: >> I have a specific question and a general question. >> >> Specific Question: I want to do an

Re: [R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread Marc Schwartz
on 01/14/2009 02:51 PM Matthew Pettis wrote: > I have a specific question and a general question. > > Specific Question: I want to do an analysis on a data frame by 2 or more > class variables (i.e., use 2 or more columns in a dataframe to do > statistical classing). Coming from SAS, I'm used to

Re: [R] Can't find files after install package (Windows)

2009-01-14 Thread bcbob43
Gabor Grothendieck wrote: > > You should only have to do this from within R: > > install.packages("glc", dep = TRUE) > library(gcl) > demo("glcdemo", package = "glc") > > or in place of the first line you could use the Packages > menu choosing Install packages... > Thanks for your help but I

[R] R programmer for Quick project

2009-01-14 Thread Tia Gao
Hello, I am not a R coder but I am looking for a R coder to write a small program (I think it should only take a few hours at most) that will be used to calculate statistics in a report for the World Health Organization. I will pay $250 for fully functional working program. $100 Bonus if finished

Re: [R] List of Lists

2009-01-14 Thread hadley wickham
On Wed, Jan 14, 2009 at 1:53 PM, glenn wrote: > Dear All; > > Is it possible to create a list of lists (I am sure it is) along these > lines; > > I have a dataframe data02 that holds a lot of information, and the first > column is ³date² > > I have a list of dates in; > > data03<-c(date1,.,dat

Re: [R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread hadley wickham
> General Question: I assume the answer to the specific question is dependent > on my understanding list objects and accessing their attributes. Can anyone > point me to a good, throrough treatment of these R topics? Specifically how > to read and interpret the output of the str(), and attributes

Re: [R] How to compute p-Values

2009-01-14 Thread Andreas Klein
Ok... I set up the problem by some code as requested: Example: x <- rnorm(100) mean_x <- mean(x) mean_boot <- numeric(1000) for (i in 1:1000) { mean_boot[i] <- mean(sample(x,100,replace=TRUE)) } How can I compute the p-Value out of mean_boot for the following tests: 1. H0: mean_x = 0 vs

Re: [R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread David Winsemius
On Jan 14, 2009, at 4:14 PM, David Winsemius wrote: On Jan 14, 2009, at 3:56 PM, Matthew Pettis wrote: I have a specific question and a general question. Specific Question: I want to do an analysis on a data frame by 2 or more class variables (i.e., use 2 or more columns in a dataframe to

Re: [R] Can't find files after install package (Windows)

2009-01-14 Thread Gabor Grothendieck
You should only have to do this from within R: install.packages("glc", dep = TRUE) library(gcl) demo("glcdemo", package = "glc") or in place of the first line you could use the Packages menu choosing Install packages... On Wed, Jan 14, 2009 at 3:51 PM, bcbob43 wrote: > > > Tom Backer Johnsen

Re: [R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread David Winsemius
On Jan 14, 2009, at 3:56 PM, Matthew Pettis wrote: I have a specific question and a general question. Specific Question: I want to do an analysis on a data frame by 2 or more class variables (i.e., use 2 or more columns in a dataframe to do statistical classing). Coming from SAS, I'm used t

[R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread Matthew Pettis
I have a specific question and a general question. Specific Question: I want to do an analysis on a data frame by 2 or more class variables (i.e., use 2 or more columns in a dataframe to do statistical classing). Coming from SAS, I'm used to being able to take a data set and have the output of

Re: [R] List of Lists

2009-01-14 Thread David Winsemius
See if one of %in% or match gets your further. > 1:10 %in% c(1,3,5,9) [1] TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE TRUE FALSE > match(c(1,3,5,9), 1:10) [1] 1 3 5 9 > match(c(1,3,5,9), 10:1) [1] 10 8 6 2 date03 as offered was not a list, but a vector. date04 <- date02[which(date02$da

Re: [R] Can't find files after install package (Windows)

2009-01-14 Thread bcbob43
Tom Backer Johnsen wrote: > > Did you include the statement > > library (gcl) > > before the call on source () ? > > Tom > > Yes. Here is the code I am trying to run. It was provided by the authors of the gcl package # library(gcl) #gcldemo <- function() { df <- structure(list(V1 =

[R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread Matthew Pettis
I have a specific question and a general question. Specific Question: I want to do an analysis on a data frame by 2 or more class variables (i.e., use 2 or more columns in a dataframe to do statistical classing). Coming from SAS, I'm used to being able to take a data set and have the output of th

Re: [R] Can't find files after install package (Windows)

2009-01-14 Thread Tom Backer Johnsen
Did you include the statement library (gcl) before the call on source () ? Tom bcbob43 wrote: --I was not registered when I first sent this. I registered and it looks like I have to resend so sorry if this gets sent twice ... I am a total newbie at R but experienced with computers. If this

Re: [R] power analyses for mixed effects lmer models

2009-01-14 Thread Ben Bolker
Greg Snow imail.org> writes: > > My preferred method for this type of thing is to use simulation. > You have already done the hard parts in > figuring out what your data is going to look like and how you plan > to analyze it. Now just write a function > that will simulate data according to yo

[R] Can't find files after install package (Windows)

2009-01-14 Thread bcbob43
--I was not registered when I first sent this. I registered and it looks like I have to resend so sorry if this gets sent twice ... I am a total newbie at R but experienced with computers. If this is not the right forum for this question, please let me know one that is. I searched in the R manua

Re: [R] polychoric correlation: issue with coefficient sign

2009-01-14 Thread Dorothee
Dear John and Stas, Thanks so much for your help. John, I did the correlation on the complete dataset (no missing values). I tried what you suggested and you were right: hetcor with pd=FALSE gives me the same result as polychor. Anyway, thanks to the answers I got in the forum, I understand I sho

Re: [R] Histograms: Lines and boxes

2009-01-14 Thread Marc Schwartz
on 01/14/2009 11:53 AM Kerpel, John wrote: > Hi folks! I'm trying to get a histogram legend to give me a filled box > and a line. The problem is I keep getting both filled boxes and a line. > How can I get rid of the second box from the code below? > > > > x<-rnorm(1000,mean=0,sd=1) > >

[R] List of Lists

2009-01-14 Thread glenn
Dear All; Is it possible to create a list of lists (I am sure it is) along these lines; I have a dataframe data02 that holds a lot of information, and the first column is ³date² I have a list of dates in; data03<-c(date1,.,daten) And would like to create a list; data04 <- subset(data02, d

Re: [R] selecting parts of a table

2009-01-14 Thread David Winsemius
Assuming that your dataframe is DF and those are names of columns then ?subset > DF <- data.frame(posit=runif(20, max=20), tvalues = runif(20, max= 10)) > > subset(DF, subset= posit > 10 & tvalues > 3.5 ) posit tvalues 4 14.66464 9.527535 6 14.71280 7.231015 9 14.76594 7.626381 10 1

Re: [R] selecting parts of a table

2009-01-14 Thread Stephan Kolassa
Hi, new.Match <- Match[10Match$tvalues>3.5,] Everything before the comma selects rows. You could select columns by using conditions after the comma. HTH, Stephan emj83 schrieb: I have a dataframe called Match with two columns: position and tvalue. I would like to select the parts of the d

Re: [R] loglm fitting

2009-01-14 Thread Sunil Suchindran
If we check the data, we see a mistake in the entry. > tbl.8.3 mara cig alc count 1 Yes Yes Yes 911 2 No No No 538 3 Yes Yes Yes44 4 No No No 456 5 Yes Yes Yes 3 6 No No No43 7 Yes Yes Yes 2 8 No No No 279 Try: table8.3 <- read.table(textConnection("

[R] Non-R but interesting statistics-related NATURE article: FYI only

2009-01-14 Thread Bert Gunter
Folks: NON-R RELATED NATURE article on fundamental statistical inference (and, I think, more fundamentally, philosophy of science: what constitutes scientific "validity" ?) issues that I thought might be of general interest to this list. http://www.nature.com/news/2009/090113/full/457245a.html F

[R] Adressing list-elements

2009-01-14 Thread Thomas Schwander
Dear all, I'm using R 2.8.1 under Vista. I programmed a Simulation with the code enclosed at the end of the eMail. After the simulation I want to analyse the columns of the single simulation-runs, i.e. e.g. Simulation[[1]][,1] sth. like that but I cannot address these columns... Can anybody

Re: [R] Dependencies for binaries install of R 2.8.2 under Ubuntu 648.1 (Intrepid)

2009-01-14 Thread Rob James
Problem resolved. This error occurred because of a mixture of hardy and intrepid sources in my sources.list . Thanks to Phil Spector, Dirk Eddelbuettel and others for their input. [[alternative HTML version deleted]] __ R-help@r-project.org m

[R] selecting parts of a table

2009-01-14 Thread emj83
I have a dataframe called Match with two columns: position and tvalue. I would like to select the parts of the dataframe that have a position> 10 but <50 and tvalues >3.5 as a new stand alone dataframe. Could anyone help me with how to do this? Thanks Emma -- View this message in context: htt

[R] Histograms: Lines and boxes

2009-01-14 Thread Kerpel, John
Hi folks! I'm trying to get a histogram legend to give me a filled box and a line. The problem is I keep getting both filled boxes and a line. How can I get rid of the second box from the code below? x<-rnorm(1000,mean=0,sd=1) hist(x, breaks = 50, main="Histogram of x",freq=FALSE, xla

Re: [R] problems with download.file() from ftp?

2009-01-14 Thread Duncan Temple Lang
FWIW, Having done some quick checks, the appropriate incantation is getURL('ftp://ftp.wcc.nrcs.usda.gov/data/snow/snow_course/table/history/idaho/13e19.txt', ftp.use.epsv = FALSE) D. Duncan Temple Lang wrote: Hi Zack, You might explore some of the options of libcurl via the RC

Re: [R] power analyses for mixed effects lmer models

2009-01-14 Thread Greg Snow
My preferred method for this type of thing is to use simulation. You have already done the hard parts in figuring out what your data is going to look like and how you plan to analyze it. Now just write a function that will simulate data according to your pattern and with the difference(s) that

Re: [R] Histograms: Boxes and lines

2009-01-14 Thread r...@quantide.com
Could be ... legend("topright",legend=c("Histogram","Kernel Density Estimate"),lty=c(NA,1), lwd=c(NA,2), pch = c(15, NA), col = c("lightblue", "black"), merge=TRUE,inset=.01,cex=.8,adj=0) A. John Kerpel wrote: Hi folks! I'm trying to get a histogram legend to give me a filled box and a line

Re: [R] Dependencies for binaries install of R 2.8.2 under Ubuntu 64 8.1 (Intrepid)

2009-01-14 Thread Dirk Eddelbuettel
On 14 January 2009 at 12:04, Rob James wrote: | BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }I | can't seem to perform an install from CRAN (stat.sfu.ca, specifically) | for Ubuntu 64 8.1 (Intrepid) and 2.8.2 of R. Here is the log: [ There is no R 2.8.2 (yet, and maybe ever

Re: [R] Ordinal Package Errors

2009-01-14 Thread Rick Bilonick
On Wed, 2009-01-14 at 16:38 +, Prof Brian Ripley wrote: > You need to ask the author (as the posting guide asked you to). > > I'm tempted to not help further given the (almost complete) lack of > cooperation of that author with R's recommendations, but note > 'ordinal..so' in your log and l

[R] Dependencies for binaries install of R 2.8.2 under Ubuntu 64 8.1 (Intrepid)

2009-01-14 Thread Rob James
BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }I can't seem to perform an install from CRAN (stat.sfu.ca, specifically) for Ubuntu 64 8.1 (Intrepid) and 2.8.2 of R. Here is the log: Looks like some dependencies cannot be satisfied. Suggestions? Thanks in advance. sudo apt-g

[R] Histograms: Boxes and lines

2009-01-14 Thread John Kerpel
Hi folks! I'm trying to get a histogram legend to give me a filled box and a line. The problem is I keep getting both filled boxes and a line. How can I get rid of the second box from the code below? x<-rnorm(1000,mean=0,sd=1) hist(x, breaks = 50, main="Histogram of x",freq=FALSE, xlab=" x"

Re: [R] PCA loadings differ vastly!

2009-01-14 Thread Greg Snow
PCA is only defined up to a multiplicative constant and different programs use different constants. Without code or output we cannot tell if this is the case, or if something more is going on. Try rescaling one of the answers to see if you can get the other answer, if so, then it is just a dif

Re: [R] Extracting File Basename without Extension

2009-01-14 Thread William Dunlap
The S+ basename() function has an argument called suffix and it will remove the suffix from the result. This was based on the Unix basename command, but I missed the special case in the Unix basename that doesn't remove the suffix if the removal would result in an empty string. The suffix must in

[R] plotting time and dates revisited

2009-01-14 Thread Neotropical bat risk assessments
__ 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, self-contained, reproducible code.

Re: [R] quartz options not permanent

2009-01-14 Thread Prof Brian Ripley
On Wed, 14 Jan 2009, Premal Shah wrote: Hi all, I use a mac and was trying to reset my quartz options. However, every time I restart R, the options are gone and I have to type them again. How are you setting them? Any idea as to what's going wrong? Try asking on R-sig-mac for Mac-specifi

[R] quartz options not permanent

2009-01-14 Thread Premal Shah
Hi all, I use a mac and was trying to reset my quartz options. However, every time I restart R, the options are gone and I have to type them again. Any idea as to what's going wrong? Thanks, Premal __ R-help@r-project.org mailing list https://stat

Re: [R] Ordinal Package Errors

2009-01-14 Thread Prof Brian Ripley
You need to ask the author (as the posting guide asked you to). I'm tempted to not help further given the (almost complete) lack of cooperation of that author with R's recommendations, but note 'ordinal..so' in your log and look for the obvious fix in src/Makefile. On Wed, 14 Jan 2009, Rick

Re: [R] Memory use

2009-01-14 Thread Prof Brian Ripley
On Wed, 14 Jan 2009, Albrecht, Dr. Stefan (AIM SE) wrote: Dear R-help list, I am just trying to increase my memory for R, but for some reason I cannot really increase the memory size as much as I would like. I have 3 GB of RAM on a Windows XP (R 2.8.1) memory.size() [1] 879.4667 memory

Re: [R] problems with download.file() from ftp?

2009-01-14 Thread Duncan Temple Lang
Hi Zack, You might explore some of the options of libcurl via the RCurl package for R. Depending on the server, you may want to send either EPSV or PASV commands at some point in the dialog. libcurl, and the functions in RCurl, give you a great deal of control in cutomizing and controlling th

[R] Ordinal Package Errors

2009-01-14 Thread Rick Bilonick
I'm trying to install the ordinal package (http://popgen.unimaas.nl/~plindsey/rlibs.html). I downloaded ordinal03.tgz and untarred it. rmutil was previously installed (and appears to work ok.) Then I installed ordinal: [r...@localhost ~]# R CMD INSTALL /home/chippy/Download/ordinal * Installing t

Re: [R] problems with download.file() from ftp?

2009-01-14 Thread zack holden
Professor Ripley and Brian Rowe, Thank you both for your helpful suggestions. I was unable to solve this problem. Apparently there is a passive FTP server that is not supported by R. I'll have to find another programming language, perhaps IDL, that can do this. Manually retrieving the hundreds

Re: [R] How to compute p-Values

2009-01-14 Thread David Winsemius
I think we are at the stage where it is your responsibility to provide some code to set up the problem. -- David Winsemius On Jan 14, 2009, at 9:23 AM, Andreas Klein wrote: Hello. What I wanted was: I have a sample of 100 relizations of a random variable and I want a p-Value for the hypot

Re: [R] help

2009-01-14 Thread Marc Schwartz
Be careful there if the original data contains negative numbers. As per ?floor: takes a single numeric argument x and returns a numeric vector containing the largest integers not greater than the corresponding elements of x. Thus: x <- seq(-2, 2, 0.25) > x [1] -2.00 -1.75 -1.50 -1.25 -1.00 -0

[R] Odp: help

2009-01-14 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 14.01.2009 14:34:14: > Dear ALL > suppose "x=7.5",and i need of only integer part of variable "x" that is "7" > only then what command i can use in R. If you looked at help page for integer you would quickly find links to trunc, round, floor, ceiling

Re: [R] reshape, direction=long: "multiple row names not allowed"

2009-01-14 Thread Gustaf Rydevik
On Wed, Jan 14, 2009 at 3:07 PM, hadley wickham wrote: > On Wed, Jan 14, 2009 at 5:51 AM, Gustaf Rydevik > wrote: >> Hi all, >> >> for some reason I always get stuck spending hours when trying to use >> reshape or the Reshape package. Heaven knows why. >> My latest frustration (in 2.7.1, so ignor

[R] power analyses for mixed effects lmer models

2009-01-14 Thread LeeDetroit
Hi all, I'm new (post #1!) and I hope you'll forgive me if I'm acting like an idiot... I have been asked for some power analyses for some mixed-effects models I'm running using lmer. My studies nearly always contain mixes of repeated-measures and between-subjects predictor variables. As an exam

Re: [R] how to read data from the different worksheets in the same Excel file

2009-01-14 Thread Prof Brian Ripley
On Wed, 14 Jan 2009, Tony Breyal wrote: Hi Xin, I think you can use the read.xls() function from package xlsReadWrite. Assuming this is Windows alternatively, i think the odbcConnectExcel() function in package RODBC might work too (not sure about excel 2007 files, though there might be

  1   2   >