search for: jspark4

Displaying 20 results from an estimated 33 matches for "jspark4".

Did you mean: asparks
2023 Apr 03
1
Simple Stacking of Two Columns
...quot; ?"Larry" "Curly" returns a vector, or: > stack(NamesWide)[, 1, drop = FALSE] ? values 1 ? ?Tom 2 ? Dick 3 ?Larry 4 ?Curly which returns a data frame with a single column named 'values'. Regards, Marc Schwartz On April 3, 2023 at 11:08:59 AM, Sparks, John (jspark4 at uic.edu (mailto:jspark4 at uic.edu)) wrote: > 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"),Name...
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
0
Interpret List Label as Date from Quantmod getOptionChain
...package that provide date tools. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sun, Mar 4, 2018 at 6:28 PM, Sparks, John <jspark4 at uic.edu> wrote: > 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) > &...
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)
2023 Apr 04
1
Simple Stacking of Two Columns
...Tom Name1 2 Dick Name1 3 Larry Name2 4 Curly Name2 If there were multiple columns, you might do > stack(NamesWide[,c("Name1","Name2")])$values [1] "Tom" "Dick" "Larry" "Curly" On Tue, 4 Apr 2023 at 03:09, Sparks, John <jspark4 at uic.edu> wrote: > 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&quot...
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)) >
2018 Mar 05
2
Interpret List Label as Date from Quantmod getOptionChain
...package that provide date tools. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sun, Mar 4, 2018 at 6:28 PM, Sparks, John <jspark4 at uic.edu<mailto:jspark4 at uic.edu>> wrote: 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...
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 14
3
Create New Column Inside Data Frame for Many Data Frames
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. Assume that I have to do this for all 26 letters and you should see the form of the
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
...26: > unname(unlist(NamesWide)) Why not: NamesWide <- data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly")) NamesLong <- data.frame(Names=with(NamesWide, c(Name1, Name2))) > > On April 3, 2023 8:08:59 AM PDT, "Sparks, John" <jspark4 at uic.edu> wrote: >> 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"),Na...
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)
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
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")
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
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.
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
2011 May 24
2
Apply or Tapply to Build Set of Tables
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 tables for all the variables in my data, how can I do that without having to type them into the table
2013 May 17
2
Selecting A List of Columns
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)) all.cols<-colnames(x) to.keep<-all.cols[1:2] Kept<-subset(x,select=to.keep) Kept
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