Variance or other calculation across columns in R

Here is how to calculate variance across columns in the R data frame. The same technique can be useful in other situations. Like in this other example. Get a count of NA values for each of the columns in the R data frame.

Replace R data frame column values conditionally

Here are multiple examples of how to replace R data frame values conditionally. Sometimes it is a specific value like NA, but sometimes exact columns, where you want to do the replacement.

Exit mobile version