Re: [R] Performance (speed) of ggplot

2014-09-25 Thread Jeff Newmiller
You are asked in the Posting Guide to provide a small, reproducible example. Your function is Byzantine, and depends on who knows what, and I can't even see what your end product is intended to be. I will say that I think you have missed the point with your approach to using ggplot... you might

Re: [R] Unique values in dataframe columns

2014-09-25 Thread Jeff Newmiller
You messed up the quote marks and the "library" function is not capitalized. You defined your search list by the name "list", which is also the name of a commonly used base function in R. Also, the vector you gave to GetAllSubsets had several misleading invisible conversions to character because

Re: [R] Can't seem to get lapply to work.

2014-09-25 Thread Jeff Newmiller
On suggestion is to tell us what you want to accomplish, because that error makes perfect sense to me and your intent is rather opaque. Data frames are not lists of rows, they are lists of columns. One solution could be tstSet[["term"]] + 1 Another might be tstSet <- within(tstSet,{term <- te

[R] Can't seem to get lapply to work.

2014-09-25 Thread Keith S Weintraub
Folks, I have the following problem. tstSet<-structure(list(corr = c(0.59, 0.62), term = c(7, 7), am = c("AmYes", "AmNo"), prem = c(19.5, 14.75)), .Names = c("corr", "term", "am", "prem"), out.attrs = structure(list(dim = structure(c(3L, 2L, 2L, 41L), .Names = c("corr", "term", "am", "prem")),

Re: [R] writeRaster dataType changes

2014-09-25 Thread Pascal Oettli
Hi Emma, In writeRaster(), the argument is "datatype", not "dataType". Hope this helps, Pascal On Fri, Sep 26, 2014 at 3:08 AM, White, Emma wrote: > Hi, > > I am reading in some raster files and converting them to GeoTiff (using the > raster package), I want them to be 8 bit unsigned integer (

Re: [R] modify function in a package

2014-09-25 Thread David Winsemius
On Sep 25, 2014, at 11:21 AM, C Lin wrote: > Dear R users, > There is a package called NanoStringNorm with a function called > NanoStringNorm. > What I want to do is to change the NanoStringNorm function from the package > with my own copy that is written in my.nanostringnorm.R. > But if I do

Re: [R] adding rows

2014-09-25 Thread Bert Gunter
Inline. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Thu, Sep 25, 2014 at 3:28 PM, Sven E. Templer wrote: > see inline for another vectorized example.

[R] Unique values in dataframe columns

2014-09-25 Thread Maicel Monzón Pérez
Hello list I would like to know how can i detect dataframe columns that have as unique values elements of a list. For example, at a given dataframe to look for columns that unique values are elements of a list like this one… dataframe<-data.frame( x = c("yes”, "1”, "no”, "no”), y = c("black”,

Re: [R] adding rows

2014-09-25 Thread Sven E. Templer
see inline for another vectorized example. On 25 September 2014 23:05, David L Carlson wrote: > Another approach > > fun <- function(i, dat=x) { > grp <- rep(1:(nrow(dat)/i), each=i) > aggregate(dat[1:length(grp),]~grp, FUN=sum) > } > > lapply(2:6, fun, dat=TT) > > > ---

Re: [R] adding rows

2014-09-25 Thread David L Carlson
Another approach fun <- function(i, dat=x) { grp <- rep(1:(nrow(dat)/i), each=i) aggregate(dat[1:length(grp),]~grp, FUN=sum) } lapply(2:6, fun, dat=TT) - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352

Re: [R] adding rows

2014-09-25 Thread Rui Barradas
Hello, Try the following. fun <- function(x, r){ if(r > 0){ m <- length(x) %/% r y <- numeric(m) for(i in seq_len(m)){ y[i] <- sum(x[((i - 1)*r + 1):(i*r)]) } y }else{

[R] adding rows

2014-09-25 Thread eliza botto
Dear useRs, Here is my data with two columns and 20 rows. > dput(TT) structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 24, 48, 72, 96, 120, 144, 168, 192, 216, 240, 264, 288, 312, 336, 360, 384, 408, 432, 456, 480), .Dim = c(20L, 2L), .Dimnames = list(NULL, c("",

[R] Performance (speed) of ggplot

2014-09-25 Thread Christopher Battles
Hello list, I have been working on learning ggplot for its extraordinary flexibility compared to base plotting and have been developing a function to create a "Minitab-like" process capability chart. *sigh* some of the people I interface with can only understand the data when it is presented

[R] modify function in a package

2014-09-25 Thread C Lin
Dear R users,  There is a package called NanoStringNorm with a function called NanoStringNorm. What I want to do is to change the NanoStringNorm function from the package with my own copy that is written in my.nanostringnorm.R.  But if I do the following:  source('my.nanostringnorm.R") unlockBind

[R] writeRaster dataType changes

2014-09-25 Thread White, Emma
Hi, I am reading in some raster files and converting them to GeoTiff (using the raster package), I want them to be 8 bit unsigned integer (values in the case of this particular raster range from 0 to 55). However when writing the raster to GeoTiff R seems to assign it to dataType "FLT4S" desp

Re: [R] Error : '.path.package' is defunct.

2014-09-25 Thread Marc Schwartz
On Sep 25, 2014, at 1:02 PM, Yuan, Rebecca wrote: > Hello all, > > After this reinstallation of R 3.1.1 and Rstudio 0.98.1028, I have the > following error messages whenever I tried to load a library to it: > >> library('zoo') > Error : '.path.package' is defunct. > Use 'path.package' instead

Re: [R] Error : '.path.package' is defunct.

2014-09-25 Thread Rui Barradas
Hello, This seems to be an RStudio issue, to load package zoo works on R 3.1.1 on Windows, at least when using RGui. RStudio has its own help list, maybe you should contact them, at https://support.rstudio.com. > library(zoo) Attaching package: ‘zoo’ The following objects are masked from ‘p

[R] Error : '.path.package' is defunct.

2014-09-25 Thread Yuan, Rebecca
Hello all, After this reinstallation of R 3.1.1 and Rstudio 0.98.1028, I have the following error messages whenever I tried to load a library to it: > library('zoo') Error : '.path.package' is defunct. Use 'path.package' instead. See help("Defunct") Attaching package: 'zoo' The following objec

Re: [R] Masked from package

2014-09-25 Thread Duncan Murdoch
On 25/09/2014 11:46 AM, Jeff Newmiller wrote: No, masking does not imply inheritance. Simply that "foo" now refers to a different function, so you have to use "oldpkg::foo" if you want to get at the old function from your normal working environment. I haven't read the book (?), but I'd guess

Re: [R] error in rownames

2014-09-25 Thread David Winsemius
Chris; You are posting in HTML. You have apparently not read the Posting Guide. This is a plain-text mailing list. Please do read it now: http://www.R-project.org/posting-guide.html The code scraped from you consoles comes through without any linebreaks. (It's pretty easy to configure gmail to

Re: [R] error in rownames

2014-09-25 Thread Chris Jackson-Jordan
Sorry to respond again so quickly, but is this what you meant? y <- subset(training, select = c(ResponseSu))> x <- subset(training, select = c(sinaspect, habitat, elevation, disttowat, disttoroad, slope, cosaspect))> type.rf <- yai(x=x, y=y, method="randomForest", rfMode="regression", ntree=20)>

Re: [R] Masked from package

2014-09-25 Thread Jeff Newmiller
No, masking does not imply inheritance. Simply that "foo" now refers to a different function, so you have to use "oldpkg::foo" if you want to get at the old function from your normal working environment. Note that packages that call "foo" will continue to find the versions they intended to call

Re: [R] error in rownames

2014-09-25 Thread Chris Jackson-Jordan
Thanks again for your help, I am obviously a novice programmer. That said, I think I am confused as to what you mean by reproducible code. Were the 20 lines of code not reproducible? Also, what do you mean by the help for Ascii Grid Impute. I'm not able to find it online or within the R platform. F

Re: [R] Masked from package

2014-09-25 Thread Rich Shepard
On Thu, 25 Sep 2014, MacQueen, Don wrote: And to answer the “What do I read ...?” question help.search('masked’) returns quite a few things on my system, and the one you want is Don, et al.: Further research led me to re-read the beginning of "Analyzing Compositional Data with R" where the

Re: [R] error in rownames

2014-09-25 Thread Adams, Jean
Chris, You are not making it easy for R help folks to help you. You need to supply *** reproducible *** code, so that folks can simply copy and paste directly from your e-mail to R and reproduce the error that you are getting. Do you need a guide to follow? See the first 60-some lines of code p

Re: [R] Masked from package

2014-09-25 Thread MacQueen, Don
And to answer the “What do I read ...?” question help.search('masked’) returns quite a few things on my system, and the one you want is base::conflicts Search for Masked Objects on the Search Path Then of course ?conflicts Also, having seen those messages, you can do find(‘norm

Re: [R] Agreement accuracy

2014-09-25 Thread Mohan Radhakrishnan
I am also wondering how the Accuracy reported by the confusion matrix for gbm and rf could vary with the type of machines. The seed is the same. What other factors could affect the accuracy ? library is caret. Thanks, Mohan On Thu, Sep 25, 2014 at 2:30 PM, Mohan Radhakrishnan < radhakrishnan.mo..

Re: [R] Help with continuous color plot

2014-09-25 Thread Jim Lemon
On Wed, 24 Sep 2014 02:36:58 PM m...@considine.net wrote: > No, I don't think so. And I've wondered if I described the problem > clearly, so I put together the following hack, which seems to be what I > want : > > #create a matrix to hold the values corresponding to various percentiles > vals<-

[R] scaling of Amat still recommended for quadprog::solve.QP ?

2014-09-25 Thread Benjamin Tyner
Greetings, I ran across this recommendation, to keep the norms of the columns of the Amat on similar scales, https://stat.ethz.ch/pipermail/r-help/2007-September/141335.html However, when I looked at the code, I noticed that the norms are already being calculated: c c calculate the

[R] subset ffdf does not accept bit vector anymore (package ffbase)

2014-09-25 Thread christian.kamenik
Hi everyone Since I updated package 'ffbase', subset.ffdf does not work with bit vectors anymore. Here is a short example: data(iris) library(ffbase) iris.ffdf <- as.ffdf(iris) index <- sample(c(FALSE,TRUE), nrow(iris), TRUE) index.bit <- as.bit(index) subset(iris.ffdf, subset=index.bit) resu

[R] Agreement accuracy

2014-09-25 Thread Mohan Radhakrishnan
Hi, I have trained my data using two models(gbm and rf). I get the accuracies shown below. How does one get the aggreement accuracy% ? Is that the comparison of the two confusion matrices ? Confusion Matrix and Statistics Reference Prediction 1 2 3 4 5 6 7 8 9 10 11