Making animated gifs using R [duplicate] - r

This question already has answers here:
Creating a Movie from a Series of Plots in R [closed]
(7 answers)
Closed 5 years ago.
Does anyone have any tips regarding making animated GIFs in R? I'm trying to make some time lapse map GIFs.

Repeat Question : Please see this previous StackOverflow question on creating a series of plots in R which offers a number of solutions including pointers to other useful packages such as the animation package.

Also be sure to check out the animation package

I'd recommend just generating a series of png files (which happens by default each time you run plot with the png device open). You can then combine them into an animated gif with another program such as ImageMagick.

Here is sample code of using Imagemagick (called through R) for any sequence of png's you generate.

Related

Working with Dask, Xarray, Holoviews, Bokeh Datasets

Currently have very large xarray dataset with 7 data variables, each with shape of about 60-80k (x,y) values as well as 4 years (give or take) of time data. Im working on creating a UI that will display 3 maps, 1 main map and 2 maps shown below of a selected AOI, as well as a scatter plot, a time-series curve and a scatter matrix. I wan't this all to be fully interactive meaning updating all plots simultaneously with dropdowns selecting data variables and time-sliders etc.The issue i'm currently having is with memory and render time.
I'm wondering if anyone has done anything similar to this and what the best way to go about doing something like this while being efficient with memory etc.
xrviz does interactive 2d visualisation and extraction for xarray data (based on panel/holoviz). Please try it out and help us to improve it - it is still a work in progress.

Gradient colors on axis in R

I'm currently trying to reproduce some of our graphs in R.
At the moment we use Excel to produce our graphs and 1 of the options in Excel is the use of gradient colors on the axis. I have added some pictures as an example.
My question is if a similar option is available in R (in ggplot). I can't find any useful information about this issue on the web. Thanks in advance for any response!
Greetings, Erik
!https://ibb.co/drRd8x
!https://ibb.co/jvPbvc

R/Knime: plotting multiple curves in a single plot using a R snippet inside a KNIME loop

I'm new to both knime and R so sorry if my question is a bit silly.
I've created a simple workflow to:
1) open multiple file and join them togheter with only one x axis (PPM) and several y axis (the name is created through the cycle from the file location)
2)plot each indivual x and y couple and save them to a specific folder (with a R snippet)
3)plot all the curve in a single plot (with a R snippet) with different line style
The last point unfortunately is not working and I don't know why.
Here is the link to Gdrive with the workflow and some data
https://drive.google.com/file/d/0B6XSS-i7eUt7SlRVOWZ2RElKa0k/edit?usp=sharing
Any help (and suggestion to improve the code) will be appreciated :)
Cheers,
Michele

Change R Markdown plot width [duplicate]

This question already has answers here:
Plot size and resolution with R markdown, knitr, pandoc, beamer
(2 answers)
Closed 8 years ago.
I'm starting working with R Markdown and I'm not understanding how to generate bigger plots. With today screens the plots can be much bigger.
How do I control the plots width/heigh in a Markdown report?
Thanks for the help.
See this SO answer for how to specify these details in chunks.
To set global chunk options, use opts_chunk$set(out.width='750px', dpi=200) inside your first chunk. See this page on chunk options for more.

R: Not able to save the plot [duplicate]

This question already has an answer here:
Call to plot doesn't actually produce plot
(1 answer)
Closed 9 years ago.
I am generating a plot which I am able to see in the RMarkdown output but whenever I am trying to save it, I am getting just a blank(white) image. I am just adding following two lines before and after plot
png("Output.png")
#Plot code
dev.off()
It was working. And suddenly it stopped working. Can someone help me on this??
edit
When I do it with pdf
pdf("output.pdf")
#plot code
dev.off()
I am getting error as:
There was error opening this document. This document cannot be opened because it has no pages.
Thanks.
From the comments I gather that I was right, you need to print the resulting ggplot2 object in order to show the plot, see also R FAQ 7.22.

Resources