Re: [R] R copies for no apparent reason

2017-03-02 Thread Bert Gunter
Your assumptions are wrong. a full discussion and answer to your question can be found here: http://adv-r.had.co.nz/memory.html This *is* complex and probably off topic for this list. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking

Re: [R] Differences between SPSS and R on probit analysis

2017-03-02 Thread Biank M
Yes I got the warning message from 'glm' and ignored it, I will never do it again. On the other hand, I think that including the 'weights' argument improved the results ( I don't get a warning message anymore) and now they are closer to the SPSS results, thought they are not exactly the same

Re: [R] optimal control

2017-03-02 Thread Bert Gunter
This is not a free consulting service, so no, no assistance. Read the posting guide (linked below) to see what help you *may* get on this list (if the volunteers who answer care to do so). Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and

Re: [R] R code helps needed!

2017-03-02 Thread Jim Lemon
Hi Steve, Try this: result<-read.table(text= "intercept decision 1 reject 2 reject 3 reject 0 pass 3 reject 2 reject 3 reject 5 reject 3 reject 1 reject 1 reject 2 reject 2 reject 0 pass 3

[R] swirl library loading problem

2017-03-02 Thread Moinul Islam
I have installed swirl package using install.packages("swirl") after that I tried to load library(swirl). It shows the following error. Error in get(Info[i, 1], envir = env) : cannot open file 'C:/Users/Moinul/Documents/R/win-library/3.3/digest/R/digest.rdb': No such file or directory Error:

[R] R copies for no apparent reason

2017-03-02 Thread Jiucang Hao
Hi Everyone, Some R function will make R copy the object AFTER the function call, like nrow, while some others don't, like sum. For example the following code: x = as.double(1:1e8) system.time(x[1] <- 100) y = sum(x) system.time(x[1] <- 200) ## Fast (takes 0s), after calling sum foo

[R] R code helps needed!

2017-03-02 Thread SH
Hi Although I posted this in stackoverflow yesterday, I am asking here to get helps as soon as quickly. I need help make code for mocking sampling environment. Here is my code below: First, I generated mock units with 1000 groups of 100 units. Each row is considered as independent sample space.

[R] Leave One Group Out with caret

2017-03-02 Thread Marcus Hanisch
In Social psychology we are working on a project where we try to predict relationship quality (outcome) by personality (features). Main goal is to contribute to better match people with have higher chances to have a happy long lasting romantic relationship. I would be very grateful if you

[R] optimal control

2017-03-02 Thread Ismail Raji
Dear sir, Please, kindly assist me with examples on how to use R for simulation of optimal control problem in epidemiology. Thank you. Raji,Ismail I The federal polytechnic,Ado-ekiti Dept of Maths & Statistics Ekiti state Nigeria [[alternative HTML version deleted]]

Re: [R] Fw: Averaging without NAs

2017-03-02 Thread Ng Bo Lin
Hi Elahe, You can do so using the mean function, mean(), by specifying an additional argument, na.rm = TRUE. In this case, you specify that you wish to remove (rm) all NA values in the columns. —> mean($X2016.Q1, na.rm = T). By default, na.rm is set to FALSE, so mean() will return a NA value.

[R] Tweedie Model in R software

2017-03-02 Thread Azmi Muslun via R-help
Dear all,I have data on monthly rainfall (about 40 years)and i am trying to fit a Tweedie model to the data in order to estimate a p value for each month. I have run the following R codes.

[R] Why does residuals.coxph use naive.var?

2017-03-02 Thread Matthew Burgess
Hi all, I noticed that the scaled Schoenfeld residuals produced by residuals.coxph(fit, type="scaledsch") were different from those returned by cox.zph for a model where robust standard errors have been estimated. Looking at the source code for both functions suggests this is because

[R] Looking to understand GPU acceleration in R

2017-03-02 Thread Andrej Favia
I am a casual user looking to learn about GPU acceleration in R... at a "new to computers" level (do not use overly technical language with me as I will not understand what you are saying). I am on macOS Sierra with an Intel Iris Pro GPU. 1. Can someone produce any simple example in R that uses

Re: [R-es] error en el cambio de formato desde factor a numerico USANDO LAPPLY

2017-03-02 Thread Carlos Ortega
Hola Javier, Claro, una vez que cargas el fichero en "R", la columna queda asignada a una clase, en este caso "character" o "factor" que permanece aunque elimines la fila que provocó este comportamiento. Esta asignación no es dinámica. Tienes que volver a definir la nueva clase de forma

Re: [R] Selecting rows and columns of a data frame using relational operators

2017-03-02 Thread Tunga Kantarcı
Thank you for all the helpful answers. Tunga __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

[R] Selecting rows and columns of a data frame using relational operators

2017-03-02 Thread Tunga Kantarcı
Thank you for all the helpful answers. Tunga __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

[R] Extracting information from a tm corpus.

2017-03-02 Thread Shawn Way
I'm trying to use the tm package to extract text from a corpus of documents. I'm able to read in a set of PDF's and get a corpus that is filtered to include all the documents that contain a term, for example, "hot water". I'm also able to get a list of the documents using the names() function

Re: [R] Problem with workspace and publishWebService function in RStudio

2017-03-02 Thread Bert Gunter
You seem to be confusing R and RStudio. The latter is an IDE + more for the former, which is open source statistics and data analysis software (+ more). The details you show above are for R, not RStudio. They are entirely separate. As this seems to be a non-CRAN rather special package, you may

Re: [R] Problems outputting ggplot2 graphics to pdf

2017-03-02 Thread Ulrik Stervbo
Hi Hugh, I believe the recommended way of saving ggplots is through ggsave. It defaults to take the latest plot displayed, but you can specify which plot to save by passing the variable to the plot argument. If you need to save multiple plots in one file, you have to create a multipage plot

[R] Problem with workspace and publishWebService function in RStudio

2017-03-02 Thread Paul Bernal
Dear all, I am trying to deploy an RStudio predictive model into Microsoft Azure Machine Learning Studio (see code below), however, I keep getting two error messages: (1)Error: could not find function "workspace", and (2) Error: could not find function "publishWebService", I am wondering what

Re: [R-es] error en el cambio de formato desde factor a numerico USANDO LAPPLY

2017-03-02 Thread Javier Valdes Cantallopts (DGA)
Obtuve buenos resultados pero desde el archivo plano antes de ingresarlo a R(Borrando esa fila a la mala) Sin embargo, estando en R, y utilizando el comando EA2<-EA[-1,]. Después de proceder a la eliminación de la fila, y aplicar sapply, me sigue dando el mismo error. Aunque eliminé la fila,

Re: [R] Problems outputting ggplot2 graphics to pdf

2017-03-02 Thread Hugh Morgan
Thanks for the help. My test script was changed with: p <- ggplot(df, aes(gp, y)) + geom_point() + geom_point(data = ds, aes(y = mean), colour = 'red', size = 3) print(p) And this now works. Cheers, Hugh On 02/03/17 13:42, Richard M. Heiberger wrote: You need the print() statement.

Re: [R] Problems outputting ggplot2 graphics to pdf

2017-03-02 Thread Duncan Murdoch
On 02/03/2017 8:37 AM, Hugh Morgan wrote: Hi All, I am having trouble outputting ggplot2 graphics to pdf as part of a script. It works if when I pipe the script into R or if I type the commands directly into the terminal, but not if I load it using the source(..) command. In this case the

Re: [R] Problems outputting ggplot2 graphics to pdf

2017-03-02 Thread Richard M. Heiberger
You need the print() statement. See FAQ 7.22 in file system.file("../../doc/FAQ") 7.22 Why do lattice/trellis graphics not work? == The most likely reason is that you forgot to tell R to display the graph. Lattice functions such as 'xyplot()'

[R] Problems outputting ggplot2 graphics to pdf

2017-03-02 Thread Hugh Morgan
Hi All, I am having trouble outputting ggplot2 graphics to pdf as part of a script. It works if when I pipe the script into R or if I type the commands directly into the terminal, but not if I load it using the source(..) command. In this case the outputted pdf is always size 3611, and it

Re: [R] Reading Multiple Files for Text Mining in R Using TM Package?

2017-03-02 Thread Shivi Bhatia
Thanks Pikal. This worked for me. Regards, Shivi On Thu, Mar 2, 2017 at 6:46 PM, PIKAL Petr wrote: > Well, > > > > you read documents from > > > > directory = "D:/Shivi/R Project" > > > > and you say that you have 220+ files in this directory > > > > If you move

Re: [R] Reading Multiple Files for Text Mining in R Using TM Package?

2017-03-02 Thread PIKAL Petr
Well, you read documents from directory = "D:/Shivi/R Project" and you say that you have 220+ files in this directory If you move respective files into some working directory you could use let say docs<- Corpus(DirSource(directory = "D:/Shivi/R Project/work")) without need to use setwd. But

Re: [R] Reading Multiple Files for Text Mining in R Using TM Package?

2017-03-02 Thread Shivi Bhatia
Hi Pikal, So i understand it correctly you are advising to temporarily change the working directory using the setwd syntax. Thanks, Shivi. On Thu, Mar 2, 2017 at 6:33 PM, PIKAL Petr wrote: > Hi > > Hmm, if you need only three files why not copy them to another

Re: [R] Reading Multiple Files for Text Mining in R Using TM Package?

2017-03-02 Thread PIKAL Petr
Hi Hmm, if you need only three files why not copy them to another directory and use the same command for reading them from that other directory. You probably could do this from R itself however I am almost sure that doing this task by OS is far less complicated. Cheers Petr > -Original

[R] xtable: Width of Columns

2017-03-02 Thread G . Maubach
Hi All, I have the following code in R Markdown document: ```{r, results = "asis", echo = FALSE} library(xtable) response <- as.data.frame(matrix(NA, 2, 2)) colnames(response) <- c("Anzahl", "Prozent") rownames(response) <- c("gesamte R�cksendungen (brutto) ",

[R] Reading Multiple Files for Text Mining in R Using TM Package?

2017-03-02 Thread Shivi Bhatia
Hi All , I am trying to read few csv files for some text mining assignment. I have used this command to check the # of files in the working directory: length(dir(path="D:/Shivi/R Project", all.files = TRUE)) This results to more than 220 approx. I just need 3 files from these to use for the

Re: [R] Averaging without NAs

2017-03-02 Thread Berend Hasselman
> On 2 Mar 2017, at 11:53, ch.elahe via R-help wrote: > > Hi all, > > The question seems easy but I could not find an answer for it. I have the > following column in my data frame and I want to take average of the column > excluding the number of NAs. > > $X2016.Q1 :

Re: [R] Averaging without NAs

2017-03-02 Thread Ulrik Stervbo
Hi Elahe, ?mean in particular the na.rm argument. HTH Ulrik On Thu, 2 Mar 2017 at 11:55 ch.elahe via R-help wrote: > Hi all, > > The question seems easy but I could not find an answer for it. I have the > following column in my data frame and I want to take average of

[R] Fw: Averaging without NAs

2017-03-02 Thread ch.elahe via R-help
The question seems easy but I could not find an answer for it. I have the following column in my data frame and I want to take average of the column excluding the number of NAs. $X2016.Q1 : int 47 53 75 97 NA NA 23 NA 43 NA Does anyone know how to do that? Thanks for any help Elahe

[R] Averaging without NAs

2017-03-02 Thread ch.elahe via R-help
Hi all, The question seems easy but I could not find an answer for it. I have the following column in my data frame and I want to take average of the column excluding the number of NAs. $X2016.Q1 : int 47 53 75 97 NA NA 23 NA 43 NA Does anyone know how to do that? Thanks for any help

Re: [R] What is se.fit in a glm predict list?

2017-03-02 Thread peter dalgaard
It comes from linearizing log(x) around the fitted value, derivative of log is 1/x, so aa$se.fit/aa$fit == bb$se.fit For diverged estimates, this gets dubious as the linearization only works in a neighborhood and for x not too close to the singularity of log() at zero. -pd > On 02 Mar 2017,

[R] What is se.fit in a glm predict list?

2017-03-02 Thread Patrick Connolly
I'm trying to calculate a CI for predictions from a Poisson GLM object egg.glm. Browse[2]> aa <- as.data.frame(predict(egg.glm, newdat, type = "response", se.fit = TRUE)[-3]) Browse[2]> bb <- as.data.frame(predict(egg.glm, newdat, se.fit = TRUE)[-3]) Browse[2]> aa fit se.fit 1