I have a small dataframe as below.
sad <- structure(list(a = c(1, 2), b = c(3, 4)), class = "data.frame", row.names = c(NA, -2L), class = c("tbl_df", "tbl",
"data.frame"))
Can anyone please help me as to what is the below operation doing?
sad[, a := sad[, "Ma"] == "Y"]
# A tibble: 2 x 2
a b
<dbl> <dbl>
1 1 3
2 2 4
When I execute the above operation, i get the same output, but not sure what is the intent here. Can anyone help me?