Q: Separate two data types out of one column I have data coming from several people and some thought they should use a column to store names and others thought they should use the same column for values. 
In the following dataframe I would like to separate remark into a numeric column and a character column:  
df2 <- data.frame(group = c("a", "b", "c", "d", "e", "f"), var1 = c(3, 1, 2, 4, 3, 2), 
            remark = c( 2, "abc", 8, 2, "cfd", "afd"))

I'm not even sure where to start, but I'd like to be able >%> it in. 

A: We could do the following
df2$remark.num <- as.numeric(as.character(df2$remark))
df2$remark.char <- sub("\\d*","",df2$remark)
df2 <- df2[,-3]

output
> df2 
  group var1 remark.num remark.char
1     a    3          2            
2     b    1         NA         abc
3     c    2          8            
4     d    4          2            
5     e    3         NA         cfd
6     f    2         NA         afd


A: If we use as.numeric() to coerce the remark column to numbers, R will have trouble with the ones that can't be converted. We could exploit that like this:
df2$remark.num <- df2$remark %>% paste %>% as.numeric
df2$remark.alpha <- NA
df2$remark.alpha[is.na(df2$remark.num)] <- paste(df2$remark)[is.na(df2$remark.num)]

Output:
> df2
  group var1 remark remark.num remark.alpha
1     a    3      2          2         <NA>
2     b    1    abc         NA          abc
3     c    2      8          8         <NA>
4     d    4      2          2         <NA>
5     e    3    cfd         NA          cfd
6     f    2    afd         NA          afd


A: Here is a solution using dplyr 1.0.0's across():
library(dplyr)

df2 <- data.frame(group = c("a", "b", "c", "d", "e", "f"),
                  var1 = c(3, 1, 2, 4, 3, 2), 
                  remark = c( 2, "abc", 8, 2, "cfd", "afd"))

df2 %>% 
  mutate(across(remark, list(num = ~ as.numeric(.x),
                             chr = ~ ifelse(is.na(as.numeric(.x)), .x, NA)))) 

#> Warning in fn(col, ...): NAs introduced by coercion
#> Warning in ifelse(is.na(as.numeric(.x)), .x, NA): NAs introduced by coercion
#>   group var1 remark remark_num remark_chr
#> 1     a    3      2          2       <NA>
#> 2     b    1    abc         NA        abc
#> 3     c    2      8          8       <NA>
#> 4     d    4      2          2       <NA>
#> 5     e    3    cfd         NA        cfd
#> 6     f    2    afd         NA        afd

Created on 2020-06-12 by the reprex package (v0.3.0)
