Debian Codegraph @

man/runUrl.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/run-url.R
3 \name{runUrl}
4 \alias{runUrl}
5 \alias{runGist}
6 \alias{runGitHub}
7 \title{Run a Shiny application from a URL}
8 \usage{
9 runUrl(url, filetype = NULL, subdir = NULL, destdir = NULL, ...)
10
11 runGist(gist, destdir = NULL, ...)
12
13 runGitHub(
14 repo,
15 username = getOption("github.user"),
16 ref = "HEAD",
17 subdir = NULL,
18 destdir = NULL,
19 ...
20 )
21 }
22 \arguments{
23 \item{url}{URL of the application.}
24
25 \item{filetype}{The file type (\code{".zip"}, \code{".tar"}, or
26 \code{".tar.gz"}. Defaults to the file extension taken from the url.}
27
28 \item{subdir}{A subdirectory in the repository that contains the app. By
29 default, this function will run an app from the top level of the repo, but
30 you can use a path such as \code{"inst/shinyapp"}.}
31
32 \item{destdir}{Directory to store the downloaded application files. If \code{NULL}
33 (the default), the application files will be stored in a temporary directory
34 and removed when the app exits}
35
36 \item{...}{Other arguments to be passed to \code{\link[=runApp]{runApp()}}, such as
37 \code{port} and \code{launch.browser}.}
38
39 \item{gist}{The identifier of the gist. For example, if the gist is
40 https://gist.github.com/jcheng5/3239667, then \code{3239667},
41 \code{'3239667'}, and \code{'https://gist.github.com/jcheng5/3239667'} are
42 all valid values.}
43
44 \item{repo}{Name of the repository.}
45
46 \item{username}{GitHub username. If \code{repo} is of the form
47 \code{"username/repo"}, \code{username} will be taken from \code{repo}.}
48
49 \item{ref}{Desired git reference. Could be a commit, tag, or branch name.
50 Defaults to \code{"HEAD"}, which means the default branch on GitHub, typically
51 \code{"main"} or \code{"master"}.}
52 }
53 \description{
54 \code{runUrl()} downloads and launches a Shiny application that is hosted at
55 a downloadable URL. The Shiny application must be saved in a .zip, .tar, or
56 .tar.gz file. The Shiny application files must be contained in the root
57 directory or a subdirectory in the archive. For example, the files might be
58 \code{myapp/server.r} and \code{myapp/ui.r}. The functions \code{runGitHub()}
59 and \code{runGist()} are based on \code{runUrl()}, using URL's from GitHub
60 (\url{https://github.com}) and GitHub gists (\url{https://gist.github.com}),
61 respectively.
62 }
63 \examples{
64 ## Only run this example in interactive R sessions
65 if (interactive()) {
66 runUrl('https://github.com/rstudio/shiny_example/archive/main.tar.gz')
67
68 # Can run an app from a subdirectory in the archive
69 runUrl("https://github.com/rstudio/shiny_example/archive/main.zip",
70 subdir = "inst/shinyapp/")
71 }
72 ## Only run this example in interactive R sessions
73 if (interactive()) {
74 runGist(3239667)
75 runGist("https://gist.github.com/jcheng5/3239667")
76
77 # Old URL format without username
78 runGist("https://gist.github.com/3239667")
79 }
80
81 ## Only run this example in interactive R sessions
82 if (interactive()) {
83 runGitHub("shiny_example", "rstudio")
84 # or runGitHub("rstudio/shiny_example")
85
86 # Can run an app from a subdirectory in the repo
87 runGitHub("shiny_example", "rstudio", subdir = "inst/shinyapp/")
88 }
89 }