R trying to find latitude/longitude data for cities in europe and getting geocode error messege

后端 未结 4 588
情书的邮戳
情书的邮戳 2021-02-04 09:46

I recently posted a question regarding plotting postions on cities in europe as points on a map. See R, get longitude/latitude data for cities and add it to my dataframe

4条回答
  •  误落风尘
    2021-02-04 10:25

    I have just found that this error message:

    Error: is.character(location) is not TRUE

    can be due to the address being encoded as a number, not a character. This can happen when you select from a data frame for instance, which was my case.

    Do:

    typeof(address)
    

    and if it turns out to be numeric, change it to char

    a2 <- as.character(address)
    geocode(a2)
    

提交回复
热议问题