Comments (5)
Facing a series of import issues, so I may leave this to someone who's more familiar with the process.
As a heads up, my editted documentation went as follows:
#' Gets the company names and tickers from a provided text
#' file made from the Russell 3000 Index list of component
#' companies.
#'
#' This function makes it easier to update your
#' companies data set. Currently, there does not seem to be a
#' good way of automatically converting a pdf to a text
#' file, or to automatically read in pdf data in R.
#'
#' In order to use this function,
I suggest that what follows be more like a list, explicitly detailing what needs to happen in order for the function to work as intended. Preferably also including links to the Russell 3000 Index PDF document that's intended to be used (I think their link doesn't change for their most recent component list.) It's also unclear to me what part of the original document I was supposed to copy and paste (I played around with the entire document, and then was a bit more discriminating in copying and pasting what was more likely to be a friendly copy and paste).
I'm also unsure if the regex is complicated enough to correctly get the desired data. The reason for this is that any contiguous copy and paste will also get extra words as noise, like "Russell Investments" or "Russell Index". I wasn't able to test this due to the above importing errors, but intuitively I feel like this noise would make it into the resulting data set. Happily, I also think that our functions are robust enough that it would be alright, but the above is, I believe, an accurate observation.
I hadn't incorporated the regex section yet, but originally it was:
#' Reads in the contents of a text file created from the
#' pdf of company names and tickers given by the Russell
#' 3000 Index. As of now, there does not seem to be a very
#' good way of converting from pdf to txt file in R, so
#' the txt file is directly copied and pasted from the pdf
#' and uses the following regex: [ ](?=[^ ]+$)
#' to create comma separated values.
Suggested Improvements
- Perhaps we wouldn't need to require that the companies.txt file be in extdata? It seems like it might be better to have the location of the companies.txt file be more flexible, though having it default to extdata might be fine.
- Perhaps it'd be a bit easier to have the function read in the raw copied and pasted text file, apply the regex itself, and then read it in as a CSV file? This doesn't seem like a step the user need to do manually.
from qmj.
Anthoney, I think you'd be better off with the documentation here, since I believe you're a lot more comfortable with this process right now. Let me know if there's any way I can help.
from qmj.
Hey Ryan, I will try to get get_companies to do that, but that is a bit tricky as I do not know how to directly modify txt files in R. The only reason for applying the regex before was so that it could be read as a csv, but there may be a way to do this in R that I haven't looked into yet.
from qmj.
Found a way to automate the process. The user still needs to copy and paste from the pdf and save from the txt file, but apart from that the function will automate the rest. Will push soon.
from qmj.
Solved by Anthoney in Commit 785.
from qmj.
Related Issues (20)
- Do we want to set up a (relatively painless) way of updating/retrieving the companies from the Russell 3000 Index? HOT 1
- Worth Repeating explanation of Russell 3000 in Prices and Financials data documentation? HOT 3
- If statement in market_data HOT 3
- Providing a function to clean temporary data HOT 1
- get_companies() regex cuts out several companies when directly copying and pasting from the Component List HOT 2
- get_info or tidyinfo is handling some data badly. Possibly incorrectly inserting anomalous data. HOT 5
- get_prices - quantmod getSymbols function changed HOT 2
- Phantom Bugs # 17 and # 18 HOT 1
- Off-hand Thought: Dealing With Missing Information HOT 3
- Observation: get_prices is slow to aggregate the various chunks of raw price data into a single data object HOT 1
- For Case Study: Reducing the Number of Companies for which we produce No Quality Score
- Issue: Financials Data Table Overfilled with Erroneous Data, Missing Some Gathered Data HOT 8
- Library qmjdata does not automatically load when loading qmj
- Impose consistency across variable names and function names
- qmjdata is not available HOT 4
- ?qmj leads to "No documentation for 'qmj' in specified packages and libraries. HOT 1
- README markdown file for github repo is badly, badly out of date HOT 4
- qmj package documentation file is out of date HOT 1
- Cleaning up tidy_prices HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qmj.