동료가 수천 개의 S 함수와 포트란 서브 루틴을 R로 이식했습니다. 네이티브 R 함수는 5 개의 .RData 파일에 포함되어 있으며 Fortran 서브 루틴은 2 .dll 파일. 런타임시 ioslides_presentation에서 dyn.load를 사용하는 중 오류 : 반짝임
이 파일은 칠판에 업로드하고---
title: "dyn.load and Shiny"
subtitle: "Why can't we all just get along?"
author: "Jason Freels"
output:
ioslides_presentation:
widescreen: true
runtime: shiny
---
```{r echo=FALSE,message=FALSE}
setInternet2(TRUE)
download.file("http://afit.blackboard.com/bbcswebdav/users/jfreels/DFORRT.dll",
paste(c(getwd(),"/DFORRT.dll"), collapse=""),
method="internal",mode="ab")
dyn.load("DFORRT.dll")
download.file("http://afit.blackboard.com/bbcswebdav/users/jfreels/SPLIDA.dll",
paste(c(getwd(),"/SPLIDA.dll"), collapse=""),
method="internal",mode="ab")
dyn.load("SPLIDA.dll")
a<-url("https://afit.blackboard.com/bbcswebdav/users/jfreels/echapters.RData" ); load(a)
b<-url("https://afit.blackboard.com/bbcswebdav/users/jfreels/RSplida Codes.RData"); load(b)
c<-url("https://afit.blackboard.com/bbcswebdav/users/jfreels/RSplidaData.RData" ); load(c)
d<-url("https://afit.blackboard.com/bbcswebdav/users/jfreels/RSplidaUser.RData" ); load(d)
e<-url("https://afit.blackboard.com/bbcswebdav/users/jfreels/Text data.RData" ); load(e)
```
이 코드는 pdf_document, html_document 및 ioslides_presentation 인수에 대해 완벽하게 작동하고 내가 runtime: shiny
를 추가 할 때 내가 성공적으로 할 수있는 사용 R에로드 내 문서 더 휴대용 만들려면 RStudio 뷰어에서 프레젠테이션의 미리보기를 생성합니다. 내가 shinyapps.io하는 프레젠테이션을 배포 할 때 그러나, 나는 오류 얻을 : 이전
"기능 setInternet2를 찾을 수 없습니다"를, 나는 로컬
for (i in 1:2){ dyn.load(list.files(getwd())[grep("dll",strsplit(list.files(getwd()),"\\W+"))][i]) }
로를 사용하여 .dll 파일을로드하려고 이 방법을 사용하면 RStudio에서 미리보기를 성공적으로 생성 할 수도 있지만 프레젠테이션을 배포하려고하면 공유 라이브러리를로드하려는 시도에서 "잘못된 ELF 헤더"가 발생했다는 다른 오류가 발생합니다.
shiny (또는 shinyapps.io)와 .dll 파일간에 충돌이 있습니까? 사전에
감사합니다,
제이슨
감사합니다 Yihui, 나는 이것이 답변이 될 줄 알았는데. 실제로 어떤 확인을 찾았습니다. Linux가 아닌 사용자의 경우 –