splitstackshape
splitstackshape copied to clipboard
unclear message when running cSplit()
I have written a code that uses cSplit function to separate a column in the data frame into multiple columns. Below is the reproducible example:
mtcars %>% rownames_to_column() %>% cSplit(., 'rowname', ' ')
Since I updated to R version 4.1.0. And after that the following code produces the following warning message that I was unable to resolve:
Warning messages:
1: In type.convert.default(X[[i]], ...) :
'as.is' should be specified by the caller; using TRUE
2: In type.convert.default(X[[i]], ...) :
'as.is' should be specified by the caller; using TRUE
3: In type.convert.default(X[[i]], ...) :
'as.is' should be specified by the caller; using TRUE
I actually identified where the warning coming from:
it is from the default value of type.convert=TRUE
.
But I am not sure why it is producing the warning, and what I should do ( I do want the type.convert to be set to TUE)
@yuliaUU Thanks for raising the issue. It appears to be related to changes to type.convert
in R 4.1. Here's the relevant part from the release notes:
type.convert() now warns when its as.is argument is not specified, as the help file always said it should. In that case, the default is changed to TRUE in line with its change in read.table() (related to stringsAsFactor) in R 4.0.0.
I'll look into it shortly and try to get an update on CRAN. The warning
should not affect the performance though.
yes! the function works perfectly! Thanks a lot for your prompt response
Just wanted to say that I also got the same error message. But as you said it is not affecting the execution of my code.
A workaround if you don't need type conversion is to add the argument type.convert=FALSE
.
This warning still appears. Will we get a fix for this?