[New Features on steemr] supports AppBase API and plots active hour diagrams!

in #utopian-io6 years ago (edited)

Repo

https://github.com/pzhaonet/steemr

'steemr' is an open source R package for playing with Steem data in R environment. It is used to download, post process, analyze, and visualize Steem data on the basis of the powerful statistic power of R.

New Features

What features did I add?

  • I have submitted steemr to CRAN and now it is available. Users can install steemr directly from CRAN:

    install.packages('steemr)
    
  • Users can use method = 'appbase_api' to download Steem data from AppBase API:

    posts <- post_id('dapeng', method = 'appbase_api')
    
  • A new powerful function hourrose() was added to plot a diagram of an ID's active hours in a day based on the post or comment time.

    hourrose(my_df = posts, col_time = 'created')
    

    This 24-hour clock shows the active hours of an ID. Users can even choose whether to display another parameter, such as vote number on these posts. Here is a screenshot of plotting such a image in RStudio IDE.

    steemr-hourrose.jpg

    More feature of this function can be found in the help documentation:

help(hourrose)
  • Although SteemData is gone, I still added the query method from steemdata.com. I wish SteemData could come back some day. I love it.
  • The documentation has been improved.
  • Some minor literal chagnes.

How did I implement them?

I added the AppBase API option to the id_info() function and post_id() function with the support from ' kharoof/steemR' repo.

I added the queries for SteemData with the R mongolite package and added the options that users can choose the server.

I added a new function hourrose() originated from a windrose plotting method but tailored for Steem data.

2018-06-20-004.jpg

All these changes can be found in 'R/steemr.R'.

Links to relevant lines in the code on GitHub can be found mainly in my latest commits:

GitHub Account

https://github.com/pzhaonet

Sort:  

Thank you for your contribution.

  • I will not suggest adding code that use steemdata because it just doesn't work, I don't think dead code should be in the code repro for any reasons.
  • While you start building the library, I would suggest you should also start adding unit tests, which gives the confidence while you make changes.
  • the code is not very much commented and I have seen the commented-out code as well.
  • You shouldn't set default parameters e.g. something like id='dapeng', if the id is not given, you should expect the function to throw exception
  • the database URI should be defined as a constant but should not appear in your code base more than once.
  • Your hourrose method, as you said you make some changes from the original copy, it will be better to provide the reference to the original code. And BTW, there are more than 400 lines of code for this function, which is un-maintainable.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

These are very useful suggestions for a non-professional programmer like me. Many thanks.

Regarding SteemData, I wish it could come back someday, as it is open source and anyone might take it over. I would leave the option there (perhaps commented out) for future use. It is just ten lines.

Ask @surfyogi if he can bring back a WORKING version of steemdata or something like it.

hey nice post! I have to admit I can'[t understand it but when i saw this post in a list of non technical posts on #promo-steem trending i realized i must upvote AND resteem this post to help promotoe technical steem posts. They help stimulate interest in programming which we all need to learn more about, or at least data

i mean what is an R environment? What is CRAN? What are those crazy maps u are showing that look like radar? Whats going on ?

Thank you very much for your kind support!

R is a programming language and free software environment for statistical computing and graphics. CRAN is the abbreviation for Comprehensive R Archive Network. More details can be found on Wikipedia. The radar map is a 24-hour clock, showing the active hours of a Steemian: the greater the radius is, the more posts the steemian has.

A tutorial to steemr might be useful and helpful. I will write one as soon as I finish the development of the main functions in steemr.

Hey @justyy
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.

Contributing on Utopian
Learn how to contribute on our website.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

PLEASE try to leave comments that are a little bit longer to simply prove you read the post and to prove that you are not a bot! That way we dont confuse you with the many spam bots that leave short replies, thanks!

Hey @dapeng
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.034
BTC 63900.40
ETH 3140.82
USDT 1.00
SBD 3.98