#' Connects R session to Fusion Server
#'
#' @param uri Defaults to localhost if you don't privide the uri
#' @param app The name of the app
#' @param index The name of the index
#' @param user It looks for the enviroment variable $RFUSION_USER if not provided.
#' @param password It looks for the enviroment variable $RFUSION_PWD if not provided.
#'
#' @return hidden enviroment.
#' @export
#'
fusion_connect <- function(uri="http://127.0.0.1:8764", app=NULL, index=NULL, user=NULL, password=NULL){
if (is.null(user)){
user=Sys.getenv("RFUSION_USER")
}
if (is.null(password)){
password=Sys.getenv("RFUSION_PWD")
}
if (is.null(app)){
stop("You must provide the name of the app")
}
if (is.null(index)){
stop("You must provide the name of the index")
}
.conn<-new.env()
list(uri=uri,app=app,index=index,user=user,password=password) %>%
list2env(.conn)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.