i have a dataframe
namer None namei ... None
None None Na ... namej
.
.
named namev None ... Na
and i want to replace all Nones with 0 and everything else with 1 i tried to use lapply with the following function
fu = function(x){
if (x=="None")
0
else
1}
but it throws an error, how can i fix this