Longitudinal and Multilevel Data in R and Stan
ICPSR short course: May 28 to June 1, 2018
May 28: Introduction to R by John Fox
May 29 to June 1: Longitudinal and Multilevel Data in R and Stan by Georges
Monette
Sponsored and organized by ICPSR, University of Michigan and
held at York
How about this (I'm showing it as a pipe because it's easier to read
that way):
library(magrittr)
"f 147/1315/587 2820/1320/587 3624/1321/587 1852/1322/587" %>%
strsplit(' ') %>%
unlist %>%
sub('^[^/]*/*','',.) %>%
sub
Hi,
I couldn't resist these two suggestions:
strings <- c("ASk/20005-01-45/90", "Alldatk/25-17-4567/990")
x <- as.numeric(gsub("^[^-]*-|-.*$","",strings))
or
x <- as.numeric(sub("^[^-]*-([0-9]+)-.*$","\\1",string
3 matches
Mail list logo