Keywords: R script error, tidyverse, dplyr, cli package, mutate(), Spotfire, terminal size error, cli.width
Products: Open source R (Spotfire Service for R Server Edition)
Description: Customers have encountered R script errors while executing data functions after upgrading to version 14.0.x. These errors include terminal size issues and problems with the mutate() function. The root cause is suspected to be related to the "cli" package, which is automatically invoked when the Tidyverse package is loaded.
Example error:
Cannot determine terminal size (system error 6, The handle is invalid.\r
) @tty.c:24 (clic_tty_size)
Error: Problem with `mutate()` input `..1`.
✖ missing argument
ℹ Input `..1` is `<empty>`.
eval(script, envir = .GlobalEnv)
eval(script, envir = .GlobalEnv)
withCallingHandlers({
Max_Effective_Version %>% dplyr::mutate(mev_reported_status = ifelse(mev_sys_status == "No Status Available" & mev_audit_status != "No Status Available",
withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
eval(quote(`_fseq`(`_lhs`)), env, env)
eval(quote(`_fseq`(`_lhs`)), env, env)
`_fseq`(`_lhs`)
freduce(value, `_function_list`)
function_list[[i]](value)
dplyr::mutate(., , mev_status_source = ifelse(mev_reported_status == "No Status Available",
Resolution:
-
Apply the Latest Hotfix (HF): Ensure that the latest hotfix is applied to your environment.
-
Modify the Script: Insert the following line of code before loading the Tidyverse package to address the terminal size error:
options(cli.width = 80)
library(tidyverse) -
Reasoning: The "cli" package is responsible for generating this error because the R service runs as a Windows service without an available console, which affects the terminal size detection. The above code forces the terminal size to a valid value, preventing the error.
-
Next Steps: If the issue persists after implementing the above resolution, contact Revvity support with a Spotfire analysis (DXP file) containing a simple, reproducible example of the issue.
Additional Documentation:
Comments
0 comments
Please sign in to leave a comment.