agaveplatform / r-sdk Goto Github PK
View Code? Open in Web Editor NEWOfficial R client SDK to the Agave Platform -- EARLY ALPHA
Home Page: https://agaveapi.co/
License: Other
Official R client SDK to the Agave Platform -- EARLY ALPHA
Home Page: https://agaveapi.co/
License: Other
Running through the example using the Docker environment and receiving an error when running the
ag <-Agave$new
command.
The console output is below. In the instructions you might mention to the user to change their working directory to the examples folder and the install("..") to install("../rAgave")
`R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
Error in loadNamespace(name) : there is no package called ‘rmarkdown’
31 Jan 2018 17:34:20 [rsession-rstudio] ERROR r error 4 (R code execution error) [errormsg=Error in loadNamespace(name) : there is no package called ‘rmarkdown’
]; OCCURRED AT: rstudio::core::Error rstudio::r::exec::{anonymous}::evaluateExpressionsUnsafe(SEXP, SEXP, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::{anonymous}::EvalType) /home/ubuntu/rstudio/src/cpp/r/RExec.cpp:159; LOGGED FROM: void rstudio::session::modules::rmarkdown::notebook::{anonymous}::onDocAdded(const string&) /home/ubuntu/rstudio/src/cpp/session/modules/rmarkdown/NotebookCache.cpp:341
library("rAgave")
For security, we'll pull our variables from the environment rather than enter them directly.
myCreds <- Sys.getenv( c("AGAVE_USERNAME", "AGAVE_PASSWORD", "AGAVE_TENANT", "AGAVE_BASE_URL"), names = TRUE )
Prompt for them if not present, and store them in the environment in case we rerun this later.
if (is.null(myCreds[["AGAVE_USERNAME"]]) || nchar(myCreds[["AGAVE_USERNAME"]]) == 0) {
if (is.null(myCreds[["AGAVE_PASSWORD"]]) || nchar(myCreds[["AGAVE_PASSWORD"]]) == 0) {
if (is.null(myCreds[["AGAVE_BASE_URL"]]) || nchar(myCreds[["AGAVE_BASE_URL"]]) == 0) {
#detach("package:futile.logger", unload=TRUE)
#detach("package:rAgave", unload=TRUE)
install("..")
Error: Could not find package root.
getwd()
[1] "/home/rstudio"
setwd("~/examples")
library("rAgave")For security, we'll pull our variables from the environment rather than enter them directly.
myCreds <- Sys.getenv( c("AGAVE_USERNAME", "AGAVE_PASSWORD", "AGAVE_TENANT", "AGAVE_BASE_URL"), names = TRUE )
#detach("package:futile.logger", unload=TRUE)
#detach("package:rAgave", unload=TRUE)
install("..")
Error: Could not find package root.
getwd()
[1] "/home/rstudio/examples"
#detach("package:futile.logger", unload=TRUE)
#detach("package:rAgave", unload=TRUE)
install("../rAgave")
Installing rAgave
'/usr/local/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL
'/home/rstudio/rAgave' --library='/usr/local/lib/R/site-library' --install-tests
ag <-Agave$new( baseUrl = myCreds[["AGAVE_BASE_URL"]],
username = myCreds[["AGAVE_USERNAME"]],
password = myCreds[["AGAVE_PASSWORD"]])
cannot open file 'agave.log': Permission deniedError in file(file, ifelse(append, "a", "w")) :
cannot open the connection`
Using the SDK a bit, I'm wondering about what people prefer with respect to coding style. I see a few common recommendations showing up in Google searches:
The current syntax is akin to Google's style guide, but feels a little non-idiomatic for a scripting language. Would it be more helpful for existing users if the R SDK mirrored the agavepy
syntax, or would it be more helpful to adhere to the existing structure which more closely reflects the Java, PHP, and AngularJS syntax?
Current/Google
library("rAgave")
api <- Agave$new()
system <- api$systems$getDetails(id = "example.com")
print(system$storage$rootDir)
tidyverse
library("r_agave")
api <- agave$new()
system <- api$systems$get_details(id = "example.com")
print(system$storage$root_dir)
We might also consider use S3 classes instead of S6 classes, which would allow for a pythonic dot notation that reads a bit more like core R
library("agave")
api <- new_agave()
system <- api.systems.get_details(id = "example.com")
Tried to install the package via clone repo change working directory in R to repo directory and follow
library(devtools)
install(".")
Generated the following error:
> setwd("~/Stapleton_Lab/agave-rlang-sdk")
> install(".")
Installing swagger
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
'/Users/d3r3zz3d/Stapleton_Lab/agave-rlang-sdk' \
--library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' --install-tests
* installing *source* package ‘swagger’ ...
ERROR: a 'NAMESPACE' file is required
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/swagger’
Show Traceback
Rerun with Debug
Error: Command failed (1)
Opened terminal and cd to repo directory. Issued command:
echo 'exportPattern( "." )' > NAMESPACE
and then reattempted install(".")
with success.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.