Skip to content

Commit

Permalink
biab_outputs singular
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlord authored Dec 17, 2024
1 parent e754ee6 commit 8bd037a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/helloWorld/helloR.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ example_jpg = file.path(outputFolder, "example.jpg")
if(!file.exists(example_jpg)) {
download.file("https://geobon.org/wp-content/uploads/2018/01/default-image.png", example_jpg, "auto")
}
biab_outputs("some_picture", example_jpg)
biab_output("some_picture", example_jpg)

example_tiff = file.path(outputFolder, "utmsmall.tif")
if(!file.exists(example_tiff)) {
download.file("https://github.com/yeesian/ArchGDALDatasets/raw/master/data/utmsmall.tif", example_tiff, "auto")
}
biab_outputs("heat_map", example_tiff)
biab_output("heat_map", example_tiff)

# Uncomment this to stop the script here with an error message
#biab_error_stop("Some error")
Expand All @@ -32,7 +32,7 @@ example_json = file.path(outputFolder, "sample.json")
if(!file.exists(example_json)) {
download.file("https://gist.githubusercontent.com/wavded/1200773/raw/e122cf709898c09758aecfef349964a8d73a83f3/sample.json", example_json, "auto")
}
biab_outputs("geo_json", example_json)
biab_output("geo_json", example_json)

some_csv_data = file.path(outputFolder, "some_data.csv")
write("Model,mpg,cyl,disp,hp,drat,wt,qsec,vs,am,gear,carb
Expand All @@ -41,7 +41,7 @@ Mazda RX4 Wag,21,6,160,110,3.9,2.875,17.02,0,1,4,4
Datsun 710,22.8,4,108,93,3.85,2.32,18.61,1,1,4,1
Hornet 4 Drive,21.4,6,258,110,3.08,3.215,19.44,1,0,3,1
", some_csv_data)
biab_outputs("some_csv_data", some_csv_data)
biab_output("some_csv_data", some_csv_data)

# Example from https://en.wikipedia.org/wiki/Tab-separated_values
some_tsv_data = file.path(outputFolder, "some_data.tsv")
Expand All @@ -52,22 +52,22 @@ write("Sepal length Sepal width Petal length Petal width Species
4.6 3.1 1.5 0.2 I. setosa
5.0 3.6 1.4 0.2 I. setosa
", some_tsv_data)
biab_outputs("some_tsv_data", some_tsv_data)
biab_output("some_tsv_data", some_tsv_data)

# Example from https://en.wikipedia.org/wiki/Tab-separated_values
some_html_output = file.path(outputFolder, "some_page.html")
write(
"<h1>This is a page</h1><p>With a fancy interactive graph or the like.</p>",
some_html_output
)
biab_outputs("some_html_output", some_html_output)
biab_output("some_html_output", some_html_output)

biab_info("Some information message")
biab_warning("Some warning")

biab_outputs("text", "This is just an example. In case you have a very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long text it will need to be unfolded to see it all.")
biab_outputs("number", input$intensity * 3)
biab_outputs("userdata_available", list.files(file.path(Sys.getenv("USERDATA_LOCATION"))))
biab_outputs("undocumented_output", "Some debug output")
biab_output("text", "This is just an example. In case you have a very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long text it will need to be unfolded to see it all.")
biab_output("number", input$intensity * 3)
biab_output("userdata_available", list.files(file.path(Sys.getenv("USERDATA_LOCATION"))))
biab_output("undocumented_output", "Some debug output")

# (If there is a problem with encoding, one could use utf-8 library to clean the output, since the server reads it as utf-8)
# (If there is a problem with encoding, one could use utf-8 library to clean the output, since the server reads it as utf-8)

0 comments on commit 8bd037a

Please sign in to comment.