Boris Yes in that case it works as you have assigned a character string to key. My problem is I'm taking a string input from a shiny app and when I run the function it only sees xxxx. How to assign xxxx-yyyy to a character string.
Jeff -----Original Message----- From: Boris Steipe <boris.ste...@utoronto.ca> Sent: Tuesday, November 17, 2020 3:00 PM To: reichm...@sbcglobal.net Cc: r-help@r-project.org Subject: Re: [R] How to pass a character string with a hyphen tmp <- function(s) { return(str(s)) } key <- "xxxx-yyyy" tmp(key) # chr "xxxx-yyyy" .. works for me. Reprex? Cheers, Boris ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.