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

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sat Sep 8 16:13:32 CEST 2018


On 08/09/2018 9:12 AM, Shivi Bhatia wrote:
> 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.

Use traceback() to see which function called stri_split_regex.

Break up the long pipeline into smaller parts so you can see where the 
error is comming from.

Don't post in HTML.

Duncan Murdoch




More information about the R-help mailing list