[R] Longitudinal and Multilevel Data in R and Stan: 5-day workshop May 28 to June 1, 2018

2018-04-13 Thread Georges Monette
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

Re: [R] Regular expression help

2017-10-09 Thread Georges Monette
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

Re: [R] assign

2016-04-09 Thread Georges Monette
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