-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d1b1ea
commit 7d9c128
Showing
7 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
|
||
export(config) | ||
export(obfuscator) | ||
export(sdd_info) | ||
export(sign_in) | ||
export(sign_out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# RStudio addins | ||
|
||
sdd_info_addin <- function() | ||
sdd_info() | ||
|
||
sign_out_addin <- function() | ||
sign_out() | ||
sign_out() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#' Get centralized information for the BioDataScience course | ||
#' | ||
#' Use this function to get small peices of text from a centralized repository. | ||
#' This is a convenience function to retrieve, say, links, pieces of R code, or | ||
#' other textual information in relation with the current BioDataScience course. | ||
#' To be used only by students currently involved in a course. | ||
#' | ||
#' @param echo Is the textual information echoed in the console (`TRUE` by default). | ||
#' @param skipNul Do we skip nul characters in the text (`TRUE` by default)? | ||
#' | ||
#' @return The downloaded text is returned invisibly. | ||
#' @export | ||
#' | ||
#' @examples | ||
#' # If there is some textual information currently available in the central | ||
#' # repository, you get it and dispaly it this way: | ||
#' sdd_info() | ||
#' | ||
#' # To place this text in a variable silently, do this: | ||
#' txt <- sdd_info(echo = FALSE) | ||
#' txt | ||
sdd_info <- function(echo = TRUE, skipNul = TRUE) { | ||
sdd_url <- url("https://go.sciviews.org/sdd_info") | ||
open(sdd_url) | ||
on.exit(try(close(sdd_url), silent = TRUE)) | ||
sdd_data <- readLines(sdd_url, encoding = "UTF-8", warn = FALSE, | ||
skipNul = skipNul) | ||
if (isTRUE(echo)) | ||
cat(sdd_data, sep = "\n") | ||
invisible(sdd_data) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.