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 feedba
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
Bruce,
Do you think that you could post the final solution to the problem? That
way it would be stored with this thread and the next person who has the
same problem would be able to locate the FINAL solution.
--JJS
On Mon, April 17, 2017 12:47 pm, BR_email wrote:
> TO _ALL_:
> THANK YOU. THANK
Hello R Helpers,
I am building a random forest using the cforest method in the party
package. I then want to have a look at the characteristics of a few of
the trees. I get the output for one of the trees by executing
pt <- party:::prettytree(cforest@ensemble[[3]],
names(cforest@data@get("input
Dear R Helpers,
My regex skills are beginner to intermediate and banging around the web
has not resulted in a solution to the problem below so I hope that one of
you who has mad skills can help me out.
I want to extract the stock ticker--AMT-- out of the string
American Tower Corporation (REIT)Â
> node <- xpathSApply(doc, "//link[@rel='alternate']", xmlAttrs)
>> node
>
> [,1]
>
> rel
> "alternate"
>
> type
> "application/atom+xml"
>
> title
> "ATOM"
>
> href
> "/cgi-bin/browse-edgar?ac
quot; )
>
> From there you can extract the number. Here's one way to do it.
>
> strsplit(strsplit(unlist(node)[[5]], "CIK=")[[1]][2], "&type")[[1]][1]
>
> Jeff
>
>
> On Wed, Aug 14, 2013 at 1:34 PM, Sparks, John James
> wrote:
>
>>
Dear R Helpers,
I would like to pull the CIK number from the web page
http://www.sec.gov/cgi-bin/browse-edgar?CIK=MSFT&Find=Search&owner=exclude&action=getcompany
If you put this web page into your browser you will see the CIK number in
red on the left side of the page near the top.
When I try
Dear R Helpers,
I am stuck on some syntax and I thought that I was following one of the
examples that I found out there quite faithfully.
I just want to know how to do a t test on a single mean for whether or not
it is greater than a specific value. So I am using the data set sleep and
I want to
Dear R Helpers,
I have a fairly complicated list of data frames. To give you an idea of
the structure, the top of the str output is shown below.
How do I refer to the data.frame name for each data.frame in the list?
That is, how can I pull the terms Advertising2007, AirFreightDelivery2007,
Appa
Dear R Helpers,
I need help with a slightly unusual situation in which I am trying to
select some columns from a data frame. I know how to use the subset
statement with column names as in:
x=as.data.frame(matrix(c(1,2,3,
1,2,3,
1,2,2,
1,2,2,
1,1,1),ncol=3,byrow=T
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
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
Dear R Helpers,
I am re-phrasing a question that I put forth earlier today due to some
particulars in the solution that I am searching for. Many thanks to those
who answered the previous post and to any who would be willing to answer
this one.
I have a set of data frames. I need to perform some
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 somethin
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 reproducibl
Dear R Helpers,
I have a large number of data frames and I need to create a new column
inside each data frame. Because there is a large number, I need to "loop"
through this, but I don't know the syntax of assigning a new column name
dynamically.
Below is a simple example of what I need to do.
Dear R Helpers,
I am getting an error message from the try function that I don't
understand so I am hoping that someone can help.
I am scraping from web pages, but sometimes they disappear. When that
happens I need to control for it with some sort of function.
This web page is parsed without a
; }
>>
>> if(missing(Exp))
>> optURL <-
>> paste(paste("http://finance.yahoo.com/q/op?s",Symbols,sep="=";),"Options",sep="+")
>> else
>> optURL <-
>> paste(paste("http://finance.yahoo.com/q/op?s="
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
Dear R Helpers,
I have a list that contains a number of objects, each of them financial
statement data from quantmod (although I don't think that knowledge of
quantmod is necessary to help with this problem).
> str(listfinobj)
chr [1:4815] "A.f" "AA.f" "AACC.f" "AAME.f" "AAN.f" "AAON.f" "AAP.f"
Dear R Helpers,
I was looking at the email help threads in trying to find a calculation in
R of Thiel's uncertainty coefficient. One of the writers offered to send
the function in custom code to the inquirer. Can I get a copy of that
code, or does anyone know if the calculation is now available
Dear R Helpers,
I am having trouble combining some pieces of programming that work fine
individually, but fall down when I try to get them to work together.
The end goal is to take a data frame, and if any of the variables has more
than 10 values, then use cut2 to reduce the number of (effective)
Dear R Helpers,
First, I apologize for asking for help on the first of my topics. I have
been looking at the posts and pages for apply, tapply etc, and I know that
the solution to this must be ridiculously easy, but I just can't seem to
get my brain around it. If I want to produce a set of table
Dear R Helpers,
First, I apologize for asking for help on the first of my topics. I have
been looking at the posts and pages for apply, tapply etc, and I know that
the solution to this must be ridiculously easy, but I just can't seem to
get my brain around it. If I want to produce a set of table
, 2011 7:57 pm, jim holtman wrote:
> Is this what you want:
>
>> mmm<-"http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=320193&owner=exclude&count=40";
>> num <- sub("^.*CIK=([0-9]+).*", "\\1", mmm)
>> num
> [1]
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)
mmm<-scrape(url="http://www.sec.gov/c
Dear R Helpers,
I am trying to find a way to identify all the objects in my environment
that are all caps and then end with .f. I can do the all caps part pretty
easily, but I have tried a number of variations on the \ and can't get a
recognition of that operator. As a simple example
A.f<-"foo1
Dear R Helpers,
I am trying to adjust the attribute of an R object pulled from quantmod.
Since I want to do this for many such objects, I was trying to make the
adjustment programmatic. Unfortunately, I am having a huge amount of
trouble using attr in combination with paste (and perhaps get, and
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
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 sim
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
10.5
But t
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 remo
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(quan
Hi,
I have one of those questions that I suspect is very simple, but hard to
classify, so I have been searching for quite some time and am not able to
find it.
If I have a data frame and I want to change all the values of one of the
columns to blanks, what is the syntax? I tried a few different
Dear All,
I have come across a very surprising result as I have started to learn how
to use R to pull data from the web for analysis.
I am trying to isolate that table headers for the quarterly income
statement (qtrinc) that I pulled from Google finance. I executed the
following commands after i
Dear All,
I have imported an HTML document to R (called tables) and wish to select
certain pieces of it for processing. The first few lines of the object
appear as follows:
> tables
[[1]]
In Millions of USD (except for per share items)
3 months ending 2010-06-30
3 months ending 2010
37 matches
Mail list logo