Re: [R] rgl crash on windows 7

2017-09-28 Thread Duncan Murdoch
On 28/09/2017 7:15 PM, Kevin Wright wrote: I have a co-worker who has installed R 3.4.2 on Windows 7.  When this person tries to load the rgl package with library(rgl) A dialog box appears with the message: R for windows gui frontend has stopped working I suspect a conflict problem with a

[R] rgl crash on windows 7

2017-09-28 Thread Kevin Wright
I have a co-worker who has installed R 3.4.2 on Windows 7. When this person tries to load the rgl package with library(rgl) A dialog box appears with the message: R for windows gui frontend has stopped working I suspect a conflict problem with a dll, but I'm not sure how to identify if this is

Re: [R] rename multiple files by file.rename or other functions

2017-09-28 Thread Jim Lemon
Hi John, After a bit of thinking: # fill in the appropriate path and pattern filenames<-list.files(path=???,pattern=???) for(filename in filenames) { filefirst<-sapply(strsplit(filename,"[.]"),"[",1) # delete all non-digits fileno<-gsub("[^[:digit:]]","",filefirst)

Re: [R] Searching for Enumerated Items using str_count() from the stringr package

2017-09-28 Thread Tóth Dénes
On 09/29/2017 12:02 AM, Tóth Dénes wrote: On 09/28/2017 10:25 PM, Dan Abner wrote: Hi all, I have a large number of text strings to search for enumerated items. However, I am receiving this error message even though I thought that I properly escaped the special character closed

Re: [R] Searching for Enumerated Items using str_count() from the stringr package

2017-09-28 Thread Tóth Dénes
On 09/28/2017 10:25 PM, Dan Abner wrote: Hi all, I have a large number of text strings to search for enumerated items. However, I am receiving this error message even though I thought that I properly escaped the special character closed parenthesis: Count<-str_count(text3,keywords) Error

[R] Searching for Enumerated Items using str_count() from the stringr package

