Тёмный

Animate Graphs in R: Make Gorgeous Animated Plots with gganimate 

Dataslice
Подписаться 15 тыс.
Просмотров 48 тыс.
50% 1

Animate Graphs in R: Make Gorgeous Animated Plots with gganimate
Katherine Goode's slides: goodekat.github.io/presentati...
gganimate Documentation: gganimate.com/reference/index...
Code: github.com/abhimotgi/dataslic...
Datanovia walkthrough (this video builds off the examples): www.datanovia.com/en/blog/gga...
Video Game Sales Dataset: www.kaggle.com/gregorut/video...
Google Play Store Apps Dataset: www.kaggle.com/lava18/google-...
0:00 Intro
0:55 Graph 1: Transition through time
6:08 Graph 2: Data gradually appears
10:25 Graph 3: Transition between states
13:20 Additional documentation

Опубликовано:

 

29 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 82   
@Sarah-lf8im
@Sarah-lf8im 2 года назад
This is so great! We really need more R youtubers like you in the world :)
@miam7401
@miam7401 3 года назад
These are by far the best videos on R I have found! You make learning how to code in R very exciting. Thanks!
@IarukaSkYouk
@IarukaSkYouk Год назад
You are an absolute master sir, every video you made is top-notch.
@hawkingswheelchair600
@hawkingswheelchair600 2 года назад
That first graph is stunningly beautiful.
@mfolozidlamini7347
@mfolozidlamini7347 3 года назад
Very helpful and useful. I was stuck for about 20 hours working on transition and animated graph
@AnAzianKid
@AnAzianKid 4 года назад
Beautiful! Thanks for sharing!
@dataslice
@dataslice 4 года назад
Thanks for watching!
@marijnderijk1843
@marijnderijk1843 2 года назад
You are a staight legend my man!! Thank you so much for the great videos, they help me a lot.
@moratzkleber8161
@moratzkleber8161 3 года назад
Good work, much appreciated!
@douglasaraujo9763
@douglasaraujo9763 4 года назад
Such a great video. I saw this on reddit and immediately clicked here, since the other video was also very useful and pedagogic. So let me congratulate you this amazing content. Thanks so much!
@dataslice
@dataslice 4 года назад
That’s great to hear!-Glad you enjoyed the videos!
@teamsebago2
@teamsebago2 3 года назад
Couldn’t agree more! Going to use this to make some amazing data analytics presentations
@RahulGupta-vw8jr
@RahulGupta-vw8jr 4 года назад
Hey man, great video. Very useful, this is exactly what I have been looking for. Cheers
@dataslice
@dataslice 4 года назад
Glad it helped, thanks for watching!
@pablodeargentina
@pablodeargentina 9 месяцев назад
Amazing work!
@GOATMENTATOR
@GOATMENTATOR 11 месяцев назад
This was useful to me - thanks a lot!!
@chrislaw42
@chrislaw42 2 года назад
Love this!
@nuraziz1669
@nuraziz1669 3 года назад
Great job mate~
@danv8718
@danv8718 5 месяцев назад
This was a fantastic tutorial, but that file name with a blank space in the middle sent shivers down my spine!
@jsbart96
@jsbart96 2 года назад
Great vid, thanks :)
@yunes7305
@yunes7305 3 года назад
Don't stop, cheers 👍
@timeprint1117
@timeprint1117 4 года назад
Exellent video, you deserve more recognition, subscribed
@dataslice
@dataslice 4 года назад
Much appreciated!
@jihedncib1422
@jihedncib1422 3 года назад
Your tutorials are really good! Subscribed.
@amanprateek9340
@amanprateek9340 3 года назад
Thanks for sharing such a great video. I am a beginner with R. Seeing this particular video really boosts my interests in the tool. Excellent content.
@paulrefalo6791
@paulrefalo6791 4 года назад
I really appreciate this video. I'm no beginner with R and ggplot2 but had never tackled animated gifs. Thank you! Excellent video and excellent content.
@dataslice
@dataslice 4 года назад
Glad to hear it! Be on the lookout for some more ggplot2 content in the near future!
@MichiganWater
@MichiganWater 4 года назад
Nice
@dataslice
@dataslice 4 года назад
Thanks for watching!
@jamesglover494
@jamesglover494 4 года назад
Great video and thanks for providing the github link, where did you get the csv file for vgsales and googleplaystore?
@dataslice
@dataslice 4 года назад
No problem, thanks for watching! Both of the datasets are from Kaggle, and I just updated the description with their links
@pigio87
@pigio87 4 года назад
Cheers mate, my next presentation will be lit
@dataslice
@dataslice 4 года назад
Glad to hear it!
@cynthiamsun
@cynthiamsun 3 года назад
I'm an amateur coder studying international relations, but your video made me so excited about R that I'm planning to use this for my capstone presentation!
@dataslice
@dataslice 3 года назад
That's awesome -- good luck!
@cynthiamsun
@cynthiamsun 3 года назад
@@dataslice Thank you for the inspiration!
@suganyaragunath9348
@suganyaragunath9348 3 года назад
This is just awesome.... Great video... Keep going...
@JeewanthaBandara
@JeewanthaBandara 2 года назад
This is an outstanding tutorial!!!
@mashtonish
@mashtonish 4 года назад
finally, I can do my own "thing over ### time" youtube channel with the second example ;)
@dataslice
@dataslice 4 года назад
Absolutely! Thanks for watching!
@muhamadbayuprakoso6016
@muhamadbayuprakoso6016 Год назад
This is the best! I would like to ask a question, why I get this problem when I run the graph.animation "There were 50 or more warnings (use warnings() to see the first 50)" ? Thank you
@Calumc12
@Calumc12 3 года назад
I cant seem to render the animation, I have installed GIFSKI and loaded the package although im getting the error "Warning message: file_renderer failed to copy frames to the destination directory "
@user-we4js8hb1n
@user-we4js8hb1n 4 месяца назад
Hi! How are you? I found the video very interesting and useful. I wanted to ask if there's a way to plot lines or curves that remain constant during the simulation. I wanted to use this tool to simulate a phase diagram and I would like to keep the demarcation curves fixed while simulating the trajectory. Is there a way to do this?
@crocodile2099
@crocodile2099 3 года назад
legend
@MarcelloNesca
@MarcelloNesca 4 года назад
i really enjoyed your reasoning on separating your ggplot with your gganimate. If i may request while you are on a visualization high, package sf for geospatial analysis please.
@dataslice
@dataslice 4 года назад
Great suggestion -- I'll check it out! Thanks for watching
@mikiallen7733
@mikiallen7733 4 месяца назад
hi sir , thanks for the effort , however how one can use the same package to generate such dynamic graphs in case of on-line (live) data polling case ? would you kindly provide an example to showcase such situation , thanks
@dvisno
@dvisno 2 года назад
Amazing tutorial!!! Does it happen to anybody, that instead of appearing in the viewing (as an animation) or saved as .gif, it saves every frame as a single .png file?
@dilinikumarasingha4953
@dilinikumarasingha4953 Год назад
yes.i don't know why
@rogerwilcoshirley2270
@rogerwilcoshirley2270 3 года назад
Wow thats for me - the fantastical frenetic bangles and baubles to adorn my vacuous presentation. Admittedly it can be quite the venue for showmanship or distracting from that annoying litany of ohs umms and interminable throat clearings if not that big pimple on the tip of the nose ;-). Seriously, thanks for the intro to this in R, wasn't previously aware just in Python, i'll be programming your examples, love learning new hands on skills as in yesss i can do R animated graphics 👍
@chipweir9731
@chipweir9731 3 года назад
Awesome video, I'm very greatful for your content! I was wondering, when my animated graph rendered, the output had the x-axis values and the x-axis label overlapping. Any idea how to fix that? Thanks!
@dataslice
@dataslice 3 года назад
Yep, one fix would be to rotate the labels on the x-axis. Try adding `+ theme(axis.text.x = element_text(angle = 90))` to to your ggplot graph. 90 is the degrees it's rotated so you can play with the number
@chipweir9731
@chipweir9731 3 года назад
@@dataslice Hmm, I got the x-axis labels to rotate but they still overlapped with the x-axis title in the outputted gif. I need to put the x-axis title lower than the x-axis labels so that they're both readable. What're your thoughts? I wish I could just attach the gif so you could see exactly what I'm talking about. Thanks for the help!
@agnelodearaujo7413
@agnelodearaujo7413 2 года назад
Is it possible to pipe this to ffmpeg or something to make a video of the animations ?
@israeljesuslopez3833
@israeljesuslopez3833 3 года назад
Hi, I got some data from a weather station I would like to plot. These are basic parameters (i.e. temp, pressure, wind speed,, dew point and heat index). I would like to plot these parameters in Y-axis and time on X-axis. However, the registers for time is awkward to me because I have the dates (22/02/2021) and times (04:00 a. m.). How can I transform these in one single column of time?
@dataslice
@dataslice 3 года назад
You could use the lubridate package (which allows you to parse date times). Then you can use a combination of the built in functions and lubridate parsing functions to convert your columns into a 'date time object'. You might want to do something like dmy_hm(paste(, )). `Paste` will combine your date and time columns and `dmy_hm` parses a date time in that format. Here's the lubridate cheat sheet with more info evoldyn.gitlab.io/evomics-2018/ref-sheets/R_lubridate.pdf
@22bears
@22bears Год назад
I have a problem, I can't see the GIF on my Plot window on RStudio?... the GIF won't get saved even tho I downloaded magick and gifski. Also, 200 pictures get saved on my project folder instead of the GIF itself… any idea how to fix this? Thanks!
@cryptoasgard8685
@cryptoasgard8685 2 года назад
if it possible to animate a function f(x) e.g., over the range of values of x? searched a lot, but couldn't find any. Can u provide some reference?
@babybopkidsrock5713
@babybopkidsrock5713 Год назад
Can animations be exported as movie or gif files?
@cdvs100
@cdvs100 3 года назад
How can I animate a matriz inside of a for cycle that it's updated step by step?
@douglasdalen
@douglasdalen 2 года назад
Great vid, but I got a little stuck... See I follow your lead all the way til you started animating your initial graph. I plotted the graph WITHOUT assigning it to variable "graph1" and it worked fine, then when I DID assign it to "graph1" I'd have it in my environment just like u did only except my plot just wouldn't show up. Consequently my animation failed on me too. Nothing to see over at the Viewer window. I tried fiddling around with it a bit but with no luck. I also adhered to your advice regarding gifski but that wouldn't solve my problem either. Any ideas on how to fix it? Edit: Tried starting fresh and assigned the super simple ggplot graph early on like you did. The plot won't show at all, so I'm guessing that's where the problem is (from graph1 = ... to geom_point() ). When I inspect "graph1" it shows the right data and everything.
@dataslice
@dataslice 2 года назад
Just to clarify, you tried saving your graph into the “graph1” variable? Did you try running the code “graph1” to get it to output to the viewer?
@douglasdalen
@douglasdalen 2 года назад
@@dataslice Just gave it another shot with the code below (same as yesterday, only now explicitly telling R to plot the graph): Graph1 % ggplot(aes(x = gdpPercap, y = lifeExp, color = continent, size = pop))+ geom_point() plot(Graph1) So this worked for me, not sure why I had to be explicit when you didn't. Imma try and fill out the rest and will update if it works out!
@douglasdalen
@douglasdalen 2 года назад
Finally got everything to work. I made a few changes (like facet wrapping by continent) and omitted some of your code (like the font family). Here's my end result: # Import required libraries library(gganimate) library(ggplot2) library(dplyr) library(gapminder) library(ggthemes) library(gifski) library(plotly) gapminder names(gapminder) # Graph1: Transitioning through time Graph1 % ggplot(aes(x = gdpPercap, y = lifeExp, color = continent, size = pop))+ geom_point(alpha = 0.7, stroke = 0)+ theme_fivethirtyeight()+ scale_size(range = c(2, 12), guide = "none")+ scale_x_log10()+ labs(title = "Life Expectancy vs GDP Per Capita by Country", x = "GDP per Capita)", y = "Life Expectancy (years)", color = "Continent", caption = "Source: Gapminder")+ theme(axis.title = element_text(), legend.text = element_text(size = 10))+ scale_color_brewer(palette = "Set2") # Explicitly plot the graph. Graph1 # Animate the graph AniGraph
@parkerfrancisgauthier7360
@parkerfrancisgauthier7360 2 года назад
Very helpful thread :)
@brazilfootball
@brazilfootball Год назад
I also needed to install package "png" (install.packages("png")) and restart R to get it to work
@shuvhamdigitalacademy3228
@shuvhamdigitalacademy3228 3 года назад
Brother which book do you read for this great plots? Love from Chapra, West Bengal, India.❤️
@dataslice
@dataslice 3 года назад
I don't follow a specific book -- mostly just reading blog posts online, but the 'R for data science' online book is very helpful!
@shuvhamdigitalacademy3228
@shuvhamdigitalacademy3228 3 года назад
@@dataslice Thank you are Love and Support.
@bisyrim1030
@bisyrim1030 11 месяцев назад
Hi there, u didn't mention your set2 palette colors so I just make my own palette
@willTryAgainTmrw
@willTryAgainTmrw 4 года назад
This video reminded me of beautiful R days. Now I am in python world, where you have to just grind to get a simple graph. Anyone knows a way to easily switch to R in a cell in jupyter? I know about R magic, but what I mean is we could just switch to R in one cell, use the variable which is already in memory as pandas DF, plot something using gg world, and then back to python in next cell. I expected things would have got better because of pyarrow, but doesnt seem so.
@dataslice
@dataslice 4 года назад
That would be nice but unfortunately I don’t think it can be done!
@vineetsansi
@vineetsansi 3 года назад
checkout package siuba in python that enables you to use piping, dplyr, i guess ggplot (not sure) as well to use it within python. Search RU-vid channel by name - Michael Chow. I think he is the one who has developed it as well.
@valerionetophdcandidate
@valerionetophdcandidate Год назад
I have problem with "color=Genre" "Error in FUN(X[[i]], ...) : object 'Genre' not found". i tried to run without it and the color of the line was only one. I think I made a mistake in something. Could you show how to change colors of the lines?
@michielvermeulen6485
@michielvermeulen6485 3 года назад
How do you get RStudio to look like dark mode?
@dataslice
@dataslice 3 года назад
You just need to go to your RStudio preferences > Appearance > Editor Theme. Mine is set to 'Dracula'
@carlosm.6348
@carlosm.6348 6 месяцев назад
Not sure if you still respond but I never understood the difference between using = and ->
@dataslice
@dataslice 6 месяцев назад
Great question In most cases (when you’re just assigning a value to a variable), they are the same There are some cases, like when using = or
@vineetsansi
@vineetsansi 3 года назад
fabulous content, its really helpful for person like me who is just starting in R after python. Thanks for sharing. And to make it lines lead by relevant names one can add below code which can also be modified to lead numbers. directlabels::geom_dl(aes(label = Genre), method = list("last.points"))
@dataslice
@dataslice 3 года назад
Great suggestion! Thanks for sharing
@stephenwilliams7494
@stephenwilliams7494 Год назад
13.04.2023 interesting BUT this is B.S....LINE 11 (graph1) is a PROBLEM....
@nnicola55555
@nnicola55555 3 года назад
Great video, thank you! How would you recommend graphing a matrix with the 50 states? Please see below for an example of how the data is organized. State CA CT MA CA NA 30 50 CT 50 NA 100 MA 20 50 NA
Далее
Bar Charts with {ggplot2}
13:38
Просмотров 4,7 тыс.
R visualisation with ggplot2 - intermediate
1:11:34
Просмотров 28 тыс.
Make an apa-style bar graph in ggplot2
22:50
Просмотров 17 тыс.
Create a Graph Animation in After Effects
12:12
Просмотров 54 тыс.
3D Maps and Data Visualization in R with rayshader
10:13
Linear Regression Summary in R
10:05
Просмотров 57 тыс.