Created
June 2, 2016 10:04
-
-
Save wactbprot/60b81c2771ae11c8e3b94c149ae52659 to your computer and use it in GitHub Desktop.
extract positions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l <- readLines("svg.html") | |
l <- unlist( regmatches(l, gregexpr("d=\"M([0-9,]*)A", l))) | |
l <- gsub("[d=\\\"AM]", "", l) | |
l <- strsplit(l,",") | |
m <- lapply(l, function(e){ | |
c(as.numeric(e[1]), as.numeric(e[2])) | |
}) | |
M <- t(matrix(unlist(m), nrow = 2, ncol=length(l))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment