Re: [R] Import selected columns from sas7bdat file

2017-08-10 Thread Utkarsh Singhal
I am able to import the whole data set into R as well, and then select the required columns. But what I am looking for is to optimize on the run time, as I only need a few columns out of 100s. Something similar to what fread (package data.table) provides while importing from a CSV file. Utkarsh

Re: [R] Creating New Variable Using Ifelse

2017-08-10 Thread PIKAL Petr
Hi see in line > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Courtney > Benjamin > Sent: Thursday, August 10, 2017 5:55 AM > To: r-help@r-project.org > Subject: [R] Creating New Variable Using Ifelse > > Hello R Help List, > > I am an R novice and

Re: [R] "Help On optim"

2017-08-10 Thread PIKAL Petr
Hi I cannot help you with optim as it is beyond my expertise, but here are some notes. Your mail is partially scrammbled due to HTML formating, please use plain text. You say that you do not get right results, how they differ from your expectation? Preferably provide some toy data as

Re: [R] Plotting log transformed predicted values from lme

2017-08-10 Thread Michael Dewey
On 10/08/2017 13:48, Alina Vodonos Zilberg wrote: Thank you Michael, Curves for each level of the factor sounds very interesting, Do you have a suggestion how to plot them? Make your newdata matrix N times longer where your factor has N levels and replicate your log(x) down one column and

[R] [R-pkgs] New Package: openSTARS

