[R] Dot plot similar to StatKey

2013-07-30 Thread David Arnold
Hi, I'd like to use R to produce the following plot: dotplot.jpeg http://r.789695.n4.nabble.com/file/n4672628/dotplot.jpeg This was constructed using StatKey at: http://www.lock5stat.com/statkey/bootstrap_1_quant/bootstrap_1_quant.html

Re: [R] Dot plot similar to StatKey

2013-07-30 Thread Jim Lemon
On 07/30/2013 04:21 PM, David Arnold wrote: Hi, I'd like to use R to produce the following plot: dotplot.jpeghttp://r.789695.n4.nabble.com/file/n4672628/dotplot.jpeg This was constructed using StatKey at: http://www.lock5stat.com/statkey/bootstrap_1_quant/bootstrap_1_quant.html

Re: [R] 2sls and systemfit

2013-07-30 Thread Arne Henningsen
Dear Cecilla! On 22 July 2013 14:08, Cecilia Carmo cecilia.ca...@ua.pt wrote: I have the following model: Cost of debt = intercept + information quality + control variable1 + control variable2 + … + error term I want to perform 2sls because I think I could have two situations: First: maybe

[R] Plot a series of plots without using a loop

2013-07-30 Thread Ben Harrison
I have an xyf object from the kohonen package, and wish to plot a lattice or grid or multiplot of a set of attributes of this object. I've included the structure of the object below for reference, and here is the set of plots I wish to produce, given in long-hand. I don't know enough R to

Re: [R] Plot a series of plots without using a loop

2013-07-30 Thread Rui Barradas
Hello, Maybe the following does it. op - par(mfrow=c(2, 3)) for(i in 1:6){ plot(somdata.xyf, type=property, property=somdata.xyf$codes$X[, i], main=colnames(somdata.xyf$codes$X)[i]) } par(op) Hope this helps, Rui Barradas Em 30-07-2013 10:33,

[R] selection based on dates

2013-07-30 Thread Andras Farkas
Dear All   please provide your insigths on the following:   I have:   a -c(1/1/13,15,20) b -c(1/5/13,15,25) c -c(1/9/13,15,28) d -c(2/1/13,18,30) e -c(2/5/13,18,35) f -c(2/9/13,18,38) x -matrix(c(a,b,c,d,e,f),ncol=3,byrow=TRUE)   What I would like to do is to eliminate certain rows of this matrix

Re: [R] selection based on dates

2013-07-30 Thread arun
Hi, If the rows are already ordered: x1- as.data.frame(x) x[with(x1,ave(seq_along(V2),V2,FUN=function(x) !x%in%min(x)))==1,] # [,1] [,2] [,3] #[1,] 1/5/13 15 25 #[2,] 1/9/13 15 28 #[3,] 2/5/13 18 35 #[4,] 2/9/13 18 38 #otherwise  

Re: [R] selection based on dates

2013-07-30 Thread Ben Tupper
On Jul 30, 2013, at 7:13 AM, Andras Farkas wrote: Dear All please provide your insigths on the following: I have: a -c(1/1/13,15,20) b -c(1/5/13,15,25) c -c(1/9/13,15,28) d -c(2/1/13,18,30) e -c(2/5/13,18,35) f -c(2/9/13,18,38) x -matrix(c(a,b,c,d,e,f),ncol=3,byrow=TRUE)

Re: [R] Dot plot similar to StatKey

2013-07-30 Thread S Ellison
I'd like to use R to produce the following plot: dotplot.jpeg http://r.789695.n4.nabble.com/file/n4672628/dotplot.jpeg x-rnorm(500) xr - round(x, 1) stripchart(xr, method=stack, pch=19) will do this if the data are rounded appropriately. You may have some fun with 'appropriately'.

Re: [R] selection based on dates

2013-07-30 Thread Rui Barradas
Hello, Try the following. idx - which(c(TRUE, diff(as.integer(x[,2])) != 0)) x[-idx,] Also, note that in constructs such as a -c(1/1/13,15,20) both 15 and 20 are coerced to character. So your matrix is a matrix of chars. For different types of data, use data.frames Hope this helps, Rui

Re: [R] selection based on dates

2013-07-30 Thread arun
Just a note: If the dataset is not ordered, this could result in:  set.seed(24)  xNew-x[sample(1:nrow(x),6,replace=FALSE),] idxN-which(c(TRUE,diff(as.integer(xNew[,2]))!=0))  xNew[-idxN,] #[1] 2/1/13 18 30  xNew1-xNew[order(xNew[,2],xNew[,1]),]

[R] Select only rows that don't contain one number

2013-07-30 Thread Dimitri Liakhovitski
Hello! I have a data frame: x-data.frame(a=c(-1,1,2,3,4),b=c(1,-1,3,4,5),c=1:5,d=2:6,e=c(1,2,3,-1,4)) x How can I grab only those rows that don't contain any -1s (no matter in what columns? Without writing a loop. In other words, I want my output to contain only rows 3 and 5 of x. Thank you

Re: [R] Select only rows that don't contain one number

2013-07-30 Thread Dimitri Liakhovitski
Thanks a a lot, Jose! On Tue, Jul 30, 2013 at 10:19 AM, José María Mateos jmmat...@mce.hggm.eswrote: 2013/7/30 Dimitri Liakhovitski dimitri.liakhovit...@gmail.com: How can I grab only those rows that don't contain any -1s (no matter in what columns? Without writing a loop. In other

Re: [R] Select only rows that don't contain one number

2013-07-30 Thread arun
x[rowSums(!x0)==ncol(x),] #if you don't want x0 #  a b c d e #3 2 3 3 4 3 #5 4 5 5 6 4 #or  x[rowSums(!x==-1)==ncol(x),] #  a b c d e #3 2 3 3 4 3 #5 4 5 5 6 4 A.K. - Original Message - From: Dimitri Liakhovitski dimitri.liakhovit...@gmail.com To: r-help r-help@r-project.org Cc:

Re: [R] Select only rows that don't contain one number

2013-07-30 Thread arun
You could also use: indx-with(x,(1+2*(a!=-1)+4*(b!=-1)+8*(c!=-1)+16*(d!=-1)+32*(e!=-1)))  x[indx==max(indx),] #  a b c d e #3 2 3 3 4 3 #5 4 5 5 6 4 #Speed comparisons: set.seed(548) x1- as.data.frame(matrix(sample(c(-1,1:10),5*1e6,replace=TRUE),ncol=5)) system.time({  index - apply(x1, 1,

Re: [R] Select only rows that don't contain one number

2013-07-30 Thread Bert Gunter
or x[ !rowSums(x == -1), ] if you are willing to tolerate the coercions and equality testing. -- Bert On Tue, Jul 30, 2013 at 7:30 AM, arun smartpink...@yahoo.com wrote: x[rowSums(!x0)==ncol(x),] #if you don't want x0 # a b c d e #3 2 3 3 4 3 #5 4 5 5 6 4 #or

Re: [R] selection based on dates

2013-07-30 Thread Farhan Ahmed
I'm still a novice at R, so this may be a bit convoluted but it works: colnames(x) = c(date, id, value) do.call(rbind, (dlply(as.data.frame(x), .(id), function (y) y[-c(which(as.Date(y$date, %m/%d/%y) == min(as.Date(y$date, %m/%d/%y)), arr.ind=T)),]))) - FA -- Original Message --

[R] Interpolate irregularly spaced data without typical convex hull

2013-07-30 Thread tbrowning...@hotmail.com
I have some irregularly spaced data points I want to interpolate (and ideally extrapolate marginally beyond). I have been using Akima and predict surface but this interpolates through the whole convex hull region. As this space includes a large region where there are actually no data points I

[R] Time Series X labels

2013-07-30 Thread Lívio Cipriano
Hi, When we plot a Time Series object with a annual frequency, in the X axes usually appears mark ticks with an interval of 5 years. How can customize the X axes putting a tick for every year? Regards Lívio Cipriano __ R-help@r-project.org mailing

[R] List of lists

2013-07-30 Thread mohan . radhakrishnan
Hi, I am creating a list of 2 lists, one containing filenames and the other file descriptors. When I retrieve them I am unable to close the file descriptor. I am getting this error when I try to call close(filedescriptors [[2]][[1]]). Error in UseMethod(close) : no applicable

[R] Time Series with daily frequency

2013-07-30 Thread Lívio Cipriano
Hi, I tried to use the ts function to create a Time Series object with daily frequency but I couldn't. It's not possible or I'm not using the right parameters? Regards Lívio Cipriano __ R-help@r-project.org mailing list

[R] Reshape

2013-07-30 Thread Dominic Roye
Hello, I try out to create a new form from the below data.frame. I would like to have this form: V3 Santiago Ourense VigoFerrol 2013-07-04 2013-07-04 07:01:04 .. How can i get this? str(sunrise) 'data.frame': 24

[R] reclassification table

2013-07-30 Thread Miroslav Stojadinovic
Hi all, I am trying to build reclassification table, net reclassification improvement ...using PredictAbel in R version 2.15.1 or 3. However when I try to obtain reclassification table I get an error. A sample session is reproduced below. str(nrii) 'data.frame': 213 obs.

