2

私は、 knitr のドキュメントgganimateからの次の指示に従って、アニメーション化されたプロットを作成しようとしています:

knitr::opts_chunk$set(message = FALSE, warning = FALSE, fig.show = "animate")
# Example from https://github.com/dgrtwo/gganimate
library(ggplot2)
library(gganimate)

# For example, suppose we wanted to create an animation similar to the Gapminder 
# world animation, using Jenny Bryan's gapminder package for the data.
library(gapminder)

theme_set(theme_bw())
p <- ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, color = continent, frame = year)) +
  geom_point() +
  scale_x_log10()

# Notice we added frame = year and saved the plot as p. 
# We then display it as an animation with the gg_animate function:
gg_animate(p)

ただし、次のエラーが表示されます。

エラー: ffmpeg コマンドが見つかりませんでした。animation.fun フック オプションを変更するか、libvpx を有効にして ffmpeg をインストールする必要があります。

hereの指示に従ってffmpegをインストールffmpeg -versionしました。コマンドラインで実行すると、次のようになります。

C:\ffmpeg\bin>ffmpeg -version
ffmpeg version 3.2.2 Copyright (c) 2000-201
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-versio
nable-nvenc --enable-avisynth --enable-bzli
 --enable-gnutls --enable-iconv --enable-li
s2b --enable-libcaca --enable-libfreetype -
le-libilbc --enable-libmodplug --enable-lib
enable-libopencore-amrwb --enable-libopenh2
pus --enable-librtmp --enable-libsnappy --e
ble-libtheora --enable-libtwolame --enable-
enable-libvorbis --enable-libvpx --enable-l
ibx264 --enable-libx265 --enable-libxavs --
ble-lzma --enable-decklink --enable-zlib
libavutil      55. 34.100 / 55. 34.100
libavcodec     57. 64.101 / 57. 64.101
libavformat    57. 56.100 / 57. 56.100
libavdevice    57.  1.100 / 57.  1.100
libavfilter     6. 65.100 /  6. 65.100
libswscale      4.  2.100 /  4.  2.100
libswresample   2.  3.100 /  2.  3.100
libpostproc    54.  1.100 / 54.  1.100

私は今どうすればいい?特に、「animation.fun フック オプションを変更する」とはどういう意味ですか?

system('ffmpeg -version')編集: 127 ステータス コードを返すことに気付きましたが、コマンド ラインからは正常に動作します。

4

1 に答える 1