Posts by Peterson Ribeiro • 37 points
2 posts
-
-1
votes1
answer36
viewsQ: Create an index by searching part of the text only
I would like to create an index by searching only part of the text. x <- c(4, 1, 6, "ab", 2, 1, "aa") which(x == "a") In the vector above, for example, I would like the return to be [1] 4 7 That…
rasked Peterson Ribeiro 37 -
2
votes3
answers54
viewsQ: Replacing NA values of a column by the value of the top row of the same column of a dataframe
I have the data frame below, and I want to create a script to replace the NA by the value of the top row of the same column. DADOS <- data.frame( a = c(1, 2, NA, 3, 4), b = c(5, 6, 7, NA, NA) )…
rasked Peterson Ribeiro 37