Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
M <- matrix(round(runif(100*100), 2), nrow=100, ncol=100)
df <-
df[1:5, 1:5]
# 1. Replace the diagonal of dataframe `df` to the respective row number
# using the set function.
# 2. Set the values of column V1 to values of column V2, for all rows where V2 is
# less than 0.5. using set function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment