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 <- rollapplyr(x, seq_along(x)
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:
>
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
wrote:
> Hi Joshua, than
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 12:0
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
wrote:
> Hi agai
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 = func
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
ArcGIS
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 = 6)
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 provi
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
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
>
> data <- read.csv("20_newsgroups.csv",h
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
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 S
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 illustrati
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 lin
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 you cannot just have a si
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: Creating New Variable U
> 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 course.
--
Peter D
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=&cat=74
On Thu, Aug 10, 2
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 drop
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 effe
> 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 a
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 9.96
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) r
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
25 matches
Mail list logo