Hi R Helpers,
Is it possible to interpret the top level of the list as a date after
downloading all the option chain data for a ticker?
For example, after I run
aapl_total<-getOptionChain("AAPL", NULL)
the top descriptor of the lists is a date (Mar.09.2018, Mar.23.2018, etc.).
So if want
Looks great. Thanks!
--JJS
From: Dirk Eddelbuettel on behalf of Dirk
Eddelbuettel
Sent: Sunday, March 4, 2018 9:41 PM
To: Sparks, John
Cc: Dirk Eddelbuettel; r-help@r-project.org
Subject: Re: [R] Interpret List Label as Date from Quantmod getOptionChain
On
On 5 March 2018 at 03:13, Sparks, John wrote:
| library(quantmod)
| #in fairness, I did not include this last time and my example was therefore
not reproducible. Apologies to Bert and everyone else #for not following the
posting guidelines.
| aapl_total<-getOptionChain("AAPL", NULL)>
|
| How c
Hi Dirk,
Thanks for your note.
I understand that expiry dates are the dates that the option expires, so I
don't think that I am confused about that (although the upper limits of one's
confusion is difficult to accurately estimate).
My lack of clarity come from treating those "dates" as act
On 5 March 2018 at 02:46, Sparks, John wrote:
| I agree that they look like dates, I don't know how to determine if they are
actually dates.
You know options but you are confused about maturity dates, i.e. expiry?
In information in that list (ie along the date dimension) is the expiry; at
each
Package? Quantmod. In the subject line.
I agree that they look like dates, I don't know how to determine if they are
actually dates.
Josh Ulrich usually answers questions along these lines very informatively and
quickly. One reasonable course of action is to wait to see if he does the
sa
Package?
The **names** of the top levels of your lists, "Mar.09.2018", "Mar.23.2018"
certainly look like dates and if they are -- I have no idea what
package/context is -- they certainly could be formatted as such. See e.g.
"date-time" . There are also several package that provide date tools.
Che
Hi R Helpers,
Is it possible to interpret the top level of the list as a date after
downloading all the option chain data for a ticker?
For example, after I run
aapl_total<-getOptionChain("AAPL", NULL)
the top descriptor of the lists is a date (Mar.09.2018, Mar.23.2018, etc.).
So if want
On Sun, Mar 4, 2018 at 3:23 PM, Duncan Murdoch wrote:
> On 04/03/2018 5:54 PM, Henrik Bengtsson wrote:
>>
>> The following helps identify when .GlobalEnv$.Random.seed has changed:
>>
>> rng_tracker <- local({
>>last <- .GlobalEnv$.Random.seed
>>function(...) {
>> curr <- .GlobalEnv$.R
On Sun, Mar 4, 2018 at 10:18 AM, Paul Gilbert wrote:
> On Mon, Feb 26, 2018 at 3:25 PM, Gary Black
> wrote:
>
> (Sorry to be a bit slow responding.)
>
> You have not supplied a complete example, which would be good in this case
> because what you are suggesting could be a serious bug in R or a pa
On 04/03/2018 5:54 PM, Henrik Bengtsson wrote:
The following helps identify when .GlobalEnv$.Random.seed has changed:
rng_tracker <- local({
last <- .GlobalEnv$.Random.seed
function(...) {
curr <- .GlobalEnv$.Random.seed
if (!identical(curr, last)) {
warning(".Random.seed
The following helps identify when .GlobalEnv$.Random.seed has changed:
rng_tracker <- local({
last <- .GlobalEnv$.Random.seed
function(...) {
curr <- .GlobalEnv$.Random.seed
if (!identical(curr, last)) {
warning(".Random.seed changed")
last <<- curr
}
TRUE
}
})
a
Thank you, everybody, who replied! I appreciate your valuable advise! I will
move the location of the set.seed() command to after all packages have been
installed and loaded.
Best regards,
Gary
Sent from my iPad
> On Mar 4, 2018, at 12:18 PM, Paul Gilbert wrote:
>
> On Mon, Feb 26, 2018 at
... and note also:
> f <- function(...)list(...) <- list(...) ## you cannot have list(...) on
LHS
> f(x=1,y="a")
Error in list(...) <- list(...) : '...' used in an incorrect context
In addition to Eric's suggestions, maybe something like this construction
is useful:
Lapply_me = function(X = X
On Mon, Feb 26, 2018 at 3:25 PM, Gary Black
wrote:
(Sorry to be a bit slow responding.)
You have not supplied a complete example, which would be good in this
case because what you are suggesting could be a serious bug in R or a
package. Serious journals require reproducibility these days. For
Thanks Eric, this is working.
On Sun, Mar 4, 2018 at 11:28 PM, Eric Berger wrote:
> The reason that it works for Apply_MC=TRUE is that in that case you call
> mclapply(X,FUN,...) and
> the mclapply() function strips off the mc.cores argument from the "..." list
> before calling FUN, so FUN is bei
The reason that it works for Apply_MC=TRUE is that in that case you call
mclapply(X,FUN,...) and
the mclapply() function strips off the mc.cores argument from the "..."
list before calling FUN, so FUN is being called with zero arguments,
exactly as it is declared.
A quick workaround is to change t
> On Mar 4, 2018, at 7:37 AM, Bert Gunter wrote:
>
> Statistics questions are largely off topic on this list, although they do
> sometimes intersect R programming issues, which are on topic. However, I
> believe a statistics list like stats.stackexchange.com might be more
> suitable for your qu
Below is my full implementation (tried to make it simple as for demonstration)
Lapply_me = function(X = X, FUN = FUN, Apply_MC = FALSE, ...) {
if (Apply_MC) {
return(mclapply(X, FUN, ...))
} else {
if (any(names(list(...)) == 'mc.cores')) {
myList = list(...)[!names(list(...)) %in% 'mc.cores']
}
r
That's fine. The issue is how you called Lapply_me(). What did you pass as
the argument to FUN?
And if you did not pass anything that how is FUN declared?
You have not shown that in your email.
On Sun, Mar 4, 2018 at 7:11 PM, Christofer Bogaso <
bogaso.christo...@gmail.com> wrote:
> My modifie
My modified function looks below :
Lapply_me = function(X = X, FUN = FUN, Apply_MC = FALSE, ...) {
if (Apply_MC) {
return(mclapply(X, FUN, ...))
} else {
if (any(names(list(...)) == 'mc.cores')) {
myList = list(...)[!names(list(...)) %in% 'mc.cores']
}
return(lapply(X, FUN, myList))
}
}
Here, I a
Hi Christofer,
Before you made the change that I suggested, your program was stopping at
the statement: list(...) = list(..) .etc
This means that it never tried to execute the statement:
return(lapply(X,FUN,...))
Now that you have made the change, it gets past the first statement and
tries to execu
@Eric - with this approach I am getting below error :
Error in FUN(X[[i]], ...) : unused argument (list())
On Sun, Mar 4, 2018 at 10:18 PM, Eric Berger wrote:
> Hi Christofer,
> You cannot assign to list(...). You can do the following
>
> myList <- list(...)[!names(list(...)) %in% 'mc.cores']
>
Hi Christofer,
You cannot assign to list(...). You can do the following
myList <- list(...)[!names(list(...)) %in% 'mc.cores']
HTH,
Eric
On Sun, Mar 4, 2018 at 6:38 PM, Christofer Bogaso <
bogaso.christo...@gmail.com> wrote:
> Hi,
>
> As an example, I want to create below kind of custom Functio
Hi,
As an example, I want to create below kind of custom Function which
either be mclapply pr lapply
Lapply_me = function(X = X, FUN = FUN, ..., Apply_MC = FALSE) {
if (Apply_MC) {
return(mclapply(X, FUN, ...))
} else {
if (any(names(list(...)) == 'mc.cores')) {
list(...) = list(...)[!names(list(
On 04/03/2018 10:39 AM, Christofer Bogaso wrote:
Hi again,
I am looking for some way to alternately use 2 related functions,
based on some ifelse() condition.
For example, I have 2 functions mclapply() and lapply()
However, mclapply() function has one extra parameter 'mc.cores' which
lapply do
Hi again,
I am looking for some way to alternately use 2 related functions,
based on some ifelse() condition.
For example, I have 2 functions mclapply() and lapply()
However, mclapply() function has one extra parameter 'mc.cores' which
lapply doesnt not have.
I know when mc.cores = 1, these 2 f
Statistics questions are largely off topic on this list, although they do
sometimes intersect R programming issues, which are on topic. However, I
believe a statistics list like stats.stackexchange.com might be more
suitable for your query.
Cheers,
Bert
Bert Gunter
"The trouble with having an
d is the number of observed variables (d = 3 in this example). n is the
number of observations.
2018-03-04 11:30 GMT+01:00 Eric Berger :
> What is 'd'? What is 'n'?
>
>
> On Sun, Mar 4, 2018 at 12:14 PM, Christien Kerbert <
> christienkerb...@gmail.com> wrote:
>
>> Thanks for your reply.
>>
>> I
Dear R users,
I am using the *mgcv package* to model the ratio of hectares of damaged
culture by wild boar in french departments according to some
environmental covariates. I used a _Beta distribution_ for the response.
For each department, we estimated the damaged in 3 different culture
typ
Hard to help you if you don't provide a reproducible example.
On Sun, Mar 4, 2018 at 1:05 PM, Christien Kerbert <
christienkerb...@gmail.com> wrote:
> d is the number of observed variables (d = 3 in this example). n is the
> number of observations.
>
> 2018-03-04 11:30 GMT+01:00 Eric Berger :
>
>
What is 'd'? What is 'n'?
On Sun, Mar 4, 2018 at 12:14 PM, Christien Kerbert <
christienkerb...@gmail.com> wrote:
> Thanks for your reply.
>
> I use mvrnorm from the *MASS* package and lmrob from the *robustbase*
> package.
>
> To further explain my data generating process, the idea is as follow
Thanks for your reply.
I use mvrnorm from the *MASS* package and lmrob from the *robustbase*
package.
To further explain my data generating process, the idea is as follows. The
explanatory variables are generated my a multivariate normal distribution
where the covariance matrix of the variables i
33 matches
Mail list logo