I have a function that (among other things) pastes together the elements of an array, something like this:
f <- function(){
xy <- c("x", "y")
pxy <- paste(xy, collapse = " and ")
ans <- paste(pxy, "exist")
answer <<- ans
return(ans)
}
When I run it directly in R, answer looks just like you'd expect it too: x and y exist
When I run it via a shiny button, answer looks like: c("x", "y") and y exist
Any ideas what could be going on here?
[NB: Sorry for not including code that can reproduce the error. My app is many thousand lines long, and I cannot reproduce the pattern in a simple example.]