Plot timezones over the world map in R - r

Hi folks: could anyone give me some hints about plotting timezones grid using polygons over the world map in R? I use maps to get the world layout, but where to get coordinates of timezones polygons?
Ultimately, I would love to get something like this, coloring timezones according to some values from my analyses. Thank you!

If your question is just where to get time zone shapefiles for plotting, then you can get some from http://efele.net/maps/tz/world/.

Related

Struggling creating a choropleth world map with one country being an outlier

I am new to stack overflow and r studio in general so please forgive me for any mistakes I might make when trying to ask my question.
I am trying to create a world map that displays my countries by their transaction value. This is what my data looks like:
I have 86 different countries total.
This is what I have attempted so far:
And I got this:
Clearly, this is not a good representation of the data because the United States is an outlier. I am not sure how to properly construct a map colored by my values that I want, and to make it actually useful. I do not care what map function or package to use (like ggplot or country_choropleth). I am just stuck on how to deal with the outlier in the coloring scheme and what other options I can do to make my map of 86 countries look nice. Thank you ahead of time for the help.

Create land surface temperature map in R

I have a csv file containing latitude, longitude and temperature for san joaquin valley. I want to plot the latitude and longitude on the y and x axes respectively.I want to use the google base map. The temperature at a particular latitude and longitude should be plotted as a surface map like shown in the image below.
Please guide me to achieve the output as shown in the picture.
http://i.stack.imgur.com/r8loG.png
Thank you so much.
You can very easily use ggvis to make the type of map that you want. You will need more than just lat and lon to make it happen if you are looking ot have some kind of color transition based on a prevalence of some kind. It may be in another column and tied to your labeling method.
Here is a solid site to help you get started.
ggvis mapping
Work through the examples to figure out what is happening beneath the code before you dive right into your own unless you are very familiar with R and the ggvis environment.
Without a starting code base, no one is going to be able to help you more than this...get started and then ask more specific questions.

How to make grids on maps plotted using ggmap in R

Please pardon me if this is a redundant question. I am new to R. I was going through this post- http://www.r-bloggers.com/mapping-gps-tracks-in-r/. It maps the gps tracks in R using ggmap. My question is that, once we have the final map, is it possible to put grids on it? If yes, how to do it?
EDIT- Ok let me rephrase my question... suppose I have plotted some gps coordinate on a map. Then how to put grid over it? Let me take the example of one of the question already solved here at stack overflow by Cory: Plotting GPS coordinates using ggmap
Here`s the final map:-
Now my question is how to get a grid structure on this map?
TIA!
TIA!
Regards,
Lesnar

Plotting Long and Latitude in R

I would like to know how to plot latitude and longitude readings in R.
Drive Route:
I want something like the above image. The route is for a street in Nigeria and the lat/long readings were obtained from a GPS. The plot was done with MapInfo but I would appreciate if someone can show me how it is done in R. I am still a newbie in R.
I agree with Andy on doing some more research before asking questions, but to get you started I would suggest you have a look at the ggplot2 and ggmap package combination. Which can be used to set up maps and plot gps locations on these maps.
I mainly use it to plot sample locations, but I guess you could also use it to plot routes/lines.

Using R for extracing data from colour image

I have a scanned map from which i would like to extract the data into form of Long Lat and the corresponding value. Can anyone please tell me about how i can extract the data from the map. Is there any packages in R that would enable me to extract data from the scanned map. Unfortunately, i cannot find the person who made this map.
Thanks you very much for your time and help.
Take a look at OCR. I doubt you'll find anything for R, since R is primarily a statistical programming language.
You're better off with something like opencv
Once you find the appropriate OCR package, you will need to identify the x and y positions of your characters which you can then use to classify them as being on the x or y axis of your map.
This is not trivial, but good luck
Try this:
Read in the image file using the raster package
Use the locator() function to click on all the lat-long intersection points.
Use the locator data plus the lat-long data to create a table of lat-long to raster x-y coordinates
Fit a radial (x,y)->(r,theta) transformation to the data. You'll be assuming the projected latitude lines are circular which they seem to be very close to but not exact from some overlaying I tried earlier.
To sample from your image at a lat-long point, invert the transformation.
The next hard problem is trying to get from an image sample to the value of the thing being mapped. Maybe take a 5x5 grid of pixels and average, leaving out any gray pixels. Its even harder than that because some of the colours look like they are made from combining pixels of two different colours to make a new shade. Is this the best image you have?
I'm wondering what top-secret information has been blanked out from the top left corner. If it did say what the projection was that would help enormously.
Note you may be able to do a lot of the process online with mapwarper:
http://mapwarper.net
but I'm not sure if it can handle your map's projection.

Resources