Use R to impose bubble data on an image - r

I want to take an image, like this:
And I want to superimpose data bubbles on it, so it would look like this:
I want to do this in R (because I know R)
Let's imagine the bubbles represent IQ (or whatever) and I have the relevant numbers in a spreadsheet next to the species. How do I get ggplot (let's say) to know where on the image to put the bubbles?
Thank you!

Related

Determine the proportion of the data information in r

Suppose i have a plot like the following:
I want to get the portion of the data where the majority (say 90%) of the data lay, for example, i want to isolate the plot into something like:
in which the points lay in the black frame contributes to (90%) of the data.
How can i do this in R?
Edited for comment:
What if i have the following plot:? the majority part probably start from 0.

Map image into matrix in R to 3d Print

We have an image like this:
Where I have a skull, and the raw counts of how many bones were broken in each area of the skull.
I also have a 3d printer and can make things like this:
Which was made in R using a matrix and the r2stl package.
What I want to do is map the x's and y's of that skull into certain locations of a matrix so that I could add the raw counts to those cells and 3d print that skull in a way where each portion of the skull would be higher based on how many fractures were in that location. Thoughts? It didn't seem like an example where an example dataset would be useful, I apologize if I should have included that.

R: interact with customized XML map

A Stack Overflow discussion here (How to make a heat map in R based on a gif of the human body?) describe how to plot a map for different part of human body in R.
I want to make the plot more interactive, i.e. if I move the cursor to the torso, I want to see a message "torso".
In other words, what I want to do is similar to the "identify" function for scattor plot, but is for plots generated from XML.
Another example for what I would like to achieve is: https://plot.ly/r/choropleth-maps/
Thanks!

R - getting box plot to work

boxplot(data=max_urkoma[[2]])
I have a data set max_urkoma[[2]] that I'd like to put into a box plot, but it won't show at all unless I give it the formula max_urkoma[[1]]~max_urkoma[[2]], and then it'll basically just become a set of points on a plot. What am I doing wrong? The plot is acting like every item in the data set is a separate object, I want them grouped together like in this one:
http://onlinestatbook.com/2/graphing_distributions/graphics/figure4.jpg
THis is how mine looks like http://imgur.com/F2fYPMY
To get a single boxplot, you can do boxplot(mtcars$mpg), or with your data it looks like you need boxplot(max_urkoma[[2]]).

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