Re: [R] force axis to extend

2017-03-15 Thread Jim Lemon
Hi Jen, It seems way too simple, but does this work? axis(side=2,at=seq(-35,35,by=5),cex.axis=0.7) You may want to consider using a pyramid plot for this. Jim On Thu, Mar 16, 2017 at 11:45 AM, Jen wrote: > Hi, I'm creating a couple of mirrored bar plots. Below is data and code > for one. >

[R] Test individual slope for each factor level in ANCOVA

2017-03-15 Thread li li
Hi all, Consider the data set where there are a continuous response variable, a continuous predictor "weeks" and a categorical variable "region" with five levels "a", "b", "c", "d", "e". I fit the ANCOVA model as follows. Here the reference level is region "a" and there are 4 dummy variables.

[R] force axis to extend

2017-03-15 Thread Jen
Hi, I'm creating a couple of mirrored bar plots. Below is data and code for one. My problem is that I need the axis to go from -35 to 35 by 5. I can't get that to happen with the code below. I need it so all my plots are on the same scale. How can I do that using barplot? For reasons, I can't

Re: [R] Correlated variables

2017-03-15 Thread David L Carlson
Don't put a function inside ifelse(). It will only be executed once and the value repeated. But rbinom() will accept a vector of probabilities so use ifelse() to create a vector of probabilities for rbinom(): > set.seed(42) > x <- c(0, 1, 0, 1, 0) # The next 3 will give different results each ti

[R] screen

2017-03-15 Thread Val
HI all, I have some data to be screened based on the recording flag (obs). Some family recorded properly (1) and others not (0). Th 0 = improper and 1 = proper The recording period starts week1. All families may not start in the same week in recording properly an observation, DF2 <- read.t

Re: [R] Extract student ID that match certain criteria

2017-03-15 Thread roslinazairimah zakaria
Hi Rui, Both functions work beautifully. I really appreciate your help and others very much. Thank you On Wed, Mar 15, 2017 at 10:46 PM, Rui Barradas wrote: > Hello, > > I believe your request is a bit confusing since you say you want to filter > the student id but then you have many years in

Re: [R] Correlated variables

