我该如何调用别人编写的 R 函数?

4

我正在学习R语言,发现网上有人写了一个函数。链接在这里。

https://gist.githubusercontent.com/fawda123/5086859/raw/17fd6d2adec4dbcf5ce750cbd1f3e0f4be9d8b19/nnet_plot_fun.r

现在,如果我想下载这个文件并调用这个方法,我应该在哪里下载和存储这个文件?我该如何调用这个方法?

4
尝试使用library(devtools); source_gist(5086859) - David Arenburg
2个回答

5
或者,尝试:
# install.packages("devtools")
library(devtools)
source_gist(5086859)
plot.nnet

3
# just run this line your first time to install the package
# install.packages( "downloader" )

# the downloader package makes it easy to pull code from github
library(downloader)
source_url( "https://gist.githubusercontent.com/fawda123/5086859/raw/17fd6d2adec4dbcf5ce750cbd1f3e0f4be9d8b19/nnet_plot_fun.r" , prompt = FALSE )

# there you have it
plot.nnet

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接