Subset by line number in magrittr chain
I am experimenting with magrittr chaining using grep / gsub etc.
It works well
top_url <- "http://www.england.nhs.uk/statistics/statistical-work-areas/ae-waiting-times-and-activity/"
readLines(top_url) %>% grep("SitReps", .)
The next step is to return the subset using line numbers. I tried this but it doesn't work.
readLines(top_url) %>% .[grep("SitReps", .)]
Can this be done?
+3
source to share
2 answers