If I've understood correctly, you have a data frame that might have a column of patients that looks like this:
df <- data.frame(patients = sample(0:2, 10, replace = T))
df
# in base R, you can just create a new variable column like so:
df$log_of_patients_plus_one <- log(df$patients)+1
If that's not what you're looking for, you might need to give a more detailed example, as well as what output you're looking for.