Re: [R] Select only rows that don't contain one number

2013-07-30 Thread Farhan Ahmed
x[!apply(x, 1, function (y) any(y==-1)),] -- Original Message -- From: Dimitri Liakhovitski dimitri.liakhovit...@gmail.com To: r-help r-help@r-project.org Sent: 7/30/2013 10:06:02 AM Subject: [R] Select only rows that don't contain one number Hello! I have a data frame:

Re: [R] about R stat.table function

2013-07-30 Thread Gu, LanYing
Hi David, Rui and Arun, Thank you very much for your response, your email much help me to solve my problem. I installed library(Epi) into my R, I can use stat.table function in R now. As a Biostatistician and researcher, I did some projects using R, but I used basic R. Even though I like R

Re: [R] Select only rows that don't contain one number

2013-07-30 Thread José María Mateos
2013/7/30 Dimitri Liakhovitski dimitri.liakhovit...@gmail.com: How can I grab only those rows that don't contain any -1s (no matter in what columns? Without writing a loop. In other words, I want my output to contain only rows 3 and 5 of x. index - apply(x, 1, function (x) { !(c(-1) %in% x)})

Re: [R] Reshape

2013-07-30 Thread John Kane
https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston ON Canada -Original Message- From: dominic.r...@gmail.com Sent: Tue, 30 Jul 2013 15:41:46 +0200 To: r-help@r-project.org

Re: [R] Time Series with daily frequency

2013-07-30 Thread John Kane
Who knows? You have not told us what you are actually doing. https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston ON Canada -Original Message- From: lcmail4li...@gmail.com

Re: [R] Dot plot similar to StatKey

2013-07-30 Thread John Kane
geom_dotplot() in the ggplot2 package perhaps? ggplot(mtcars, aes(x = mpg)) + geom_dotplot() John Kane Kingston ON Canada -Original Message- From: dwarnol...@suddenlink.net Sent: Mon, 29 Jul 2013 23:21:26 -0700 (PDT) To: r-help@r-project.org Subject: [R] Dot plot similar to StatKey

Re: [R] cross-correlation with R

2013-07-30 Thread John Kane
We need to know what you actually are doing before we can suggest anything. Have a look at these links : https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston ON Canada -Original

Re: [R] Reshape

