Skip to content
Prev 360816 / 398506 Next

web scraping tables generated in multiple server pages

Excerpts from Michael Friendly's message of 2016-05-10 14:45:28 -0400:
# what is missing to you
?gsub
# aliasing
df <- sp.tab[, wanted]

# convert to double
as.double(                                      # convert to double
    gsub(',', '.',                              # makes the ',' to become '.'
    gsub('\\.', '', df$"?rea Excedente (m2)"))  # get rid of the dot

You can easily put the names of the columns and use lapply on them to
convert all of them in same manner, that is left as an exercise.