The quick way of converting these to
NA
is by using the map_dfc
function from the purrr
package.This should output the following (note that all occurrences of '.' have been replaced with
NA
):a b c 1 T 2 morty 2 D 1 summer 3 P 1 rick 4 O . summer 5 V 3 summer 6 M 3 summer 7 Z . rick 8 F 2 . 9 J 2 rick 10 E 3 rick a b c 1 T 2 morty 2 D 1 summer 3 P 1 rick 4 O NA summer 5 V 3 summer 6 M 3 summer 7 Z NA rick 8 F 2 NA 9 J 2 rick 10 E 3 rick