2017-08-10 Thread Mira Kattwinkel
Dear userRs I am pleased to announce the release of the new package *openSTARS* on CRAN (https://cran.r-project.org/web/packages/openSTARS/index.html). openSTARS prepares GIS data for stream network analysis using open source GRASS GIS within R. It is intended as an alternative to the

[R] Problem with the fdim package

2017-08-10 Thread Covoni, Ginevra
Hi, I’m new to R but I’m interested in using the fdim package to find the fractal dimension of a dataset. I downloaded the the package from https://cran.r-project.org/src/contrib/Archive/fdim/ and successfully installed it together with xgobi. However, when I try to run the first example, after

[R] PROC MIXED RANDOM equivalence in R nlme

2017-08-10 Thread Dennis F. Kahlbaum
I am trying to reproduce some old SAS PROC MIXED code using R and nlme. The data consists of emission readings from vehicles and fuel properties. All variables are real numbers except "study" and "vehicle", which are character. Unfortunately, since the data are confidential, I'm unable to

Re: [R] Zoo rolling window with increasing window size

2017-08-10 Thread Christofer Bogaso
Thanks Joshua, your solution is perfect. On Fri, Aug 11, 2017 at 12:11 AM, Joshua Ulrich wrote: > Replace "sum" with your custom function's name. I don't see any > reason why that wouldn't work, and the problem with my solution is not > clear in your response. > > r <-

[R] Independent Component Regression issue in R

2017-08-10 Thread pradeep manikonda
Hello, I am trying to use independent component regression inside the caret package. I ran into the error message below. All entries in the formula are dataframe column names. Any help is appreciated. icrFit <- icr(AUV ~ SPTR + NDDUEAFE + RU20INTR + LBUSTRUU + LF98TRUU + SPTRMDCP,Test,n.comp =

Re: [R] Zoo rolling window with increasing window size

2017-08-10 Thread Joshua Ulrich
Use a `width` of integer index locations. And you likely want = "right" (or rollapplyr(), as I used). R> set.seed(21) R> x <- rnorm(10) R> rs <- rollapplyr(x, seq_along(x), sum) R> cs <- cumsum(x) R> identical(rs, cs) [1] TRUE On Thu, Aug 10, 2017 at 1:28 PM, Christofer Bogaso

Re: [R] Zoo rolling window with increasing window size

2017-08-10 Thread Andrija Djurovic
Something like this? set.seed(123) y <- rnorm(20) sapply(1:length(y), function(x) sum(y[1:x])) or this, depending what is the output of your custom function lapply(1:length(y), function(x) sum(y[1:x])) On Thu, Aug 10, 2017 at 8:39 PM, Christofer Bogaso < bogaso.christo...@gmail.com> wrote:

Re: [R] EOF within quoted string

2017-08-10 Thread Adams, Jean
You might want to try some of the suggestions mentioned in this post: https://stackoverflow.com/q/17414776/2140956 Jean On Thu, Aug 10, 2017 at 7:59 AM, wrote: > Hi, > > Reading http://ssc.wisc.edu/~ahanna/20_newsgroups.csv after downloading > it using > >

[R] Zoo rolling window with increasing window size

2017-08-10 Thread Christofer Bogaso
Hi again, I am wondering there is any function for 'zoo' time series, where I can apply a user defined function rolling window basis, wherein window size is ever increasing i.e. not fixed. For example, let say I have below user defined function and a zoo time series : > library(zoo) > UDF =

Re: [R] Zoo rolling window with increasing window size

2017-08-10 Thread Christofer Bogaso
Hi Joshua, thanks for your prompt reply. However as I said, sum() function I used here just for demonstrating the problem, I have other custom function to implement, not necessarily sum() I am looking for a generic solution for above problem. Any better idea? Thanks, On Fri, Aug 11, 2017 at

Re: [R] Zoo rolling window with increasing window size

2017-08-10 Thread Joshua Ulrich
Replace "sum" with your custom function's name. I don't see any reason why that wouldn't work, and the problem with my solution is not clear in your response. r <- rollapplyr(x, seq_along(x), yourCustomFunctionGoesHere) On Thu, Aug 10, 2017 at 1:39 PM, Christofer Bogaso

[R] "Help On optim"

2017-08-10 Thread niharika singhal
Hello, I have some parameters from Mclust function. The parameters are in the form *parametersDf * * mu_1 mu_2 var_mc1var_mc2c1 c2* *2 1.357283 2.962736 0.4661540.1320129 0.5258975 0.4741025 * *21 8.357283

Re: [R] Latin hypercube sampling from a non-uniform distribution

2017-08-10 Thread S Ellison
> I think that I need to > draw a Hypercube sample for each age class (i.e., for 0, 1, 2, 3, 4, 5, 6, 7) > in a > given simulation (i.e., N = 1) and the LHS values for all age classes should > be > like the observed cumulative distribution (see attached figure). > output of randomLHS should be

Re: [R] Import selected columns from sas7bdat file

2017-08-10 Thread peter dalgaard
I had a look at this a while back and it didn't seem to be easy. The path of least resistance would seem to be to use SAS itself to create a data set with fewer columns, but of course that requires you to get access to SAS. Otherwise, I think you'd have to modify sas7bdat::read.sas7bdat to

[R] Import selected columns from sas7bdat file

2017-08-10 Thread Utkarsh Singhal
Hello everyone, I want to import data from huge sas files with 100s of columns. The good thing is that I am only interested in a few selected columns. Is there any way to do that without loading the full dataset. I have tried two functions: (1) read.sas7bdat *[from library 'sas7bdat']*, and (2)

Re: [R] Plotting log transformed predicted values from lme

2017-08-10 Thread Michael Dewey
Dear Alina If I understand you correctly you cannot just have a single predicted curve but one for each level of your factor. On 09/08/2017 16:24, Alina Vodonos Zilberg wrote: Hi, I am performing meta-regression using linear mixed-effect model with the lme() function that has two fixed

Re: [R] Import selected columns from sas7bdat file

2017-08-10 Thread Anthony Damico
hi, the sas universal viewer might be a free, non-R way to convert a sas7bdat file to non-proprietary formats, not sure if it's windows-only. those other formats should be easier to import only a subset of columns into R.. https://support.sas.com/downloads/browse.htm?fil==74 On Thu, Aug 10, 2017

Re: [R] Creating New Variable Using Ifelse

2017-08-10 Thread Courtney Benjamin
Thanks very much; with your tips, I was able to get the nested ifelse statement to work properly! Courtney Benjamin From: PIKAL Petr Sent: Thursday, August 10, 2017 5:39 AM To: Courtney Benjamin; r-help@r-project.org Subject:

Re: [R] Import selected columns from sas7bdat file

2017-08-10 Thread peter dalgaard
> On 10 Aug 2017, at 14:34 , Peter Dalgaard wrote: > > Incidentally, do teach your mailer to not send plain text. It is not much of > a problem this time, but HTML mails can become quite unreadable on the list. > Gah! A "not" remained after editing. DO send plain text, of

Re: [R] Plotting log transformed predicted values from lme

2017-08-10 Thread Alina Vodonos Zilberg
Thank you Michael, Curves for each level of the factor sounds very interesting, Do you have a suggestion how to plot them? Thank you! Alina *Alina Vodonos Zilberg* On Thu, Aug 10, 2017 at 7:39 AM, Michael Dewey wrote: > Dear Alina > > If I understand you correctly

[R] EOF within quoted string

2017-08-10 Thread Mohan.Radhakrishnan
Hi, Reading http://ssc.wisc.edu/~ahanna/20_newsgroups.csv after downloading it using data <- read.csv("20_newsgroups.csv",header=TRUE) throws this. Warning message: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : EOF within quoted string So, for example, the first

Re: [R-es] unir varios archivos .csv en una serie historica

2017-08-10 Thread Carlos Ortega
​Yo quitaría los acentos de los nombres de las carpetas (y más en la de tu usuario)... Y luego volvería a ejecutar. Gracias, Carlos.​ El 10 de agosto de 2017, 14:45, Sebastian Kruk escribió: > Hola Carlos. Probé instalar easycsv pero me dio errores: > > > > >

Re: [R-es] unir varios archivos .csv en una serie historica

2017-08-10 Thread Sebastian Kruk
Hola Carlos. Probé instalar easycsv pero me dio errores: > install.packages("easycsv") installing the source package ‘easycsv’ probando la URL 'https://cloud.r-project.org/src/contrib/easycsv_1.0.2.tar.gz' Content type 'application/x-gzip' length 8551 bytes downloaded 8551 bytes * installing

[ESS] Quit window in ess-rdired-mode

2017-08-10 Thread Igor Sosa Mayor
Hi, if I open the object view with ess-rutils-objs I would like that pressing 'q' not only kills the buffer (which is what is done, as far as I can see in the code), but that quit-window is executed. What would be the best method to implement it? Many thanks in advance. Best, -- :: Igor Sosa

Re: [ESS] Strange behaviour of ess-eval-buffer-from-beg-to-here?

2017-08-10 Thread Vitalie Spinu
I can confirm this. Last prompt is not detected for some reason. Vitalie On 9 August 2017 at 19:14, Marius Hofert wrote: > Hi, > > Here is some R code, that, when put in an R script (.R), shows some > strange behaviour (see sessionInfo() etc. below) under

Re: [ESS] Quit window in ess-rdired-mode

2017-08-10 Thread Stephen Eglen
hi Igor, I'm amazed that ess-rdired has any users, I haven't used it for years since I wrote it. can you just say in a bit more detail what you want to happen -- can you give a concrete set of steps, e.g. M-x ess-rdired e.g. which buffer do you quit from, and which one (e.g. *R dired*, *R

Re: [ESS] Quit window in ess-rdired-mode

2017-08-10 Thread Igor Sosa Mayor
Stephen Eglen writes: > hi Igor, > > I'm amazed that ess-rdired has any users, I haven't used it for years > since I wrote it. > > can you just say in a bit more detail what you want to happen -- can you > give a concrete set of steps, e.g. > > M-x ess-rdired > > e.g. which