library(magrittr) library(reticulate) json <- jsonlite::read_json("../data-raw/saved/Haiti--2021-02-09-20-15-17.json")
reticulate::source_python("C:/Users/jacci/Documents/DS 710/coffee_roasting_profiles/inst/app/www/get_ror_curves_r_as_input.py") # Bring python script into R reticulate::source_python("../inst/app/www/get_ror_curves_r_as_input.py") all = py$get_ror_curves(file_raw ='../data-raw/saved/Haiti--2021-02-09-20-15-17.json')
# Puts into a df with 2 delta columns clean_deltas_from_python <- function(raw_deltas) { deltas = raw_deltas %>% dplyr::mutate_if(is.list, as.character) # Make all nulls into NA deltas[deltas == "NULL"] <- NA deltas[deltas == "NaN"] <- NA # Columns should be same type deltas = deltas %>% dplyr::mutate_if(is.character, as.double) t1 = deltas %>% dplyr::slice(1) %>% tidyr::pivot_longer(everything(), names_to = "time", values_to = "dtemp1") t2 = deltas %>% dplyr::slice(2) %>% tidyr::pivot_longer(everything(), names_to = "time", values_to = "dtemp2") dplyr::left_join(t1, t2, by = "time") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.