Skip to content
Snippets Groups Projects
Commit 398472cb authored by lq39quba's avatar lq39quba
Browse files

add irregular and paleo date

parent b48a6276
Branches
No related tags found
No related merge requests found
...@@ -12,3 +12,4 @@ ...@@ -12,3 +12,4 @@
test_app.R test_app.R
test_json_create.R test_json_create.R
ebv_metadata.R ebv_metadata.R
test.R
\ No newline at end of file
...@@ -920,6 +920,8 @@ server <- function(input, output) { ...@@ -920,6 +920,8 @@ server <- function(input, output) {
#check the input of the irregulare timesteps #check the input of the irregulare timesteps
if(input$temporal_resolution=='Irregular'){ if(input$temporal_resolution=='Irregular'){
timestep_list <- stringr::str_split(input$temp_res_irr, ',')[[1]] timestep_list <- stringr::str_split(input$temp_res_irr, ',')[[1]]
timestep_list <- gsub(' ', '', timestep_list) #remove whitespaces
print(timestep_list)
ts_irr_wrong <- FALSE ts_irr_wrong <- FALSE
for(ts in timestep_list){ for(ts in timestep_list){
if(grepl('^\\d{4}-\\d{2}-\\d{2}$', ts) | grepl('^\\d{4}$', ts)){ if(grepl('^\\d{4}-\\d{2}-\\d{2}$', ts) | grepl('^\\d{4}$', ts)){
...@@ -945,7 +947,7 @@ server <- function(input, output) { ...@@ -945,7 +947,7 @@ server <- function(input, output) {
#temporal extent #temporal extent
if(input$temporal_resolution=='Irregular'){ if(input$temporal_resolution=='Irregular'){
timestep_list <- as.numeric(stringr::str_split(input$temp_res_irr, ',')[[1]]) timestep_list <- stringr::str_split(input$temp_res_irr, ',')[[1]]
t_start <- min(timestep_list) t_start <- min(timestep_list)
t_end <- max(timestep_list) t_end <- max(timestep_list)
timesteps_irr <- paste0('"', paste0(timestep_list, collapse = '", "'), '"') timesteps_irr <- paste0('"', paste0(timestep_list, collapse = '", "'), '"')
...@@ -1077,7 +1079,7 @@ server <- function(input, output) { ...@@ -1077,7 +1079,7 @@ server <- function(input, output) {
}, },
"ebv_domain": [\n\t\t\t\t"', paste0(ebv_domain_value, collapse = '",\n\t\t\t\t"'),'"\n\t\t\t], "ebv_domain": [\n\t\t\t\t"', paste0(ebv_domain_value, collapse = '",\n\t\t\t\t"'),'"\n\t\t\t],
"comment": "',comment,'", "comment": "',comment,'",
"terranova_type": "', input$terranova_type,'" "terranova_type": "', input$terranova_type,'",
"timesteps": [\n\t\t\t\t', timesteps_irr, '\n\t\t\t] "timesteps": [\n\t\t\t\t', timesteps_irr, '\n\t\t\t]
} }
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment