create account

R Language - How to Use Plotly Package by devpress

View this thread on: hive.blogpeakd.comecency.com
· @devpress ·
$3.36
R Language - How to Use Plotly Package
In this post, we take a look at how to use Plotly Package in R. This is one of the powerful and popular package among the people of data science. It is used for the data visualization. It can make it easy for you to collect data and visualize it in various graphs, charts and plots. 

Plotly is a very popular package that is available for both - Python and R. You may find that it's easy to draw plots and the Enterprise edition allows even more granular control over the data and visualization. 

This package makes it easy to create the interactive charts. So for those who want to make the chart that has sliders or the option to create animated charts, that is also possible using the package. 

I have created a video to give you an overview on how to use the Plotly Package for the data science work. You should give this one a try.

---

https://www.youtube.com/watch?v=7_4Pps8bJ60

---

If you want to learn through visual means the above linked video should be of help. However if you want to try out the written instruction and to get the brief idea of the package, you may want to try out the below small tutorial. 

### Install the Package
First thing that we do most of the tutorial is install the package. So in order to install the plotly package try the command below. 

> install.packages("plotly")
> library(plotly)

It should something like this in your R studio IDE. If that is what you are using to create your project in the R language. 


![rst.png](https://images.hive.blog/DQmb6BRsr1QAouqMSfKjB7XEed1ghNvhtFwRD4J2TT61KYa/rst.png)

After you install the package the next thing is we have to come up with the data set. That is going to be helping us to plot the chart. Right, so we have this data. 

>data = data.frame(x = c(5,10,15,20,25,30,35,40), y = c(2,5,6,8,1,9,5,3))       

Now that we have library and the data, we have to also make sure to draw the plots like say line plots using the Plotly package. 

>figure_1 <- plot_ly(data, x = ~x, y = ~y, type = 'scatter', mode = 'lines')
>figure_1

The plot seems like easy to spot in the plot tab of the RStudio which would look like something below. I am sure you would love the plot output. 


![line.png](https://images.hive.blog/DQmeNrF3185UVGvrS43YakN18JopqBhANmiQwWcwE5qQn58/line.png)

That's it. You now have basic plots through the plotly. You can create various types of the charts in the R. And the data creation and also passing to the plot functions is also easy and can be done. I personally prefer the Plotly and ggplot2 package. 

I have been creating a lot of content on the data visualization each week. And posting them during the Friday morning (IST) time. You may want to create notification for the channel if you want to get the content in this topic. 

Now upto next 6 months, I am going to be releasing the plots and the charts specific tutorials each week. So it'd be cool to cover some of that in the channel. Apart from that I am also going to cover the Power BI related tutorials in upcoming chapters. 

I have plans to do the Python based visualization too. But considering the 2023 given to entire R based tutorials, I suppose 2024 I'd be getting the Python based visualization. It'd take a bit more time to make the content so hopefully I get enough power by the lord to work on this. 

I hope that you are enjoying some of my R language and data science tutorials. I hope that some of my coverage on this topic would be helpful to you.

If you happen to like this content, do give me feedback over there and that would help me improve my efforts in near future.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 196 others
👎  
properties (23)
authordevpress
permlinkr-language-how-to-use-plotly-package
categoryhive-122108
json_metadata{"tags":["stem","cent","archon","vyb","programming"],"image":["https://img.youtube.com/vi/7_4Pps8bJ60/0.jpg","https://images.hive.blog/DQmb6BRsr1QAouqMSfKjB7XEed1ghNvhtFwRD4J2TT61KYa/rst.png","https://images.hive.blog/DQmeNrF3185UVGvrS43YakN18JopqBhANmiQwWcwE5qQn58/line.png"],"links":["https://www.youtube.com/watch?v=7_4Pps8bJ60"],"app":"hiveblog/0.1","format":"markdown"}
created2022-12-02 12:16:21
last_update2022-12-02 12:16:21
depth0
children4
last_payout2022-12-09 12:16:21
cashout_time1969-12-31 23:59:59
total_payout_value1.702 HBD
curator_payout_value1.659 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,570
author_reputation55,061,325,071,240
root_title"R Language - How to Use Plotly Package"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,787,047
net_rshares7,233,780,605,747
author_curate_reward""
vote details (261)
@curation-cartel ·
![1UP-PIZZA.png](https://files.peakd.com/file/peakd-hive/curation-cartel/23xediR4hotaNsS5pUJrmYVg3YGeTLpui41uCij2jhUDZ4uFT84zoGJf8a8VnfELXLJgt.png) |  <div class="phishy"><u><h4>You have received a __1UP__ from @gwajnberg!</h4></u></div> The @oneup-cartel will soon upvote you with:<hr> __@stem-curator, @vyb-curator, @cent-curator__ <hr>_And they will bring !PIZZA 🍕._
-|-

<sup>[Learn more](https://peakd.com/hive-102223/@flauwy/the-curation-cartel-1up-trigger-smart-voting-mana-and-high-delegation-returns-for-14-different-tribes) about our delegation service to earn daily rewards. Join the Cartel on [Discord](https://discord.gg/mvtAneE3Ca).</sup>
properties (22)
authorcuration-cartel
permlinkre-r-language-how-to-use-plotly-package-20221202t173349z
categoryhive-122108
json_metadata"{"app": "beem/0.24.26"}"
created2022-12-02 17:33:51
last_update2022-12-02 17:33:51
depth1
children0
last_payout2022-12-09 17:33:51
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_length652
author_reputation1,123,882,653,763
root_title"R Language - How to Use Plotly Package"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,794,807
net_rshares0
@gwajnberg ·
I think that plotly is also available in other programming languages, it is very cool
!1UP
<a href="https://discord.gg/zQrvxAu7mu">
<img src="https://files.peakd.com/file/peakd-hive/thecuriousfool/23wCNFDyCLJu1v77TTg2MYKkd7XWkgF9fhiLujTDAaLaUz7H4AaQkDentB5UMVS8FcrVs.png"></a>
properties (22)
authorgwajnberg
permlinkrm9y3e
categoryhive-122108
json_metadata{"tags":["stem"],"image":["https://files.peakd.com/file/peakd-hive/thecuriousfool/23wCNFDyCLJu1v77TTg2MYKkd7XWkgF9fhiLujTDAaLaUz7H4AaQkDentB5UMVS8FcrVs.png"],"links":["https://discord.gg/zQrvxAu7mu"],"app":"stemgeeks/0.1","canonical_url":"https://stemgeeks.net/@gwajnberg/rm9y3e"}
created2022-12-02 17:33:15
last_update2022-12-02 17:33:15
depth1
children0
last_payout2022-12-09 17:33:15
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_length276
author_reputation368,826,660,360,924
root_title"R Language - How to Use Plotly Package"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,794,782
net_rshares0
@pizzabot ·
<center>🍕 PIZZA !


I gifted <strong>$PIZZA</strong> slices here:
@curation-cartel<sub>(1/20)</sub> tipped @devpress (x1)


<sub>Send $PIZZA tips in <a href="https://discord.gg/hivepizza">Discord</a> via tip.cc!</sub></center>
properties (22)
authorpizzabot
permlinkre-r-language-how-to-use-plotly-package-20221202t173425z
categoryhive-122108
json_metadata"{"app": "beem/0.24.19"}"
created2022-12-02 17:34:27
last_update2022-12-02 17:34:27
depth1
children0
last_payout2022-12-09 17:34: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_length226
author_reputation7,514,433,425,255
root_title"R Language - How to Use Plotly Package"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,794,834
net_rshares0
@stemsocial ·
re-devpress-r-language-how-to-use-plotly-package-20221203t015716149z
<div class='text-justify'> <div class='pull-left'>
 <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div>

Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.&nbsp;<br />&nbsp;<br />
</div>
properties (22)
authorstemsocial
permlinkre-devpress-r-language-how-to-use-plotly-package-20221203t015716149z
categoryhive-122108
json_metadata{"app":"STEMsocial"}
created2022-12-03 01:57:15
last_update2022-12-03 01:57:15
depth1
children0
last_payout2022-12-10 01:57:15
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_length565
author_reputation22,915,413,852,146
root_title"R Language - How to Use Plotly Package"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,805,806
net_rshares0