create account

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

View this thread on: hive.blogpeakd.comecency.com
· @dapeng · (edited)
$72.36
[New Features on steemr] supports AppBase API and plots active hour diagrams!
#### 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](https://CRAN.R-project.org/package=steemr). 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')
  ```

  ![](https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmRo9HESgtkrSZnvZN9bLq74SXSgT7k7wXuZurqucyFxkv/guess-2-5-hr.png)

  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](https://cdn.steemitimages.com/DQmfHm3cpHZuXPGE873Q41C55f8A6yEi711kPXPQcVfwWMv/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](https://cdn.steemitimages.com/DQmfMFaoppHg1H1TYBqspTPbabUvwLBoqsVWFaD9K3qh9aC/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:

- https://github.com/pzhaonet/steemr/commit/8062db25a5b21708d5f1297e639bc19c2ec79b2b
- https://github.com/pzhaonet/steemr/commit/6740ddc9024609ee0dbbae7e14fd73b0e18b0402

#### GitHub Account
https://github.com/pzhaonet
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authordapeng
permlinknew-features-on-steemr-supports-appbase-api-and-plots-active-hour-diagrams
categoryutopian-io
json_metadata{"tags":["utopian-io","development","r","promo-steem","cn-programming"],"image":["https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmRo9HESgtkrSZnvZN9bLq74SXSgT7k7wXuZurqucyFxkv/guess-2-5-hr.png","https://cdn.steemitimages.com/DQmfHm3cpHZuXPGE873Q41C55f8A6yEi711kPXPQcVfwWMv/steemr-hourrose.jpg","https://cdn.steemitimages.com/DQmfMFaoppHg1H1TYBqspTPbabUvwLBoqsVWFaD9K3qh9aC/2018-06-20-004.jpg"],"links":["https://github.com/pzhaonet/steemr","https://CRAN.R-project.org/package=steemr","https://github.com/pzhaonet/steemr/commit/8062db25a5b21708d5f1297e639bc19c2ec79b2b","https://github.com/pzhaonet/steemr/commit/6740ddc9024609ee0dbbae7e14fd73b0e18b0402","https://github.com/pzhaonet"],"app":"steemit/0.1","format":"markdown"}
created2018-06-20 10:44:24
last_update2018-06-20 11:12:03
depth0
children8
last_payout2018-06-27 10:44:24
cashout_time1969-12-31 23:59:59
total_payout_value55.737 HBD
curator_payout_value16.626 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,502
author_reputation64,632,001,917,831
root_title"[New Features on steemr] supports AppBase API and plots active hour diagrams!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,475,797
net_rshares34,864,973,249,941
author_curate_reward""
vote details (49)
@justyy · (edited)
$3.29
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](https://join.utopian.io/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](https://review.utopian.io/result/3/2333223).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  , , , , , , , ,
properties (23)
authorjustyy
permlinkre-dapeng-new-features-on-steemr-supports-appbase-api-and-plots-active-hour-diagrams-20180620t135957681z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2333223","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-06-20 13:59:57
last_update2018-06-20 20:28:03
depth1
children4
last_payout2018-06-27 13:59:57
cashout_time1969-12-31 23:59:59
total_payout_value2.552 HBD
curator_payout_value0.739 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,401
author_reputation280,616,224,641,976
root_title"[New Features on steemr] supports AppBase API and plots active hour diagrams!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,497,607
net_rshares1,594,791,767,311
author_curate_reward""
vote details (9)
@dapeng ·
$0.09
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.
πŸ‘  ,
properties (23)
authordapeng
permlinkre-justyy-re-dapeng-new-features-on-steemr-supports-appbase-api-and-plots-active-hour-diagrams-20180620t143031082z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-06-20 14:30:30
last_update2018-06-20 14:30:30
depth2
children2
last_payout2018-06-27 14:30:30
cashout_time1969-12-31 23:59:59
total_payout_value0.068 HBD
curator_payout_value0.020 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length291
author_reputation64,632,001,917,831
root_title"[New Features on steemr] supports AppBase API and plots active hour diagrams!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,501,738
net_rshares43,491,758,124
author_curate_reward""
vote details (2)
@ackza · (edited)
$0.09
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 ?
πŸ‘  
properties (23)
authorackza
permlinkre-dapeng-re-justyy-re-dapeng-new-features-on-steemr-supports-appbase-api-and-plots-active-hour-diagrams-20180624t035223042z
categoryutopian-io
json_metadata{"tags":["utopian-io","promo-steem"],"users":["surfyogi"],"app":"steemit/0.1"}
created2018-06-24 03:52:21
last_update2018-06-24 03:53:03
depth3
children1
last_payout2018-07-01 03:52:21
cashout_time1969-12-31 23:59:59
total_payout_value0.071 HBD
curator_payout_value0.023 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length541
author_reputation287,729,820,746,520
root_title"[New Features on steemr] supports AppBase API and plots active hour diagrams!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,993,446
net_rshares48,283,036,627
author_curate_reward""
vote details (1)
@utopian-io ·
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 <a href="https://join.utopian.io">our website</a>.

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

<a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for Utopian Witness!</a>
properties (22)
authorutopian-io
permlink20180620t153927457z
categoryutopian-io
json_metadata{"tags":["utopian.tip"],"app":"utopian-io"}
created2018-06-20 15:39:27
last_update2018-06-20 15:39:27
depth2
children0
last_payout2018-06-27 15:39:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length406
author_reputation152,955,367,999,756
root_title"[New Features on steemr] supports AppBase API and plots active hour diagrams!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,510,719
net_rshares0
@maulidar ·
good information
πŸ‘  
properties (23)
authormaulidar
permlinkre-dapeng-new-features-on-steemr-supports-appbase-api-and-plots-active-hour-diagrams-20180620t105815399z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-06-20 10:58:24
last_update2018-06-20 10:58:24
depth1
children1
last_payout2018-06-27 10:58:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length16
author_reputation60,597,598,692,226
root_title"[New Features on steemr] supports AppBase API and plots active hour diagrams!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,477,096
net_rshares128,388,768
author_curate_reward""
vote details (1)
@ackza · (edited)
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!
properties (22)
authorackza
permlinkre-maulidar-re-dapeng-new-features-on-steemr-supports-appbase-api-and-plots-active-hour-diagrams-20180624t035359400z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-06-24 03:53:57
last_update2018-06-24 03:54:30
depth2
children0
last_payout2018-07-01 03:53:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length215
author_reputation287,729,820,746,520
root_title"[New Features on steemr] supports AppBase API and plots active hour diagrams!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,993,571
net_rshares0
@utopian-io ·
Hey @dapeng
**Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Contributing on Utopian**
Learn how to contribute on <a href='https://join.utopian.io'>our website</a> or by watching <a href='https://www.youtube.com/watch?v=8S1AtrzYY1Q'>this tutorial</a> on Youtube.

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

<a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
authorutopian-io
permlinkre-new-features-on-steemr-supports-appbase-api-and-plots-active-hour-diagrams-20180621t105508z
categoryutopian-io
json_metadata"{"app": "beem/0.19.29"}"
created2018-06-21 10:55:09
last_update2018-06-21 10:55:09
depth1
children0
last_payout2018-06-28 10:55:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length503
author_reputation152,955,367,999,756
root_title"[New Features on steemr] supports AppBase API and plots active hour diagrams!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id61,623,525
net_rshares0