# load opal library
library(opalr)

o <- opal.login('pepe','7G9b!!2IyJs$', url = 'https://uncover.itg.be')


dir_name <- readline("Introduce the name of the directory please: ")

setwd(dir_name)

file_name <- readline("Introduce the name of the file to check the values: ")
harmonized_data <- ""

setwd(paste(dir_name ,"/harmonized_data", sep=""))

if (grepl(".csv" , file_name , fixed = TRUE)){
  harmonized_data <- read.csv(file_name)
  #harmonized_data <- read.csv(file_name, sep = ";")
}else if (grepl(".xlsx" , file_name , fixed = TRUE)){
  harmonized_data <- read.xlsx(file_name)
}

#opal.assign.resource(o , "harmonized_data" , "UZA.20220919_UZA" )
#opal.assign.resource(o , "harmonized_data_2" , "ASPEUR.20220919_ASPEUR" )
#opal.execute(o, "class(harmonized_data)")
#opal.execute(o, "class(harmonized_data_2)")




rval <- opal.execute.source(o, paste(dir_name , "script.R" , sep = "/"))
