googleway | R Package for accessing and plotting Google Maps | Map library
kandi X-RAY | googleway Summary
kandi X-RAY | googleway Summary
Provides a mechanism to access various Google Maps APIs, including plotting a Google Map from R and overlaying it with shapes and markers, and retrieving data from the places, directions, roads, distances, geocoding, elevation and timezone APIs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of googleway
googleway Key Features
googleway Examples and Code Snippets
Community Discussions
Trending Discussions on googleway
QUESTION
I'm a beginner in R and I'm trying to make a world map, which would color specific countries based on their GDP per capita, which is stored in another data frame. Here is my code (found online):
...ANSWER
Answered 2020-Sep-12 at 12:32Here is a working example, and follows @stefan's advice about joining your data to the map data frame.
In this example, I created a limited data frame containing gdp information my_gdp
on selected countries:
QUESTION
I want to use google streetview in my r shiny application. I am using leaflet to draw my map. I found this great leaflet plugin "Leaflet Pegman".
How do I implement this plugin into a r shiny app?
I tried to use this explanation. I also found another R-package (googleway) but in my case I want to use leaflet instead.
Could some one provide me a working example. This is my code now:
...ANSWER
Answered 2020-Sep-02 at 11:20I had to include the leaflet-pegman js file in the head
of the UI for it to work. I also edited the link in the htmlDependency
as it wasn't referencing the correct link.
This code works for me now:
QUESTION
Using the google_directions
function from googleway
package, it does not display the travel time according to google maps browser search.
It seems that it is not taking into account the traffic information.
Example on a busy street in New York.
...ANSWER
Answered 2019-Dec-04 at 15:53The googleway
documentation for google_directions
covers this. To get real-time data, you need the following:
- a
departure_time
, either current using"now"
or a specified future time using aPOSIXct
datetime. traffic_model
: Whether Google's guess should bebest_guess
,optimistic
, orpessimistic
.
You asked for a historical travel time with your code, while Google Maps use the real-time travel time (likely the best_guess
estimate).
The Google documentation states:
best_guess
(default) indicates that the returnedduration_in_traffic
should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic. Live traffic becomes more important the closer thedeparture_time
is to now.
Try this instead:
QUESTION
I've a data frame with locations and I want to append phone numbers and websites to them from Google Places in a pipeable solution.
The closest I've gotten to doing this was using googleway
, unlisting the JSON and using regexes to extract the place id, and doing the same again for the phone numbers and email addresses. Is there a more targeted way of doing this?
ANSWER
Answered 2019-Jun-12 at 16:56I doubt there is. It is a two step process at the side of Google API (see the documentation: https://developers.google.com/places/web-service/details):
You need to :
- get the unique
placeid
(via Place Search call) - get the contact details for your
placeid
(via Place Details call)
You might have more control over the process if you pasted your url yourself and executed it via httr (the Google API is known for breaking changes, and hard for R packages to keep pace with) and you can wrap the ugly piece of code in your own function, making the call tidy - but ultimately it will have to be 2 API calls.
QUESTION
I have read Batch Geocoding with googleway R
I am attempting to geocode some addresses using googleway. I want the geocodes, address, and county returned back.
Using the answer linked to above I created the following function.
...ANSWER
Answered 2018-Jul-26 at 17:10Ok, I'll answer it myself.
Begin with a dataframe of addresses. I called mine "addresses" and the singular column in the dataframe is also called "Addresses" (note that I capitalized it).
Use googleway to get the geocode data. I did this using apply to loop across the rows in the address dataframe
QUESTION
In this df I have latitute, longtitude and datetime and I want to calculate the timezone for that specific location for that specific time.
...ANSWER
Answered 2019-Apr-07 at 20:42Here is one option to convert to numeric
and extract the time zone base don the TimeZone API
from google
QUESTION
I am trying to put a shinydashboard
together and have a Google Places Search box as a text input. The code below runs in a regular shiny
page, but throws an InvalidValueError: not an instance of HTMLInputElement
error when it's put into a shinydashboard
. (See image below)
I'm not sure why it would work in a regular shiny
app but not inside a shinydashboard
.
Minimal reproducible code example:
Note: Plug in your Google API key first
...ANSWER
Answered 2019-Feb-26 at 19:51The only way I have been able to do this is by taking all the logic behind rendering the sidebarMenu out of the server.R
file and putting it into the ui.R
file.
The final working solution is this:
QUESTION
I need to save the as image (.jpg, .png) the result from google_streetview API
I'm working in a small project to test an image recognition algorith. I'm downloading some images from google street, I need to save this images as .jpg or .png format.
...ANSWER
Answered 2019-Feb-05 at 16:04This is a bit of a guess since I don't have an API key.
This is the last bit of google_streetview
function:
QUESTION
I have 2 data frames with the geocoded locations of several hospitals within the United States. I would like to plot these locations as markers with two different colors for each set of hospitals from each data frame. I am using the R googleway library and I can get the first set of hospitals to plot okay with a default red colored marker but when I try to change the color of the marker by defining the colour variable with the column names "col", I get the following error message "Error in markerColourIconCheck(data, objArgs, colour, marker_icon) : colours must be either red, blue, green or lavender"
The column "col" is "green" in every row. I tried filling in the hexadecimal color for green in the column "col" as well. so this piece of code works with red markers
...ANSWER
Answered 2018-Dec-18 at 19:34I just ran this code and it worked
QUESTION
Not sure why I keep getting this error:
Error in value[3L] : There was an error downloading results. Please manually check the following URL is valid by entering it into a browswer. If valid, please file a bug report citing this URL (note: your API key has been removed, so you will need to add that back in)
...ANSWER
Answered 2018-Nov-06 at 23:15You want to check that you don't have any illegal or reserved characters in your addresses, since any geocoding functions will be using your text to create URLs to query the geocoding API. google_geocode
on its own doesn't give a very helpful error message, but by looking at the URL you posted above, the error message shows that the required parameters weren't included.
In this case, #
has a special meaning in URLs, so you'll get an error. FYI, my Google API key is saved as the environment variable GOOGLE_KEY
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install googleway
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page