0

I'm using R version 3.3 and I'm using the str_split() function from stringr package, but I'm unable to execute it as the compiler is throwing error here's my code:

  y <- str_split(x, "'")
  ret <- map_dbl(y, function(z){
    ifelse(length(z)>1,
           as.numeric(z[1])*12 + as.numeric(z[2]),
          as.numeric(z[1]))
  })
return(ret)
}```

What is the problem in my code?
ranjir
  • 3
  • 3
  • 1
    Can you load the package `library(stringr)` or use `y <- stringr::str_split(x, "'")` – akrun May 03 '20 at 20:30
  • 1
    @akrun Thanks it worked! I just realized that only the packages were installed I didn't load them – ranjir May 03 '20 at 20:41

0 Answers0