R로 실행파일을 만드는 방법들을 찾아봤지만 잘 나오지 않았다. 찾아본 바로는 erectron패키지와 rinno 패키지가 있는 것 같다. 그 중에서 Rinno 패키지를 알아보려고한다. 해당 패키지는 아쉽게도 몇가지 오류들이 있다. 오늘은 해당 내용을 수정하여 사용하는 방법을 알아보도록 하겠다.
1. 사전 준비
Rinno는 inno setup이라는 소프트웨어를 활용하므로 아래 링크에서 inno setup을 설치받도록 하자. 그러면 사전준비는 완료된다.
Inno Setup Downloads

2. 패키지 수정 결과
우선 해당 패키지 수정에 과정에 관심이 없는 사람들이 더 많을 것으로 생각되어 결론부터 공유하고자 한다. 아래는 원래 패키지를 포크해와서 수정한 내 패키지이다. 아래와 같이 실행파일 생성 예제를 실행할 수 있다. 다만 아직 flexdashboard에 대한 예제는 구현하지 못하였다.
unloadNamespace('RInno')
devtools::install_github('qkdrk7777775/RInno',force=T)
library(RInno)
file.remove('c:/Users/qkdrk/Desktop/innocj/app/bin',recursive=T)
example_app(app_dir='app')
create_app(app_name='my_app',app_dir='app',
include_R=T,privilege = "admin")
compile_iss()
2.1 옵션 설명
inst_pw : 비밀번호 설정
app_port : 앱 포트 설정
app_dir : 앱 경로 설정
pkgs : 설치 패키지 목록
pkgs_path : 패키지 저장 경로
inst_pw : 설치비밀번호
include_R : R 설치 파일 생성 유무
include_Rtools, include_Pandoc, include_Chrome
repo : 크랜 주소
3. 패키지 수정
원 저자의 패키지는 아래의 링크를 통해 접속할 수 있다. 2017년 이후 수정이 중단된 것으로 보여진다.
GitHub - ficonsulting/RInno: How to install local shiny apps
How to install local shiny apps. Contribute to ficonsulting/RInno development by creating an account on GitHub.
3.1. 3.6 버전 이상 적용
create_app 함수에서 코드 상으로 하드코딩된 부분이 있어 R의 4버전에서 적용이 안되는 것 같다. 고맙게도 해당 부분은 아래 링크에서 어떤 사람이 수정하는 법을 기재하여 두었다.
Error: R version - 4.0.0 - was not found on CRAN. · Issue #162 · ficonsulting/RInno
It seems that when running this code R_versions <- c(unique(stats::na.omit(stringr::str_extract(readLines("https://cran.rstudio.com/bin/windows/base/", warn = F), "[1-3]\.[0-9]+\....
아래 함수를 실행하고 Edit 내에서 [1-3]을 [1-4]로 변경하면 된다. 또한 example_app에서 ui.R, Server.R 이 생성되지 않는 경우가 있어 확인해봤더니 list.files에서 pattern옵션이 *.R로 표현되어 있어 인식이되지 않았다. 이를 .R로 변경하여 주도록하자.
trace(RInno::get_R,edit=T)
trace(RInno::code_section,edit=T)
trace(RInno::example_app,edit=T)


4. 참고
한국 R 사용자회 | Shiny를 윈도우 프로그램으로 쉽게 바꿀 수 있는 패키지가 있네요 ^^
Shiny를 윈도우 프로그램으로 쉽게 바꿀 수 있는 패키지가 있네요 ^^ Installer 프로그램을 만들어 주고, 윈도우 프로그램 처럼 보여집니다 (물론, 내부적으로 R 소스코드와 패키지 그대로 사용) 저의 경우, 회사에서 Shiny로 공정분석툴 개발한다고 하면 사용자 PC에 R도 설치해야 하고 웹브라우저를 통해 보는 것에 대해 사용자가 거부감을...

GitHub - HanjoStudy/RInno: How to install local shiny apps
How to install local shiny apps. Contribute to HanjoStudy/RInno development by creating an account on GitHub.
RInno 0.1.0: flexdashboards and the registry | R-bloggers
Today, we are happy to announce RInno’s first minor release. Over the past 5 months, RInno has been downloaded over 1200 times. Data scientists use it at the FDIC, the US Treasury and US Department of Agriculture among other organizations to install ...

GitHub - georgemirandajr/Desktop-Shiny-Apps-for-LAC: Using the RInno package in the LA County network can pose workflow issues. Follow these steps to deploy Shiny apps on secure locations.
Using the RInno package in the LA County network can pose workflow issues. Follow these steps to deploy Shiny apps on secure locations. - GitHub - georgemirandajr/Desktop-Shiny-Apps-for-LAC: Using ...
GitHub - ficonsulting/r-shiny-electron: Electron and R shiny - RInno Template
Electron and R shiny - RInno Template. Contribute to ficonsulting/r-shiny-electron development by creating an account on GitHub.
GitHub - lawalter/r-shiny-electron-app: Guide to desktop app creation using R Shiny and Electron
:memo: Guide to desktop app creation using R Shiny and Electron - GitHub - lawalter/r-shiny-electron-app: Guide to desktop app creation using R Shiny and Electron
GitHub - wleepang/DesktopDeployR: A framework for deploying self-contained R-based applications to the desktop
A framework for deploying self-contained R-based applications to the desktop - GitHub - wleepang/DesktopDeployR: A framework for deploying self-contained R-based applications to the desktop
GitHub - jgm/pandoc: Universal markup converter
Universal markup converter. Contribute to jgm/pandoc development by creating an account on GitHub.
GitHub - nativefier/nativefier: Make any web page a desktop application
Make any web page a desktop application. Contribute to nativefier/nativefier development by creating an account on GitHub.