[R] argument "string" is missing, with no default

Shivi Bhatia @hivipmp82 @ending from gm@il@com
Sat Sep 8 15:12:47 CEST 2018


Hi All,

I am trying to fetch data from a pdf file with the below code but getting
the error message:
Error in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument "string" is missing, with no default

library(readr)library(stringr)library(magrittr)library(dplyr)
table_data <- nvsr65_05[ [ 14 ] ] %>%
  str_split(pattern = "\n") %>%
  unlist() %>%
  str_subset(pattern = "^[^…].*(\\. ){5}") %>%
  str_c(collapse = "\n") %>%
  read_table(col_names = FALSE) %>%
  mutate(X2 = str_replace_all(X2, "(\\. )*", ""),
	 X5 = rep(c("Neonatal", "Postnatal"), each = 10)) %>%
  set_names(value = c("rank", "cause_of_death", "deaths", "percent", "group"))

Please advice. Thank you.

	[[alternative HTML version deleted]]



More information about the R-help mailing list