2017-09-28 Thread Dan Abner
Hi all, I have a large number of text strings to search for enumerated items. However, I am receiving this error message even though I thought that I properly escaped the special character closed parenthesis: > Count<-str_count(text3,keywords) Error in stri_count_regex(string, pattern,

Re: [R] building random matrices from vectors of random parameters

2017-09-28 Thread Evan Cooch
Makes sense, although (re-)learning what aperm does wasn't a wasted exercise. Thanks! On 9/28/2017 1:22 PM, Jeff Newmiller wrote: > The use of aperm is unnecessary if you call array() properly. > > ms <- array(c(rep(0, 5),so,sa*m,sa), c(5, 2, 2)) [[alternative HTML version deleted]]

[R] Fwd: Boxplot, formula interface, and labels.

2017-09-28 Thread Ed Siefker
I knew I was making harder than it needed to be. I see it now in ?boxplot Thanks! On Thu, Sep 28, 2017 at 12:30 PM, David L Carlson wrote: > Just change the separator: > > data(Titanic) > Titanic.df <- as.data.frame(Titanic) > boxplot(Freq~Class*Sex, Titanic.df, cex.axis=.6,

Re: [R] Boxplot, formula interface, and labels.

2017-09-28 Thread David L Carlson
Just change the separator: data(Titanic) Titanic.df <- as.data.frame(Titanic) boxplot(Freq~Class*Sex, Titanic.df, cex.axis=.6, sep="\n") See attached .png. David L Carlson Department of Anthropology Texas A University College Station, TX 77843-4352

Re: [R] Boxplot, formula interface, and labels.

2017-09-28 Thread Ista Zahn
mybp <- boxplot(count ~ geno * tissue, data = mydata, plot = FALSE) mybp$names <- gsub("\\.", "\n", mybp$names) bxp(mybp) See ?boxplot for details. Best, Ista On Thu, Sep 28, 2017 at 12:40 PM, Ed Siefker wrote: > I have data I'd like to plot using the formula interface to

Re: [R] building random matrices from vectors of random parameters

2017-09-28 Thread Jeff Newmiller
The use of aperm is unnecessary if you call array() properly. ms <- array(c(rep(0, 5),so,sa*m,sa), c(5, 2, 2)) -- Sent from my phone. Please excuse my brevity. On September 28, 2017 9:10:26 AM PDT, Evan Cooch wrote: >Sure -- thanks -- only took me 3-4 attempts to get

Re: [R] Boxplot, formula interface, and labels.

2017-09-28 Thread Ed Siefker
Another way to think of this problem. If I could get my hands on the vector of names boxplot() is creating, I could use gsub() to replace '.' with '\n'. Is there something I could run before boxplot() that would give me that vector of names which I could then pass to boxplot()? On Thu, Sep 28,

[R] Boxplot, formula interface, and labels.

2017-09-28 Thread Ed Siefker
I have data I'd like to plot using the formula interface to boxplot. I call boxplot like so: with(mydata, boxplot(count ~ geno * tissue)) I get a boxplot with x axis labels like "wt.kidney". I would like to change the '.' to a newline. Where is this separator configured? Thanks, -Ed

Re: [R] building random matrices from vectors of random parameters

2017-09-28 Thread Evan Cooch
Sure -- thanks -- only took me 3-4 attempts to get aperm to work (as opposed to really thinking hard about how it works ;-) On 9/28/2017 11:55 AM, Duncan Murdoch wrote: > On 28/09/2017 9:10 AM, Evan Cooch wrote: >> Thanks for both the mapply and array approaches! However, although >> intended

[R] Efficient Package for Huge datasets in R

2017-09-28 Thread Shylashree U.R
Dear Sir/Madam, I have a large data set of 10,17,289 observations of 10,830 variables. I need to use PCA to reduce the dimension of dataset. I have already tried irlba, prcomp and nsprcomp packages in R but couldn't do for huge data sets. i.e pc <- prcomp_irlba(sparseYY[1:5000,], n=50, retx =

Re: [R] building random matrices from vectors of random parameters

2017-09-28 Thread Duncan Murdoch
On 28/09/2017 9:10 AM, Evan Cooch wrote: Thanks for both the mapply and array approaches! However, although intended to generate the same result, they don't: # mapply approach n = 3 sa <- rnorm(n,0.8,0.1) so <- rnorm(n,0.5,0.1) m <- rnorm(n,1.2,0.1) mats = mapply(function(sa1, so1, m1)

Re: [R] building random matrices from vectors of random parameters

2017-09-28 Thread Evan Cooch
> > In fact, this is what is returned by the mapply approach, while the > array approach returns the transpose. I gather the 'missing step' is > to use aperm, but haven't figured out how to get that to work...yet. ms <- array(c(rep(0, 3),sa*m,so,sa), c(3, 2, 2)) ms_new <- aperm(ms,c(1,3,2));

Re: [R] building random matrices from vectors of random parameters

2017-09-28 Thread Evan Cooch
Thanks for both the mapply and array approaches! However, although intended to generate the same result, they don't: # mapply approach n = 3 sa <- rnorm(n,0.8,0.1) so <- rnorm(n,0.5,0.1) m <- rnorm(n,1.2,0.1) mats = mapply(function(sa1, so1, m1) matrix(c(0,sa1*m1,so1,sa1),2,2,byrow=T), sa, so,

Re: [R] rename multiple files by file.rename or other functions

2017-09-28 Thread Thierry Onkelinx
The combination of list.files(), gsub() and file.rename() should to the trick. ir. Thierry Onkelinx Statisticus/ Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team

Re: [R] rename multiple files by file.rename or other functions

2017-09-28 Thread peter dalgaard
> On 28 Sep 2017, at 12:57 , Eric Berger wrote: > > Hi John, > Thanks to Jim for pointing out the file.rename() function. You can try this: > > # define the filename templates > strIn <- "XYZW--Genesis_ABC.mp3" > strOut <- "01Gen--.mp3" > > # create the strings "01",

Re: [R] rename multiple files by file.rename or other functions

2017-09-28 Thread Eric Berger
Hi John, Thanks to Jim for pointing out the file.rename() function. You can try this: # define the filename templates strIn <- "XYZW--Genesis_ABC.mp3" strOut <- "01Gen--.mp3" # create the strings "01", "02", ..., "50" v <- sapply(1:50, function(i) sprintf("%02d",i) ) # perform all the file

Re: [R] R 3.4.2 is released

2017-09-28 Thread Duncan Murdoch
I've just finished the Windows build of R 3.4.2. It will make it to CRAN and its mirrors over the next few hours. This is the last binary release that I will be producing. I've been building them for about 15 years, and it's time to retire. Builds using different tools and scripts are

Re: [R] rename multiple files by file.rename or other functions

2017-09-28 Thread Jim Lemon
Hi John, Maybe this: filenames<-c("XYZW01Genesis_ABC.mp3","XYZW02Genesis_ABC.mp3") for(filename in filenames) { filefirst<-sapply(strsplit(filename,"[.]"),"[",1) fileno<-sub("_","",gsub("[[:alpha:]]","",filefirst)) file.rename(filename,paste("01Gen",fileno,".mp3",sep="")) } Jim On Thu, Sep

Re: [R] rename multiple files by file.rename or other functions

2017-09-28 Thread Ulrik Stervbo
Hi John, I don't know how to do this with R, but on Linux I'd use rename (or maybe even by hand if it's a one time event). On Windows I believe there is a tool called Bulk Rename. HTH Ulrik On Thu, 28 Sep 2017 at 11:37 John wrote: > Hi, > >I have 50 files whose names

[R] rename multiple files by file.rename or other functions

2017-09-28 Thread John
Hi, I have 50 files whose names are XYZW01Genesis_ABC.mp3 XYZW02Genesis_ABC.mp3 ... XYZW50Genesis_ABC.mp3 As you can tell, the only difference across the files are 01, 02, 03,50. I would like to rename them to 01Gen01.mp3 01Gen02.mp3 ... 01Gen50.mp3 If I store them in

Re: [R] building random matrices from vectors of random parameters

2017-09-28 Thread Duncan Murdoch
On 27/09/2017 8:47 PM, Evan Cooch wrote: Suppose I have interest in a matrix with the following symbolic structure (specified by 3 parameters: sa, so, m): matrix(c(0,sa*m,so,sa),2,2,byrow=T) What I can't figure out is how to construct a series of matrices, where the elements/parameters are

[R] R 3.4.2 is released

2017-09-28 Thread Peter Dalgaard
The build system rolled up R-3.4.2.tar.gz (codename "Short Summer") this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.4.2.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries

[R] [R-pkgs] The OutliersO3 package is now on CRAN

2017-09-28 Thread Antony Unwin
Dear all, The new package OutliersO3 is now available on CRAN: . The aim is to graphically compare results of outlier analyses for all possible combinations of variables in a dataset. Various kinds of O3 (Overview of Outliers)