2013-07-30 Thread arun
Hi, Please use ?dput() for the example data sunrise- structure(list(day_frac = c(Santiago, Ourense, Vigo, Ferrol, Santiago, Ourense, Vigo, Ferrol, Santiago, Ourense, Vigo, Ferrol), time = structure(c(1372935664, 1372935605, 1372935846, 1372935458, 1373022101, 1373022041, 1373022282,

[R] [R-pkgs] update: rockchalk 1.8.0

2013-07-30 Thread Paul Johnson
This will appear on CRAN mirrors soon. It's my update for Spring, 2013. I keep track of R problems that arise in the regression course and try to facilitate them. There are functions for describing data, presenting regression plots and tables, some regression diagnostics. Most of the usages are

[R] as.Date with characters error

2013-07-30 Thread Liz Hare
Hello, I'm trying to convert dates in the format dd-mmm-yy using as.Date. I have two columns like this, and it works on one but not on the other. options(stringsAsFactors=FALSE) ortho - read.csv(test1.csv, header=TRUE, nrows=10) ortho DogID BirthDate xray.date 1 11877 23-Aug-87 15-Feb-88

[R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread Mathieu Basille
Dear list, Here is a simple example in which the behaviour of 'format' does not make sense to me. I have read the documentation and searched the archives, but nothing pointed me in the right direction to understand this behaviour. Let's start with a simple data frame: df1 - data.frame(x =

Re: [R] as.Date with characters error

2013-07-30 Thread arun
Hi, Did you checked after removing e from formate? ortho$test.dat - as.Date(ortho$xray.date, formate=%d-%b-%y)   A.K. - Original Message - From: Liz Hare dogg...@earthlink.net To: r-help@r-project.org Cc: Sent: Tuesday, July 30, 2013 12:00 PM Subject: [R] as.Date with characters error

Re: [R] as.Date with characters error

2013-07-30 Thread Liz Hare
Oh! Thank you so much! Sorry to have bothered everyone with this! Liz On 7/30/2013 12:16 PM, arun wrote: Hi, Did you checked after removing e from formate? ortho$test.dat - as.Date(ortho$xray.date, formate=%d-%b-%y) A.K. - Original Message - From: Liz Hare dogg...@earthlink.net

Re: [R] Intersecting two matrices

2013-07-30 Thread c char
Thanks a lot. Still looking for some super fast and memory efficient solution, as the matrix I have in real world has billions of rows. On Mon, Jul 29, 2013 at 6:24 PM, William Dunlap wdun...@tibco.com wrote: I haven't looked at the size-time relationship, but im2 (below) is faster than your

Re: [R] Time Series with daily frequency

2013-07-30 Thread Rui Barradas
Hello, You should show us an example of what you're doing. Anyway, there's an agument frequency to ?ts. Maybe you could set it frequency = 365. Also, see packages zoo and xts for the creation of time series objects with real time stamps. Hope this helps, Rui Barradas Em 30-07-2013 13:33,

Re: [R] Time Series X labels

2013-07-30 Thread Rui Barradas
Hello, The standard way of customizing the x axis is plot(..., xaxt = n) axis(1, at = where you want the ticks) Hope this helps, Rui Barradas Em 30-07-2013 13:31, Lívio Cipriano escreveu: Hi, When we plot a Time Series object with a annual frequency, in the X axes usually appears mark

Re: [R] Intersecting two matrices

2013-07-30 Thread Jeff Newmiller
In that case, you should be looking at a relational inner join, perhaps with SQLite (see package sqldf). --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.us

Re: [R] Error: Line starting ' ...' is malformed!

2013-07-30 Thread Ross Boylan
On Monday, July 29, 2013 07:47:34 AM MacQueen, Don wrote: A recent version of the R extension manual says, For maximal portability, the ‘DESCRIPTION’ file should be written entirely in ASCII — if this is not possible it must contain an ‘Encoding’ field (see below). It also says, regarding

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread David Winsemius
On Jul 30, 2013, at 9:01 AM, Mathieu Basille wrote: Dear list, Here is a simple example in which the behaviour of 'format' does not make sense to me. I have read the documentation and searched the archives, but nothing pointed me in the right direction to understand this behaviour. Let's

Re: [R] Intersecting two matrices

2013-07-30 Thread c char
I am not familiar with R's sort and sql libs. appreciate if you can post a code snippet when you got time. Thanks a lot! On Tue, Jul 30, 2013 at 10:36 AM, Jeff Newmiller jdnew...@dcn.davis.ca.uswrote: In that case, you should be looking at a relational inner join, perhaps with SQLite (see

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread Mathieu Basille
Thanks David for your interest. I have to admit that your answer puzzles me even more than before. It seems that the underlying problem is way beyond my R skills... The generation of id2 is indeed quite demanding, especially compared to a simple 'as.character' call. Anyway, since it seems to

Re: [R] Dot plot similar to StatKey

2013-07-30 Thread S Ellison
I said: stripchart(xr, method=stack, pch=19) will do this if the data are rounded appropriately. You may have some fun with 'appropriately'. A bit of tinkering gives something that gets close to 'appropriate' (below); you may want to tinker with the tuning factor (or, of course, write

[R] xmlToDataFrame very slow

2013-07-30 Thread Stavros Macrakis
I have a modest-size XML file (52MB) in a format suited to xmlToDataFrame (package XML). I have successfully read it into R by splitting the file 10 ways then running xmlToDataFrame on each part, then rbind.fill (package plyr) on the result. This takes about 530 s total, and results in a

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread arun
Hi, Try using trim=TRUE, in ?format() options(digits=4) df2 - data.frame(x = rnorm(11), y = rnorm(11), id = 1:11)  df2$id2 - apply(df2, 1, function(dfi) format(dfi[id], trim=TRUE,scientific = FALSE))   df2$id2[0:100010] # [1] 0  1  2  3  4  5  6 

[R] MCMC with cumulative link models

2013-07-30 Thread knouri
Hi: Could anyone please let me know where I can find [R] code for implementing MCMC with cumulative link models (i.e. for analysis of ordinal probit or ordinal logistic models).   Thanks in advance, Regards, Keramat Nourijelyani, PhD Associate Professorof

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread Mathieu Basille
Thanks Arun for your answer. 'trim = TRUE' does indeed solve the symptoms of the problem, and this is the solution I'm currently using. However, it does not help to understand what the problem is, and what is the cause of it. Can you confirm that the original problem also occurs on your

Re: [R] 'format' behaviour in a 'apply' call depending on 'options(digits = K)'

2013-07-30 Thread arun
Hi Mathieu yes, the original problem occurs in my system too. I am using R 3.0.1 on linux mint 15.  I guess the default case would be trim=FALSE, but still it looks very strange especially in ?apply(), as it starts from 5 onwards. sessionInfo() R version 3.0.1 (2013-05-16) Platform:

Re: [R] Dot plot similar to StatKey

2013-07-30 Thread Richard M. Heiberger
I would use panel.dotplot.tb from the HH package. It is based on lattice, hence will plot multiple groups on the same scale. continuing with S Ellison's example ## install.packages(HH) ## if necessary library(HH) rpx - round.pch(x) dotplot( ~ rpx, panel=panel.dotplot.tb, ylim=c(.98, 1.15))

Re: [R] Time Series with daily frequency

2013-07-30 Thread Lívio Cipriano
On 30 July 2013 17:50:08 Rui Barradas wrote: Maybe you could set it frequency = 365. No. It didn't worked. Was my first trial. Also, see packages zoo and xts for the creation of time series objects with real time stamps. I'll look in to them. Regards Lívio Cipriano

[R] acf and ccf

2013-07-30 Thread Cathy Lee Gierke
Greetings, Is it possible to see the source code for the acf and ccf functions? I want to understand the exact formula used. It may be in this book, but I am hoping I can find it elsewhere, as the book is quite expensive. Venables, W. N. and Ripley, B. D. (2002) *Modern Applied Statistics with

Re: [R] acf and ccf

2013-07-30 Thread arun
Just type acf ccf on R prompt A.K. - Original Message - From: Cathy Lee Gierke leegi...@umn.edu To: r-help@r-project.org; r-core-ow...@r-project.org Cc: Sent: Tuesday, July 30, 2013 4:02 PM Subject: [R] acf and ccf Greetings, Is it possible to see the source code for the acf and

Re: [R] Reshape

2013-07-30 Thread Jim Lemon
On 07/30/2013 11:41 PM, Dominic Roye wrote: Hello, I try out to create a new form from the below data.frame. I would like to have this form: V3 Santiago Ourense VigoFerrol 2013-07-04 2013-07-04 07:01:04 .. How

Re: [R] acf and ccf

2013-07-30 Thread arun
I use R 3.0.1. #I do have that line after  ` lag[lower.tri(lag)] - -1`  acf - .Call(C_acf, x, lag.max, type == correlation)     lag - outer(0:lag.max, lag/x.freq)     acf.out - structure(list(acf = acf, type = type, n.used = sampleT,     lag = lag, series = series, snames = colnames(x)),

Re: [R] List of lists

2013-07-30 Thread Jim Lemon
On 07/30/2013 10:05 PM, mohan.radhakrish...@polarisft.com wrote: Hi, I am creating a list of 2 lists, one containing filenames and the other file descriptors. When I retrieve them I am unable to close the file descriptor. I am getting this error when I try to call

Re: [R] set the wd based on cdv file

2013-07-30 Thread arun
Hi, It is not clear which OS you are using.  Most probably, the Directory column would be factor. table1- read.table(text= ID Directory 1  /home/arunksa111/Documents 2  /home/arunksa111/Trial 3  ~/Trial1 4 ~Trial2 ,sep=,header=TRUE,stringsAsFactors=FALSE) setwd(table1$Directory[2])  getwd() #[1]

Re: [R] Plot a series of plots without using a loop

2013-07-30 Thread Ben Harrison
On 30 July 2013 21:35, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Maybe the following does it. op - par(mfrow=c(2, 3)) for(i in 1:6){ plot(somdata.xyf, type=property, property=somdata.xyf$codes$X[, i],

[R] installing rJava

2013-07-30 Thread Erin Hodgess
Dear R People: I am trying to install rJava on an Ubuntu 13.04 64 bit system. But the Java part is causing me fits. Here is the code: install.packages(rJava,depen=TRUE) Installing package into ‘/home/erin/R/x86_64-pc-linux-gnu-library/3.0’ (as ‘lib’ is unspecified) --- Please select a CRAN

Re: [R] installing rJava

2013-07-30 Thread Orvalho Augusto
It is really strange what I see on this output. Your machine is 64 bit (i386) and the libjvm is being compiled to 32 bit (I do not know what could elicit such behavior). Can you try and JDK 6 version? I am on a ubuntu 12.04 64 bit and I have rJava: orvaquim@orvaquimcism:~$ R CMD javareconf -e

Re: [R] installing rJava

2013-07-30 Thread Yihui Xie
You can install it from Michael Rutter's PPA: sudo apt-add-repository -y ppa:marutter/c2d4u sudo apt-get update sudo apt-get install r-cran-rjava The last time I tried the official Ubuntu repository, rJava still did not work under R 3.0.x (because R 3.0.x requires recompiling all R packages).