Maps API

Get address coordinates with R

I wrote a finction in R which searces for an address given to it as a srting on GoogleMaps, and returns it's latitude and longitude.
Here's the code, which can be found on GitHub too.

IMPORTANT: It needs the rjson package (maybe RJSONIO is ok, too).
getAddressCoord <- function(address){
address <- as.character(address)
address <- paste(unlist(strsplit(address, split=" ")), collapse="+")
base <- ""
ending <- "&sensor=false"
download.file(url=paste(base, address, ending, sep=""),
destfile="temp_address_info.json") <- fromJSON(file="temp_address_info.json")
if([["status"]] == "OK"){ <- unlist($results[[1]]$geometry$location)
} else {
return("Result is not appropriate!")