This question already has an answer here:
I have a function that works on a df to convert observations with multiple different prefixes & formats to numeric:
sapply(df, function(x) {x<-gsub("'(\\d*)''",".\\1",x)
as.numeric(gsub("[^[:digit:].-]","",x))})
The issue I am having is the function takes the input:
44'6"
And converts it to
446
Is there any way to keep the same function, but modify it to convert these specific types of observations to centimeters?
I am sorry I do not know how to provide a reproducible example, but here is a picture of how the df is setup
Thank you