Remove non-ASCII characters from reported term in order for Pandoc to create PDF file

convert_var_to_ascii(df, var)

Arguments

df

dataframe

var

variable with non-ASCII characters

Value

dataframe

See also

Reporting-related utility functions create_R_script(), truncate_var_strings()

Examples


df <- data.frame(
var = c("test", "teäst"),
stringsAsFactors = FALSE
)

convert_var_to_ascii(df, 'var')
#>    var
#> 1 test
#> 2 test

df <- data.frame(
usubjid = 1:2,
var = c("test", "teästõ"),
stringsAsFactors = FALSE
)

convert_var_to_ascii(df, 'var')
#>   usubjid  var
#> 1       1 test
#> 2       2 test