Giter VIP home page Giter VIP logo

Comments (5)

rynkwn avatar rynkwn commented on September 17, 2024

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

  1. 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.
  2. 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.

rynkwn avatar rynkwn commented on September 17, 2024

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.

anttsou avatar anttsou commented on September 17, 2024

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.

anttsou avatar anttsou commented on September 17, 2024

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.

rynkwn avatar rynkwn commented on September 17, 2024

Solved by Anthoney in Commit 785.

from qmj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.