2

I'm trying to execute the R file from gist. But I got this error: File not found: /tmp/ocpu-www-data/gist_library/ocpu_gist_zhangway_7308452/til.R -X post

My R source file is publicly here.

After I typed the HTTP request https://public.opencpu.org/ocpu/gist/zhangway/7308452/til.R -X POST on the address bar, I got the above error.

However, after I typed https://public.opencpu.org/ocpu/gist/zhangway/7308452/til.R, the browser can display the source code correctly.

Could anyone help with this? Thanks.

wei
  • 213
  • 4
  • 13

2 Answers2

1

You seem to be mixing up a couple of things. The -X POST parameter is for using curl:

curl -X POST https://public.opencpu.org/ocpu/gist/zhangway/7308452/til.R

If you don't have curl, try using the API browser tool to do the same POST request.

Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207
0

Try using source_gist from the devtools package

source_gist("https://gist.github.com/zhangway/7308452/raw/cd7c333f4b9a7ba09525d47e6e0a4a2f7acccda7/til.R")

[1] "https://gist.github.com/zhangway/7308452/raw/cd7c333f4b9a7ba09525d47e6e0a4a2f7acccda7/til.R"
SHA-1 hash of file is a1d8ff5726f836481bec69a27ae0ae777ac30213
[1] 1 3 5 7 9
sckott
  • 5,755
  • 2
  • 26
  • 42