Displaying 20 results from an estimated 7000 matches similar to: "Create New Column Inside Data Frame for Many Data Frames"
2018 Mar 05
2
Interpret List Label as Date from Quantmod getOptionChain
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 to subset down to those parts of the list that correspond to say, (expiration)
2018 Mar 05
0
Interpret List Label as Date from Quantmod getOptionChain
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.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is
2011 Mar 18
1
quantmod Some Single Letter Tickers Not getFin
Hi,
I have been learning the quantmod package over the last several days. I
went to check some of my data pulls against other sources and was
surprised to find that a few tickers that have single characters do not
successfully scrape from Google Finance using getFin(). Particularly
require(quantmod)
getFin("A")
getFin("E")
getFin("F")
getFin("G")
2012 Mar 04
1
quantmod getOptionChain Not Work
Dear R Helpers,
I am still having trouble with the getOptionChain command in quantmod. I
have the latest version of quantmod, etc. so I was under the impression
that the problem was solved with updates to the package.
If someone could let me know what I need to install in order to make this
work, I would really appreciate it.
My error message as session info are shown below. Thanks a bunch.
2011 Apr 13
1
Assign with Paste Problem
Dear R Helpers,
I am trying to change the name of an object using the assign function.
When I use paste on the new object but not the old, everything is fine:
The new object is a direct copy of the old object. When I use a paste for
both the new and the old object, however, the new object is simply the
character representation of the old object name, not the old object
itself.
The example
2017 Aug 07
1
tidyquant error downloading symbols for Index
Hi R Helpers,
I recently tried to take advantage of the ability to download all the
tickers in the S&P 500 using the functionality of tidyquant, but it threw
an error.
For summary, the set of commands that I ran was
library(tidyquant)
tq_index_options()
tq_index("SP500")
sessionInfo()
R feedback including error message and sessionInfo are provided below.
Guidance would be
2013 May 16
1
To List or Not To List
Dear R Helpers,
A few weeks ago I asked for some help on how to accomplish modifications
to data in a set of data frames. As part of that request I mentioned that
I realized that one way to accomplish my goal was to put the data frames
together in a list but that I was looking for a way to do it with data
frames and a loop because I "believe the better thing is to work df by df
for my
2023 Apr 03
4
Simple Stacking of Two Columns
Hi R-Helpers,
Sorry to bother you, but I have a simple task that I can't figure out how to do.
For example, I have some names in two columns
NamesWide<-data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly"))
and I simply want to get a single column
2018 Mar 05
2
Interpret List Label as Date from Quantmod getOptionChain
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 same with this one.
--JJS
________________________________
From: Bert Gunter <bgunter.4567 at
2023 Apr 03
1
Simple Stacking of Two Columns
Hi,
You were on the right track using stack(), but you just pass the entire data frame as a single object, not the separate columns:
> stack(NamesWide)
? values ? ind
1 ? ?Tom Name1
2 ? Dick Name1
3 ?Larry Name2
4 ?Curly Name2
Note that stack also returns the index (second column of 'ind' values), which tells you which column in the source data frame the stacked values originated
2011 Apr 12
2
Assign Character Value to Data Frame
Dear R Helpers,
I am trying to write a character value to the row of a data frame and am
running into a problem that I don't have when I do this for numeric
arguments. For example, the following works just fine:
> test<-data.frame(number=numeric(1))
> test[1,]<-.5
> test
number
1 0.5
But the following bombs out:
> hold<-data.frame(symbol=character(1))
>
2017 Aug 02
1
Looping Through QuantMod Objects
Dear R Helpers,
I have run into a problem trying to perform a number of actions on a set
of quantmod data objects through a loop and I am hoping that this is an
easy problem for someone else as opposed to very difficult for me.
The example task is to get the first three objects of the quarterly
balance sheet for a number of companies from the getFinancials object and
put them together into a
2011 Apr 24
3
If Then Trouble
Dear R Helpers,
I have another one of those problems involving a very simple step, but due
to my inexperience I can't find a way to solve it. I had a look at a
number of on-line references, but they don't speak to this problem.
I have a variable with 20 values
> table (testY2$redgroups)
1 2 3 4 5 6 7 8 9 10 11 12
13 14 15 16
2013 Apr 29
3
Function for Data Frame
Dear R Helpers,
I have about 20 data frames that I need to do a series of data scrubbing
steps to. I have the list of data frames in a list so that I can use
lapply. I am trying to build a function that will do the data scrubbing
that I need. However, I am new to functions and there is something
fundamental that I am not understanding. I use the return function at the
end of the function and
2023 Apr 04
1
Simple Stacking of Two Columns
Just to repeat:
you have
NamesWide<-data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly"))
and you want
NamesLong<-data.frame(Names=c("Tom","Dick","Larry","Curly"))
There must be something I am missing, because
NamesLong <- data.frame(Names = c(NamesWide$Name1, NamesWide$Name2))
appears to
2011 Mar 21
3
Replacing Period in String
Dear R Users,
I am working with gsub for the first time. I am trying to remove some
characters from a string. I have hit the problem where the period is the
shorthand for 'everything' in the R language when what I want to remove is
the actual periods. In the example below, I simply want to remove the
periods as I have removed the comma, but instead the complete string is
wiped out. I
2011 May 15
1
Find String Between Characters
Dear R Helpers,
I am trying to isolate a set of characters between two other characters in
a long string file. I tried some of the examples on the R help pages and
elsewhere, but I am not able to get it. Your help would be much
appreciated.
require(scrapeR)
2018 Mar 05
0
Interpret List Label as Date from Quantmod getOptionChain
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 date you have another list for both puts and calls, and inside each of
those a grid given by the
2013 May 01
3
Adding Column to Data Frames Using a Loop
Dear R Helpers,
I am trying to do calculations on multiple data frames and do not want to
create a list of them to go through each one. I know that lists have many
wonderful advantages, but I believe the better thing is to work df by df
for my particular situation. For background, I have already received some
wonderful help on how to handle some situations, such as removing columns:
2013 Apr 15
2
Remove Rows Based on Factor
Dear R Helpers,
I did a search for deleting rows based on conditions but wasn't able to
find an example that addressed the error that I am getting. I am hoping
that this is a simple syntax phenomenon that somebody else knows off the
top of their head. My apologies for not providing a reproducible example
but I think that the information given will allow someone to give me a
hint.
I want to