MichaelChirico commented on a change in pull request #28386:
URL: https://github.com/apache/spark/pull/28386#discussion_r416372474
##########
File path: R/pkg/R/DataFrame.R
##########
@@ -2287,16 +2287,19 @@ setMethod("mutate",
# For named arguments, use the names for arguments as the column
names
# For unnamed arguments, use the argument symbols as the column
names
- args <- sapply(substitute(list(...))[-1], deparse)
Review comment:
R 4.0.0 adds `deparse1` that would have been more appropriate here:
> `deparse1()` is a simple utility added in R 4.0.0 to ensure a string
result (character vector of length one), typically used in name construction,
as `deparse1(substitute(.))`.
That function is just a wrapper so easy to backport:
```
deparse1 = function (expr, collapse = " ", width.cutoff = 500L, ...)
paste(deparse(expr, width.cutoff, ...), collapse = collapse)
```
(though personally I would still stick with `trimws`)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]