i'm using amazing package able read , upload data shiny app. it's working ok, when add row sheet, not keep same encoding server, neither behaves data in previous rows. spanish names manually entered ok, when use app load data, special latin characters (utf-8) replaced in sheet. data, not recognized app in following sessions.
library(googlesheets) table <- "reportes" savedata <- function(data) { # grab google sheet sheet <- gs_title(table) # add data new row gs_add_row(sheet, input = data) } loaddata <- function() { # grab google sheet sheet <- gs_title(table) # read data gs_read_csv(sheet) }
then, use button in ui, , observer in server load data...
observeevent(input$enviar, { exit <- input$enviar if (exit==1){ adddata <- c( as.character(input$fecha), as.character(input$local), as.character(input$dpto), as.character(input$estado), as.character(input$fsiembra), as.character(input$ref), as.character(loc$lat[loc$departamento==input$dpto & loc$localidad==input$local]), as.character(loc$long[loc$departamento==input$dpto & loc$localidad==input$local]), as.character(getzafra(input$fecha))) savedata(adddata) d <- loaddata() reset('fecha') reset('dpto') reset('local') reset('estado') reset('fsiembra') reset('ref') reset('pass') disable('enviar') } })
please... if can i'd happy.
i discovered needed encode character vector before uploding...
i used:
encoding(adddata) = "latin1" savedata(adddata)
and worked fine!.