2017-03-15 Thread Jim Lemon
Hi Ariel, It all depends upon n: n<-2 x1=rnorm(n,0,1); x2=rnorm(n,0,1); x3=rnorm(n,0,1); if(x1+x2-x3>0.25){ t=rbinom(1, 1, prob=0.25) }else{ t=rbinom(1, 1, prob=0.5) } n<-1 x1=rnorm(n,0,1); x2=rnorm(n,0,1); x3=rnorm(n,0,1); if(x1+x2-x3>0.25){ t=rbinom(1, 1, prob=0.25) }else{ t=rbinom(1, 1,

Re: [R] How to get the date generated by the forecast function as another field in a data frame

2017-03-15 Thread Rui Barradas
Hello, This does what you want. rownames(as.data.frame(TSSeriesModel1Forecast)) Hope this helps, Rui Barradas Em 15-03-2017 16:24, Paul Bernal escreveu: Hello Rui, I have attached the .csv file, I will attach it again. Please let me know if you can access it. Cheers, Paul 2017-03-15 11:

Re: [R] [FORGED] Re: Crete stats course

2017-03-15 Thread Rolf Turner
On 16/03/17 03:57, Bert Gunter wrote: Perhaps this has been asked and settled before, but while such courses certainly might be of interest to those who read this list, they are for profit, and therefore advertising them here does seem somewhat inappropriate. Please, I don't want to start a long

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

2017-03-15 Thread C W
I figured it out. You can first do, saveGIF({ for (j in 1:20){ plot(-4:4, -4:4, type = "n") for(i in 1:10){ x[i] <- rnorm(1) y[i] <- rnorm(1) points(x[i], y[i]) } } }) It looks like you have to re-plot every time. On Wed, Mar 15, 2017 at 1:41 PM, C W wrote:

Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-15 Thread William Dunlap via R-help
You could use the following function locf2 <- function(x, initial=NA, IS_BAD = is.na) { # Replace 'bad' values in 'x' with last previous non-bad value. # If no previous non-bad value, replace with 'initial'. stopifnot(is.function(IS_BAD)) good <- !IS_BAD(x) stopifnot(is.logical

Re: [R] Crete stats course

2017-03-15 Thread Highland Statistics Ltd
Well since you mention it the mailing list page says The ‘main’ R mailing list, for discussion about problems and solutions using R, announcements (not covered by ‘R-announce’ or ‘R-packages’, see above), about the availability of new functionality for R and documentation of R, comparison a

Re: [R] Correlated variables

2017-03-15 Thread David L Carlson
You will have to use a for loop if you insist on using control statements such as if-else. You should really read up on the ifelse() function and vectorization in R: > set.seed(42) # So your results will match these > n <- 25 > x1 <- rnorm(n, 0, 1) > x2 <- rnorm(n, 0, 1) > x3 <- rnorm(n, 0, 1) >

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

2017-03-15 Thread C W
Thanks Hervé, Bert, and Yihui. I installed ImageMagick using the Bert link provided. I am still not able to produce gif. The saveGIF() example, from https://cran.r-project.org/web/packages/animation/animation.pdf saveGIF({ for (i in 1:10) plot(runif(10), ylim = 0:1) }) However, my for loop is

Re: [R] Crete stats course

2017-03-15 Thread Michael Dewey
Well since you mention it the mailing list page says The ‘main’ R mailing list, for discussion about problems and solutions using R, announcements (not covered by ‘R-announce’ or ‘R-packages’, see above), about the availability of new functionality for R and documentation of R, comparison and

Re: [R] Crete stats course

2017-03-15 Thread Ashley Patton via R-help
True, but if I may put in my two pennies worth, for novices like me it is useful to know about these things. -Original Message- From: Bert Gunter To: Highland Statistics Ltd CC: R-help Sent: Wed, 15 Mar 2017 14:59 Subject: Re: [R] Crete stats course Perhaps this has been asked and s

[R] mood.test/mood.medtest

2017-03-15 Thread Leemann, Lucas T
Hello, I was trying to test whether two medians are identical or not and used the function “mood.test” from the “stats" package. My co-author, a medical doctor, was trying to do the same in SPSS and had different results. I wanted to see whether there was a problem on my end and also used the

[R] Correlated variables

2017-03-15 Thread Art U
Hi, I'm trying to create binary variable which distribution conditioned on other variables. That is what I did, x1=rnorm(n,0,1); x2=rnorm(n,0,1); x3=rnorm(n,0,1); if(x1+x2-x3>0.25){ t=rbinom(1, 1, prob=0.25) }else{ t=rbinom(1, 1, prob=0.5) } But I always get this the warning: Warning messag

[R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-15 Thread Allan Tanaka
The following is an example: | Item_Identifier | Item_Weight | | FDP10 | 19 | | FDP10 | | | DRI11 | 8.26 | | DRI11 | | | FDW12 | 8.315 | | FDW12 | | The following is the one that i want to be. That is, filling NA values from the previous Non-NA values. | Item_Identifier | Item_Weight | | FDP

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

2017-03-15 Thread Sarah Goslee
This question is a strong argument for not posting in HTML. I at least cannot make sense out of the example. It's also a strong argument for providing a small reproducible example using dput() to provide data. Someone is more likely to be able to help if we don't have to guess what you meant. Sa

Re: [R] add median value and standard deviation bar to lattice plot

2017-03-15 Thread Bert Gunter
There may be a specific function that handles this for you, but to roll your own, you need a custom panel.groups function, not the default. You need to modify the panel function (which is panel.superpose by default) to pass down the "col" argument to the panel.segments call in the panel.groups func

Re: [R] How to get the date generated by the forecast function as another field in a data frame

2017-03-15 Thread Paul Bernal
Hello Rui, I have attached the .csv file, I will attach it again. Please let me know if you can access it. Cheers, Paul 2017-03-15 11:05 GMT-05:00 Rui Barradas : > Hello, > > Since we don't have access to file ContainerDataNEW.csv I cannot say for > sure but it seems that those dates are the

Re: [R] Crete stats course

2017-03-15 Thread Highland Statistics Ltd
On 15/03/2017 16:57, Bert Gunter wrote: Perhaps this has been asked and settled before, but while such courses certainly might be of interest to those who read this list, Bert, they are for profit, and therefore advertising them here does seem somewhat inappropriate. I don't want to be rude

Re: [R] How to get the date generated by the forecast function as another field in a data frame

2017-03-15 Thread Rui Barradas
Hello, Since we don't have access to file ContainerDataNEW.csv I cannot say for sure but it seems that those dates are the rownames so you could try rownames(TSSeriesModel1Forecast) and see what it gives. Or I might be completely mistaken. Hope this helps, Rui Barradas Em 15-03-2017 15:50,

[R] How to get the date generated by the forecast function as another field in a data frame

2017-03-15 Thread Paul Bernal
Dear all, I am currently using R for windows Version 3.3.3 (I will provide the sessionInfo() output below) > library("Rcmdr") Loading required package: splines Loading required package: RcmdrMisc Loading required package: car Loading required package: sandwich Rcmdr Version 2.3-2 > library(fore

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

2017-03-15 Thread Duncan Murdoch
On 15/03/2017 8:58 AM, Yihui Xie wrote: I'm the author of the animation package, and I do plan to switch to the magick package in the future instead of using ImageMagick as a system dependency. I did that in rgl (as a Suggests); it's very easy, as the functions mirror the command line options.

Re: [R] Crete stats course

2017-03-15 Thread Bert Gunter
Perhaps this has been asked and settled before, but while such courses certainly might be of interest to those who read this list, they are for profit, and therefore advertising them here does seem somewhat inappropriate. Please, I don't want to start a long discussion or war. Just slap me down if

Re: [R] Extract student ID that match certain criteria

2017-03-15 Thread Rui Barradas
Hello, I believe your request is a bit confusing since you say you want to filter the student id but then you have many years in dt_all3 and only one program ("IJAZAH SARJANA MUDA"). So I've written two simple functions, one to filter by year and the other by program. fun1 <- function(x, ye

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

2017-03-15 Thread Yihui Xie
I'm the author of the animation package, and I do plan to switch to the magick package in the future instead of using ImageMagick as a system dependency. Regards, Yihui -- https://yihui.name On Wed, Mar 15, 2017 at 12:32 AM, Bert Gunter wrote: > A google search on "ImageMagick Package R" brough

Re: [R] Getting the date out of R forecast funcion along with the forecasts as a data frame

2017-03-15 Thread Jeff Newmiller
A) This is a support forum for R, a free software. It is your responsibility to confirm that your difficulties occur when that software is used, and confirm that knowledge by referencing the version you used (e.g. using the sessionInfo function) and not referencing proprietary software. B) Pro

Re: [R] Extract student ID that match certain criteria

2017-03-15 Thread roslinazairimah zakaria
Hi Caitlin, I tried so many ways as suggested but unsuccessful...and I realise that I need to filter the student ID and their CGPA, but if I change the ID into character I lost the CGPA value. It is easy to do in excel, however a bit time consuming and trying to do in R. I have these data: dput

[R] Getting the date out of R forecast funcion along with the forecasts as a data frame

2017-03-15 Thread Paul Bernal
Dear all, I am currently generating forcasts using several different functions in Azure Machine Learning Studio using the R script module (nnetar, auto.arima, HoltWinters, ets, etc.). However, I want to find a way to get the dates of the forecasts and put those dates (along with the forecasts) in

[R] add median value and standard deviation bar to lattice plot

2017-03-15 Thread Luigi Marongiu
Dear all, I am analyzing some multivariate data that is organized like this: 1st variable = cluster (A or B) 2nd variable = target (a, b, c, d, e) 3rd variable = type (blank, negative, positive) 4th variable = sample (the actual name of the sample) 5th variable = average (the actual reading -- plea

[R] Crete stats course

2017-03-15 Thread Highland Statistics Ltd
There are a few remaining seats on the following course: Course: Data exploration, regression, GLM & GAM with R Where: HCMR, Crete, Greece When: 24-28 April 2017 Course website: http://www.highstat.com/statscourse.htm Course flyer: http://highstat.com/Courses/Flyers/Flyer2017_04Crete_RGG

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

2017-03-15 Thread Lorenzo Isella
Thanks, I had also seen that, but I was hoping to avoid dealing with the shapefiles and to download the world map as a spatial polygon data frame. Cheers Lorenzo On Wed, Mar 15, 2017 at 09:21:54AM +1100, Jim Lemon wrote: Hi Lorenzo, See: http://www.gadm.org/version2 Jim On Wed, Mar 15, 2017

[R] problem with sparkl_connect() in the sparklyr package for parallelizing R in the Spark environment - "Gateway in port (8880) did not respond"

2017-03-15 Thread Taylor, Ronald C
Hi folks, I posted the message below as a new issue on the sparklyr web page at github over a week ago, but have not gotten any reply back. So I am posting here, in the hope somebody on this list can provide guidance. I really want to get R working in Spark on our local Linux cluster. Eager t