Re: [R] get is.na & !is.na count of various combinations of columns

2014-03-18 Thread arun
Hi, I just noticed that you also have all is.na() or !is.na() subsets.  To do that: mydatatest <- structure(list(CaseID = structure(1:8, .Label = c("1605928", "1605943", "1605945", "1605947", "1605949", "1605951", "1605952", "1605953"), class = "factor"), Structure = structure(c(1L, 1L, 3L, 2L,

Re: [R] get is.na & !is.na count of various combinations of columns

2014-03-18 Thread arun
If you want to identify the combination of columns: names1 <-  unlist(lapply(seq(length(vec1)-1),function(i) {x1 <- as.data.frame(combn(vec1,i),stringsAsFactors=FALSE); unlist(lapply(x1, function(x) {indx <- vec1 %in% x; paste(paste(paste0("!is.na","(", vec1[!indx],")"),collapse=" & "), paste(p

Re: [R] get is.na & !is.na count of various combinations of columns

2014-03-18 Thread arun
Hi, May be this helps: res <-  lapply(seq(length(vec1)-1),function(i) {x1 <- as.data.frame(combn(vec1,i),stringsAsFactors=FALSE); lapply(x1, function(x) {indx <- vec1 %in% x; nisna <- paste(paste0("!is.na","(", vec1[!indx],")"),collapse=" & ");isna <- paste(paste0("is.na","(", vec1[indx],")"),c

[R] Data file verification protocol

2014-03-18 Thread Wolf, Steven
Hi R users, This isn’t a R-specific issue, per-se, but I thought that this list would have some helpful input on this topic. First, a bit of background. I am working on a project which is interested in following approx 1000 students each semester, and collects about 15 different measurements

Re: [R] Help with finding mean at 1 second interval

2014-03-18 Thread arun
Hi, You could also try: library(plyr) ddply(mutate(sardat,sec=as.numeric(gsub(".*:(.*)\\..*$","\\1",sardat$V1))),.(sec), numcolwise(mean)) #  sec   V2   V3    V4   V5   V6 #1  46 15.0 3.80 11.20 4.60 17.8 #2  47 14.28571 4.428571  9.857143 3.428571 16.85714

[R] Fwd: Error with glmulti

2014-03-18 Thread Alicia Ellis
I am analyzing some data that came from demographic health surveys. The data contain information for individuals within households, that are located within clusters, that are located within survey years, that are located within countries. We are trying to find the best model from a subset of pred

[R] get is.na & !is.na count of various combinations of columns

2014-03-18 Thread bcrombie
I'm trying to count the number of combinations of columns containing data & not containing data as described below. I"m not sure how to do this in R and need some help. #get TRUE/FALSE count of various combinations of columns per CaseID or per Structure mydatatest <- data.frame (CaseID = c("16059

Re: [R] Unable to install Rhipe package for R version 3.0.2 in ubuntu-12.04

2014-03-18 Thread Pascal Oettli
Hello, There is no package called "Rhipe" on R CRAN Any web search engine is your friend: https://www.datadr.org/install.html Regards, Pascal On Wed, Mar 19, 2014 at 12:34 AM, karthik wrote: > Hello, > > I have ubuntu 12.04 OS with R 3.0.2 version. My problem is I am getting > message like "

Re: [R] Help with finding mean at 1 second interval

2014-03-18 Thread Pascal Oettli
Hello, Please have a look at the "xts" package. Please don't post in HTML. Regards, Pascal On Wed, Mar 19, 2014 at 12:26 AM, Satish Anupindi Rao wrote: > Hi, > I have a zoo object with the first column as index. The columns have not been > named yet... but that I can change. It looks like thi

Re: [R] Help with finding mean at 1 second interval

2014-03-18 Thread Jim Lemon
On 03/19/2014 02:26 AM, Satish Anupindi Rao wrote: Hi, ... I would like to find the mean of the V2 to V6 columns on a per second interval. Would anyone please be able to help me with a function and implementation for that please? Hi Satish, If you don't care about the location of the interva

Re: [R] The lib.loc argument to library().

2014-03-18 Thread Rolf Turner
On 19/03/14 10:59, Prof Brian Ripley wrote: On 18/03/2014 21:41, Rolf Turner wrote: I am currently having, uh, difficulties, with the latest version of lme4, which I did not have with an elderly version that I was using previously. To check things out I installed the elderly version in a dire

Re: [R] The lib.loc argument to library().

2014-03-18 Thread Prof Brian Ripley
On 18/03/2014 21:41, Rolf Turner wrote: I am currently having, uh, difficulties, with the latest version of lme4, which I did not have with an elderly version that I was using previously. To check things out I installed the elderly version in a directory called "AltRlib", in my home directory.

Re: [R] Installation of R-3.0.3

2014-03-18 Thread Prof Brian Ripley
This really belongs on the R-devel list, in so far as it is an R issue at all. The most likely explanation is that you have a mismatch between your readline headers and library. That symbol needs readline >= 6.0. On 18/03/2014 18:53, Fong Chun Chan wrote: Hi, I am trying to install the new

[R] The lib.loc argument to library().

2014-03-18 Thread Rolf Turner
I am currently having, uh, difficulties, with the latest version of lme4, which I did not have with an elderly version that I was using previously. To check things out I installed the elderly version in a directory called "AltRlib", in my home directory. I kept the latest version (1.1-5) i

Re: [R] Error message

2014-03-18 Thread Jeff Newmiller
We cannot help you. You claim to have set the working directory but cannot find the file you expect to be there. Either you have failed to set the directory correctly, or the file is not where you think it is... and since we do not have access to your computer we have no way to tell you which ca

Re: [R] automatically replacing the third period with a break

2014-03-18 Thread Dustin Fife
Perfect. Thanks! On Tue, Mar 18, 2014 at 2:26 PM, Thomas Lumley wrote: > On Tue, Mar 18, 2014 at 12:43 PM, Dustin Fife wrote: > >> I've got a dataset with really long column names (e.g., >> CYJ.OSU.OAV.UJC.BUT.RDI). What I'd like to do is replace the fourth period >> with a break ("\n") so that

[R] RCurl: How to select options in online form and download the data

2014-03-18 Thread frauke
Hi, I would like to download discharge data for thousands of rivers from this website: http://ida.water.usgs.gov/ida/available_records.cfm?sn=1234 I have managed to fill in the blank spaces in the form (start and end time) using library(RCurl) url1<-"http://ida.water.usgs.gov/ida/available_

Re: [R] automatically replacing the third period with a break

2014-03-18 Thread Thomas Lumley
On Tue, Mar 18, 2014 at 12:43 PM, Dustin Fife wrote: > I've got a dataset with really long column names (e.g., > CYJ.OSU.OAV.UJC.BUT.RDI). What I'd like to do is replace the fourth period > with a break ("\n") so that when it plots, it will not run off the page. > Here's what I've got so far: > >

Re: [R] passing variables into R

2014-03-18 Thread arun
#if you want to just extract the columns of dat1 using vector1, you can just use:  dat1[,vector1] A.K. On Tuesday, March 18, 2014 1:13 PM, arun wrote: Hi, Not sure about your expected output.  May be this helps: vector1 <- c("LA_A", "LA_B", "G_A") dat1 <- setNames(as.data.frame(matrix(1:20,

[R] Error message

2014-03-18 Thread anisha honey
Hello When i run this command i get the error as shown below.I also changed my working directory and set it where ever i want but still its hopeless.please help me >counts <- read.table("NewBrain.tab", header=TRUE, row.names=1) Error in file(file, "rt") : cannot open the connection In addition: War

[R] Unable to install Rhipe package for R version 3.0.2 in ubuntu-12.04

2014-03-18 Thread karthik
Hello, I have ubuntu 12.04 OS with R 3.0.2 version. My problem is I am getting message like "Rhipe packages is not available for R version 3.0.2". Please let me know in case you have a workaround or any solution for installing Rhipe in R 3.0.2 (for Ubuntu). Regards, Karthik -- View this me

[R] multicore - handling a list of return values

2014-03-18 Thread Tim Smith
Hi, I was trying to gather/combine the results returned from the mclapply function. This is how I do it if only one data object is returned: #= This works fine === library(multicore) frandom1 <- function(iter,var1 = 3,var2 =2){     mat <- matrix(rnorm(var1*var2),nrow=var1,ncol=var2)  

[R] nlrq-{quantreg}

2014-03-18 Thread Francesco Di Matteo
Dear all, I am trying to use the nonlinear quantile regression which involves copula functions. Following the Frank copula example provided in the "quantreg" vignette I try do do the same using the Normal (Gaussian) copula. The problem is that the "nlrq" algorithm stops by giving the following err

[R] Help with finding mean at 1 second interval

2014-03-18 Thread Satish Anupindi Rao
Hi, I have a zoo object with the first column as index. The columns have not been named yet... but that I can change. It looks like this : V2 V3 V4 V5 V6 2014-03-14 22:41:46.988804 10 2 8 3 14 2014-03-14 22:41:46.991126 13 4 9

[R] Installation of R-3.0.3

2014-03-18 Thread Fong Chun Chan
Hi, I am trying to install the newest version of R-3.0.3 from source and I've been successful in the configuration using this command: ./configure --enable-R-shlib --with-x=no --prefix=/home/fcchan/usr/local/R-3.0.3 When I run make, I run into this issue: gcc -std=gnu99 -I../../src/extra/zlib -

[R] automatically replacing the third period with a break

2014-03-18 Thread Dustin Fife
I've got a dataset with really long column names (e.g., CYJ.OSU.OAV.UJC.BUT.RDI). What I'd like to do is replace the fourth period with a break ("\n") so that when it plots, it will not run off the page. Here's what I've got so far: create fake names function fake.names = function(x){ pas

Re: [R] Fwd: R basic data manipulation Queries

2014-03-18 Thread David Carlson
Not exactly automatic, but if you are using Windows: 1. Open a blank spreadsheet in Excel 2. write.table(cor(nums2), file="clipboard-128", sep="\t") # In R 3. Paste the clipboard into the spreadsheet Package xlsx can write Excel format files, but does not put them directly into Excel. For the se

Re: [R] Fwd: R basic data manipulation Queries

2014-03-18 Thread John Kane
In line John Kane Kingston ON Canada > -Original Message- > From: pavnee...@yahoo.co.uk > Sent: Tue, 18 Mar 2014 10:10:38 + > To: r-help@r-project.org > Subject: [R] Fwd: R basic data manipulation Queries > > > > > > > Sent from Samsung Mobile > > Original message ---

Re: [R] Overriding predict based on newdata...

2014-03-18 Thread Bert Gunter
Jonathan: As David said, this is a key aspect of S4 (there are others, of course). But it can be "simulated" in S3, I think, albeit inelegantly. You merely have to extend the class of "object", the fitted object you dispatch on, and then write an appropriate method for this extended class. e.g.

Re: [R] Overriding predict based on newdata...

2014-03-18 Thread Thomas Lumley
On Mon, Mar 17, 2014 at 4:08 AM, David Winsemius wrote: > S3 classes only dispatch on the basis of the first parameter class. A minor distinction: S3 classes only dispatch on the basis on *one* of the parameters. The person who writes the generic gets to choose, and for predict() it is the first

Re: [R] Overriding predict based on newdata...

2014-03-18 Thread Jonathan Greenberg
David: Thanks! Is it generally frowned upon (if I'm Incorporating this into a package) to "override" a generic function like "predict", even if I plan on making it a pass-through function (same parameters, and if the data type doesn't match my "weird" data type, it will simply pass the parameters

Re: [R] open unknown file format in R

2014-03-18 Thread Pascal Oettli
Hello, http://www.chikyu.ac.jp/precip/products/index.html HTH, Pascal On Tue, Mar 18, 2014 at 10:09 PM, eliza botto wrote: > Thankyou very much indeed.My limited knowledge of R is forcing me to ask you > that how did you know the following information (AphroJP, 123°E-146°E, > 24°N-46°N, resolu

Re: [R] open unknown file format in R

2014-03-18 Thread eliza botto
Thankyou very much indeed.My limited knowledge of R is forcing me to ask you that how did you know the following information (AphroJP, 123°E-146°E, 24°N-46°N, resolution 0.05x0.05 i.e. 440 rows x 460columns)? Thanks, Eliza > From: kri...@ymail.com > Date: Tue, 18 Mar 2014 21:39:58 +0900 > Subjec

Re: [R] open unknown file format in R

2014-03-18 Thread Pascal Oettli
Hello, It is not around the world. It is only for Japan (AphroJP, 123°E-146°E, 24°N-46°N, resolution 0.05x0.05 i.e. 440 rows x 460 columns). You can store in a Raster* object then extract the grid points you need, with the coordinates. HTH Pascal On Tue, Mar 18, 2014 at 9:21 PM, eliza botto

[R] format of output of residual standard errors of manova()

2014-03-18 Thread Gerrit Eichner
Dear all, I wasn't successful in finding any related "bug" or "wish" report on bugs.r-project.org, svn.R-project.org/R/trunk/doc/NEWS.Rd, or RSeek regarding the following: The code of stats:::print.aov contains the two commands cat("Residual standard error: ", sapply(sqrt(ss/rdf), format), "

Re: [R] Which() missing a number

2014-03-18 Thread Frede Aakmann Tøgersen
Hi So perhaps doing neilist == pfriends is the same as doing neilist == rep(pfriends, 9)? neilist <- c(13, 15, 28, 29, 30, 13, 14, 15, 28, 30, 43, 44, 45, 14, 15, 29, 44, 45) pfriends <- c(13, 15) cbind(neilist == pfriends, neilist == rep(pfriends, 9)) [,1] [,2] [1,] TRUE TRUE [2,

Re: [R] Which() missing a number

2014-03-18 Thread Duncan Murdoch
On 18/03/2014 7:14 AM, Thomas wrote: Does anyone know why this is happening? Which() is picking up the indices of the numbers 13 and 15 in neilist, but it's missing out the 13 at index 6. Thank you, Thomas Chesney > neilist [1] 13 15 28 29 30 13 14 15 28 30 43 44 45 14 15 29 44 45 > pf

Re: [R] open unknown file format in R

2014-03-18 Thread eliza botto
Hi Pascal, Your code worked out perfectly but I have one question though. You wrote that you did not use stations. What if I want to read stations as i am only interest in a part of data. I need it because the file has data for 202400 stations around the globe and I am only interest in data of 2

Re: [R] Which() missing a number

2014-03-18 Thread Rainer Schuermann
... and it is also missing the 15 at position 15. Can't explain but > which( neilist %in% pfriends ) should give you what you want. On Tuesday 18 March 2014 11:14:08 Thomas wrote: > Does anyone know why this is happening? Which() is picking up the > indices of the numbers 13 and 15 in

Re: [R] Which() missing a number

2014-03-18 Thread Sicotte, Hugues, Ph.D.
I think you want to do which(neilist %in% pfriends) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Thomas Sent: Tuesday, March 18, 2014 6:14 AM To: r-help@r-project.org Subject: [R] Which() missing a number Does anyone know why

[R] Fwd: R basic data manipulation Queries

2014-03-18 Thread Pavneet Arora
Sent from Samsung Mobile Original message Subject: R basic data manipulation Queries From: Pavneet Arora To: pavnee...@yahoo.co.uk CC: Hello Guys I am new in R, so please excuse the really basic questions. I have tried reading numeral tutorials, but I am still stuck. Q

[R] Which() missing a number

2014-03-18 Thread Thomas
Does anyone know why this is happening? Which() is picking up the indices of the numbers 13 and 15 in neilist, but it's missing out the 13 at index 6. Thank you, Thomas Chesney > neilist [1] 13 15 28 29 30 13 14 15 28 30 43 44 45 14 15 29 44 45 > pfriends [1] 13 15 > which(neilist==pfrie

Re: [R] strangely long floating point with write.table()

2014-03-18 Thread Duncan Murdoch
On 14-03-17 8:43 PM, Mike Miller wrote: On Mon, 17 Mar 2014, Duncan Murdoch wrote: On 14-03-17 6:22 PM, Mike Miller wrote: Thanks! Another thing I've figured out: Use of "drop0trailing=T" in format() fixes the .0 stuff that I didn't like: write.table(format(data[1:10,], digits=5, trim=

Re: [R] open unknown file format in R

2014-03-18 Thread eliza botto
Dear Pascal, Dan and Macqueen, Thankyou very much for your help. With pascal' code I was managed reading the file. Thanks, Eliza > From: kri...@ymail.com > Date: Tue, 18 Mar 2014 08:51:01 +0900 > Subject: Re: [R] open unknown file format in R > To: eliza_bo...@hotmail.com > CC: r-help@r-project.

[R] Double-logistic or double-sigmoid in R cran

2014-03-18 Thread Phalaen [via R]
Good morning everyone, I am looking for a package in R cran to fit a double logistic curve like this: http://en.wikipedia.org/wiki/File:Dsigmoid.png but the packages I've found are not running for my data, in particular: "phenex" package is specifical for NDVI data, "FlexParamCurve" is really i

Re: [R] is it possible to get the coordinate of mtext()?

2014-03-18 Thread David McPearson
On Mon, 17 Mar 2014 15:18:50 -0700 Jinsong Zhao wrote > Hi there, > > I hope to rotate the Y label of axis(4) with -90 degree. I can typeset > the Y label using text() with srt = -90. However, I cannot get the > coordinate of the position that mtext() used. > <...cut...> locator(1) # Works