0
I want to use these variables that I’m importing from a table in my function,gecode.
The geocode function behaves like this: geocode("Av. Paulista, 1578 - Bela Vista, Sao Paulo, Brazil")
I wanted to know if you have any in the R of I use concatenated variables as in PHP I use points.
library(ggmap)
library(leaflet)
library(readxl)
# no RStudio o diretorio de trabalho corrente do R aponta para o local
# aonde o script está
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
# le arquivo excel capitais
Pontos = read_excel("pontos_turisticos.xlsx")
nome = Pontos$Nome;
bairro = Pontos$Bairro;
endereco = Pontos$Endereço;
cidade = "Nova Friburgo";
estado = "RJ";
geocode("nome[1],bairro[1],endereco[1],cidade,estado");
In this case it is not the
collapse
, is thesep
. Try withsep = ""
.– Rui Barradas
Then I got it wrong I thought he wanted to concatenate and put point, and just put the Collapse = " . " , which concatenates and in the space luga puts "."
– alxwca
Okay, I read your code wrong, if that’s all
paste(nome[1], bairro[1])
without the functionc()
, then it’s up tosep
, but so it should becollapse
. If you want to concatenate integer vectors it will be betterpaste(nome, bairro)
.– Rui Barradas
Yeah, no doubt about it. @Noisy
– alxwca
The Paste() was very useful in my case!
– Lucas Oliveira