Skip to content

Instantly share code, notes, and snippets.

To add shiny server to NecTAR VM that is already running rstudio server:
1. give the machine a DNS entry with https, see https://swift.rc.nectar.org.au/v1/AUTH_a404f16e313b4b09ac35d183a2f95afe/tutorials-jekyll-test-build-I722423cbb7cadc02889ae2f885ea3802f1565276-3/dns-with-designate/01-overview.html
2. install shiny-server https://www.rstudio.com/products/shiny/download-server/ubuntu/
3. check that shiny-server is running on the default port 3838
wget -O - http://localhost:3838
4. update the nginx config following https://support.rstudio.com/hc/en-us/articles/213733868-Running-Shiny-Server-with-a-Proxy
@raymondben
raymondben / bowerbird_aviso_fsle.R
Created June 4, 2020 04:19
Use bowerbird to download AVISO FSLE files by ftp
##remotes::install_github("AustralianAntarcticDivision/blueant")
library(blueant)
data_dir <- tempfile() ## destination dir, change as needed
dir.create(data_dir) ## must exist
## "FSLE NRT" for near-real-time, "FSLE DT" for delayed-time
src <- sources("FSLE NRT") %>% bb_modify_source(user = "your_aviso_username", password = "your_password")
result <- bb_get(src, local_file_root = data_dir, verbose = TRUE)
@raymondben
raymondben / dms2decdeg.R
Created April 3, 2019 04:49
Degrees-minutes-seconds to decimal degrees
#' Convert degrees-minutes-seconds to decimal degrees
#'
#' This is pretty rough and not suitable as-is for public use. But for my own purposes it is more useful than e.g. sp::char2dms
#'
#' @param x character: dms representation
#'
#' @return numeric
#'
#' @export
dms2decdeg <- function(x) {
@raymondben
raymondben / global.R
Last active September 19, 2022 19:24
gauth shiny example
library(googleAuthR)
library(shiny)
library(shinyjs)
@raymondben
raymondben / eucalypt_height.R
Last active August 29, 2015 14:07
Mapping eucalypt heights across Australia using ALA4R
## see http://untan.gl/articles/2014/10/08_using-ala4r-mapping-eucalypt-height.html
## load the ALA4R package
library(ALA4R)
## check that it's version 1.04 or later: the "guid" attribute on the sites_by_species data was added in that version
if (as.numeric(packageDescription("ALA4R",fields="Version"))<1.04)
stop("reinstall ALA4R to get v1.04 or later")
ala_config(cache_directory=file.path("~","data","ala_cache"))