Packages: ggmap, ggplot2 plyr
I've used a mapdist function to calculate the distance between two postcodes.
I wish to apply the mapdist function to a list and export to a csv. file.
Here is what iv tried.
Run mapdist and export
data <- mutate(dataset, from = NA, to = NA, m = NA, km = NA, miles = NA)
lapply(dataset, mapdist(PostcodeA, PostcodeB, mode = "driving"))
Error in match.fun(FUN) :
'mapdist(PostcodeA, PostcodeB, mode = "driving")' is not a function, character or symbol
dataset <- data.frame(lapply(dataset, as.character))
write.csv(dataset, "Rexport.csv")`
I have encountered an Error in match.fun(FUN) :
Any suggestions?