I have a dataframe and in order to process it and create a new dataframe with the rows of interest I execute the next code, which works fine:
arrivals <- arrivals[, c(2, 40:64)]
arrivals <- arrivals[complete.cases(arrivals), ]
medias <- rowMeans(arrivals[3:26])
# We select rows that we are interested in
map <- arrivals[c(44,165,40,84,111,158,26), ]
I would like a way of doing this using pipelines.
Something like:
map <- arrivals[, c(2, 40:64)] %>%
arrivals[complete.cases(arrivals), ] %>%
arrivals[c(44,165,40,84,111,158,26), ]
However this doesn´t work.