Re: [R] Percent transformation

2017-03-14 Thread Jeff Newmiller
Your x variable is a data frame. The scales::percent() function does not work on data frames. It might work on the individual columns in the data frame. You probably ought to re-read your preferred introduction to R material on the difference between data frames and the columns in data frames.

Re: [R] Percent transformation

2017-03-14 Thread Bert Gunter
This looks like homework. If so, we don't do homework here. If not, please read and follow the posting guide. In particular, plain text email only. The error message you received seems self explanatory. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along

Re: [R] Percent transformation

2017-03-14 Thread Berend Hasselman
> On 14 Mar 2017, at 22:19, Christoph Puschmann > wrote: > > Hello all, > > I am having a problem of transforming decimals into percentage. Specifically, > I get the following error message: > > "Error in UseMethod("round_any") : > no applicable method for 'round_any' applied to an object o

[R] Document Term Matrix will not maintain decimal places of numbers or capture all terms

2017-03-14 Thread Will Ebert
Before I updated my version of RStudio (1.0.136), everything worked great. With the update something has changed with Document Term Matrix in the 'tm' package. I want to create a dtm, but with numbers. For instance if I have a .csv with one column as shown below: x1.0111.21123.35212.11 I want the

[R] [R-pkgs] New package: revdbayes

2017-03-14 Thread Northrop, Paul
Dear R users, I am pleased to announce the release on CRAN of revdbayes 1.1.0 : Ratio-of-Uniforms Sampling for Bayesian Extreme Value Analysis (https://cran.r-project.org/package=revdbayes). revdbayes performs random posterior sampling in univaria

[R] Percent transformation

2017-03-14 Thread Christoph Puschmann
Hello all, I am having a problem of transforming decimals into percentage. Specifically, I get the following error message: "Error in UseMethod("round_any") : no applicable method for 'round_any' applied to an object of class “data.frame" My code looks the following: x <- sp[1:5,2:6] x = pe

Re: [R] Is ImageMagick package not compatible with R 3.3.2?

2017-03-14 Thread Bert Gunter
A google search on "ImageMagick Package R" brought this up, which seems relevant: https://cran.r-project.org/web/packages/magick/vignettes/intro.html -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley B

Re: [R] Is ImageMagick package not compatible with R 3.3.2?

2017-03-14 Thread Hervé Pagès
Hi, ImageMagick is an external software that you need to install on your system. It's not an *R* package so trying to install it with install.packages() won't work. Note the difference between things listed in the SystemRequirements field (the animation package has many of these system requireme

[R] Is ImageMagick package not compatible with R 3.3.2?

2017-03-14 Thread C W
Dear list, I am trying to use saveGIF() from library animation. https://cran.r-project.org/web/packages/animation/animation.pdf saveGIF() has dependency on package ImageMagick. I got the following, > install.packages("ImageMagick") Warning in install.packages : package ‘ImageMagick’ is not ava

Re: [R] Permission to use R Installation Screenshots and Datasets

2017-03-14 Thread Jeff Newmiller
I am not sure there exists any one person who can grant you permission to use screen shots, but someone with more clue than I have may be able to clear this up with you. Regarding packages, copyright rests with the package authors, so use the maintainer() function to find out who you need to ask

Re: [R] extend lines of prediction interval ggplot2

2017-03-14 Thread Jeff Newmiller
Define your new_df before you calculate temp_var, and give it to predict so predict doesn't start from your original x values. Add temp_var to new_df. Read ?predict.lm. Don't create matrices with cbind before creating data frames... data frames can have a variety of data storage modes (types) f

Re: [R] GADM -- Download World Map for R

2017-03-14 Thread Jim Lemon
Hi Lorenzo, See: http://www.gadm.org/version2 Jim On Wed, Mar 15, 2017 at 1:57 AM, Lorenzo Isella wrote: > Dear All, > Please have a look at the snippet here > > http://bit.ly/2mVS8me > > This short code addresses precisely one of my needs: to superimpose a > network (created with the igraph l

Re: [R] Quantiles with ordered categories

2017-03-14 Thread William Dunlap via R-help
You could round the quantiles of the codes of the ordered factor to come up with a reasonable result. E.g., quantile.ordered <- function(x, ...) ordered(levels(x)[as.integer(quantile(as.integer(x), ...))], levels=levels(x)) > unCut <- log2(2:30) > Cut <- cut(unCut, breaks=0:6, ordered_result=TRU

Re: [R] Quantiles with ordered categories

2017-03-14 Thread matthias-gondan
I found it: quantile(ordered(1:10), probs=0.5, type=1) works, because type=1 seems to round up or down, whatever. The default option for is 7, which wants to interpolate, and then produces the error. Two options come to my mind: - The error message could be improved. - The default type could

Re: [R] Quantiles with ordered categories

2017-03-14 Thread Bert Gunter
Inline. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Mar 14, 2017 at 12:36 PM, wrote: > Dear R users, > > This works: > > quantile(1:10, probs=0.5) > >

[R] Quantiles with ordered categories

2017-03-14 Thread matthias-gondan
Dear R users, This works: quantile(1:10, probs=0.5) This fails (obviously): quantile(factor(1:10), probs=0.5) But why do quantiles for ordered factors not work either? quantile(ordered(1:10), probs=0.5) Is it because interpolation (see the optional type argument) is not defined? Is there a

Re: [R] Fwd: Error: memory exhausted (limit reached?)

2017-03-14 Thread Spencer Graves
On 2017-03-14 12:01 PM, Bert Gunter wrote: I suspect this is beyond the expertise of most participants of this list. You might wish to post this on r-devel instead,where such expertise is more likely to be found. However, that also may not be the right place either; it's just the best I could t

Re: [R] Fwd: Error: memory exhausted (limit reached?)

2017-03-14 Thread Bert Gunter
I suspect this is beyond the expertise of most participants of this list. You might wish to post this on r-devel instead,where such expertise is more likely to be found. However, that also may not be the right place either; it's just the best I could think of. Cheers, Bert Bert Gunter "The trou

[R] Request for Permission to Use Screenshots of R Installation in our text book

2017-03-14 Thread Srinivasa K G
Dear Sir/Madam, We are in the process of developing a textbook on R and are writing to request your permission to include certain screenshots relating to installation of the package in our book to be published tentatively in May 2017. The description of our book is as follows*:* *Title*: Stati

[R] extend lines of prediction interval ggplot2

2017-03-14 Thread Andras Farkas via R-help
Dear All, would you have some thoughts on how to extend the prediction interval lines to beyond the "range of data"? example: y <-c(0.4316092,0.4156757,0.3517915,0.3669508,0.3899471,0.3964143, 0.4001074,0.3851003,0.4222451,0.375324,0.3652045,0.3376978,0.383012, 0.3763665,0.3550609,0.2958

[R] Fwd: Error: memory exhausted (limit reached?)

2017-03-14 Thread Guillaume MULLER
Hi again, Sorry, I messed up, the link to the actual file is: https://mega.nz/#!ZMs0TSRJ!47DCZCnE6_FnICUp8MVS2R9eY_GdVIyGZ5O9TiejHfc FYI, it loads perfectly on 2 machines with Ubuntu 16.04 and R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" But exceededs stack mem under Ubuntu 16.10's R

[R] Determine IP address of gateway

2017-03-14 Thread Dr Eberhard Lisse
Hi, I want code to run on my laptop depending on what WiFi I am connected to (ie internally I access MySQL without password, externally with password). Currently I look for the gateway and then branch accordingly. Is there any way of doing gateway = system("netstat -r -f inet -n|grep default|awk

[R] Permission to use R Installation Screenshots and Datasets

2017-03-14 Thread Srinivasa K G
Dear Sir/Madam, We are in the process of developing a textbook on R and are writing to request your permission to include certain screenshots relating to installation of the package in our book to be published tentatively in May 2017. The description of our book is as follows*:* *Title*: Statis

[R] extending lines for prediction intervals

2017-03-14 Thread Andras Farkas
Dear All, would you have some thoughts on how to extend the prediction interval lines to beyond the "range of data" modeled? example: y <-c(0.4316092,0.4156757,0.3517915,0.3669508,0.3899471,0.3964143, 0.4001074,0.3851003,0.4222451,0.375324,0.3652045,0.3376978,0.383012, 0.3763665,0.3550

[R] GADM -- Download World Map for R

2017-03-14 Thread Lorenzo Isella
Dear All, Please have a look at the snippet here http://bit.ly/2mVS8me This short code addresses precisely one of my needs: to superimpose a network (created with the igraph library) to a geographical map. Unlike the case of the example, where a single country is enough, I need to have a world m

Re: [R] [FORGED] same column name in a data frame

2017-03-14 Thread David L Carlson
How about just using data.frame(): instead of cbind(): > x <- data.frame(a=c(1,2,3)) > y <- data.frame(a=c(2,3,4)) > xy <- data.frame(x, y) > str(xy) 'data.frame': 3 obs. of 2 variables: $ a : num 1 2 3 $ a.1: num 2 3 4 > xy$a [1] 1 2 3 > xy$a.1 [1] 2 3 4 -

Re: [R] [FORGED] same column name in a data frame

2017-03-14 Thread peter dalgaard
> On 14 Mar 2017, at 03:43 , Rolf Turner wrote: > > On 14/03/17 14:56, Jinsong Zhao wrote: >> Hi there, >> >> I happened to find the following code can generate a data frame with >> same column name. >> >>> x <- data.frame(a=c(1,2,3)) >>> y <- data.frame(a=c(2,3,4)) >>> z <- cbind(x,y) >> >>

Re: [R] Reshaping from long to wide with duplicate idvar and timevar

2017-03-14 Thread PIKAL Petr
Hi You should specify what do you want with duplicated rows. If you wanted them to be averaged you can use dcast from reshape2 package. > dcast(Indometh2,Subject~time, fun.aggregate=mean) Using conc as value column: use value.var to override. Subject 0.25 0.5 0.751 1.25234

Re: [R] replace

2017-03-14 Thread PIKAL Petr
Hi slightly different version without as.character DF1$Comb <- ifelse(DF1$first=="Alex", paste(DF1$first, DF1$YR, sep="-"), paste(DF1$first, "", sep="")) [1] "Alex-2001" "Bob" "Cory" "Cory" "Bob" "Bob" [7] "Alex-2002" "Alex-2003" "Alex-2004" Cheers Petr > -Original M

Re: [R] Principal Coordinate Analysis of unweighted UniFrac distances on R

2017-03-14 Thread Martin Maechler
> Bert Gunter > on Mon, 13 Mar 2017 10:39:49 -0700 writes: > Please read and follow the posting guide. Plain text only > + code that you tried + reproducible exam (google it). > In general, we do not do tutorials here, but someone may > indeed be able to refer you to