Space time 3d map - r

I would like to plot 3d spheres over a map in specific points.
Radious of the spheres measures my variable in one time.
I have x,y for east and north axis in UTM projection.
In z is the time and I have 2 observations in 4 positions of my map.
I want to present how changed my variable in the space and time.
The image I have in Shapefile or Geotiff format.
I saw another 3d plot similar to this one but not with maps.
Example 1
Example 2
My plot should be like this one:

Related

How to combine multiple 2D R plots into a single 3D plot

I am trying to stack multiple 2d plots into a single 3d plot in R.
For example, I want to try and put these plots
into a single 3d image. The z axis would be the biomass density, y axis be the size and the x axis be the time step (and then hopefully I could use a surface plot to join up all the lines). My aim is to try and show the wave travelling through the size over a long period of time instead of showing lots of images.
Does anyone know how to do this?

Find centre location coordinates in R - geospatial analysis

I am trying to find the centre coordinates of high-density areas in R.
The dataset I have has about 1.5million rows and looks like this (dummy data)
LATITUDE LONGITUDE val
1 35.83111 -90.64639 359.1
2 42.40630 -90.31810 74.5
3 40.07806 -83.07806 115.4
4 40.53210 -90.14730 112.0
5 42.76310 -84.76220 118.4
6 39.29750 -87.97460 134.4 ...
...
After plotting it using ggmap and ggplot using the command
ggmap(UK_Map) +
geom_density2d(data=processedSubsetData,aes(x=processedSubsetData$Longitude,y=processedSubsetData$Latitude), bins=5) +
stat_density2d(data=processedSubsetData,aes(x=processedSubsetData$Longitude,y=processedSubsetData$Latitude,fill=..level.., alpha=..level..), geom='polygon')
I have the visualization which looks like below image.
As you can see from the image, there some high-density areas. I need to find the local centre coordinates of these high-density areas in the map.
I have tried calculating distance between the points and also rounding the coordinates to group them. But I am not able to make it work and is stuck.
Thanks

overlaid scatter plot where each data point has a different color and shape

I want to visualize a data transformation. My data is in 2 dimensions and the transformation is in 3 dimensions. I am interested in seeing how each data point is transformed in the higher dimensions. So overlaid two scatter plots using scatterplot3d package. The data which is in 2 dimensions has third coordinate assigned as 0 for plotting purposes. To keep track of each datapoint, I want to assign a unique color and shape in 2D and the transformed data value will have same color and shape in 3D. I was able to assign unique color but not shape since shapes are limited(my n=50). Any idea to make this visualization better ? Here is my reproducible example.
install.packages("scatterplot3d")
library(scatterplot3d)
set.seed(20)
# example
M<-cbind(a=runif(50),b=runif(50),c=rep(0,n))
N<-cbind(d=rnorm(50),e=rnorm(50),f=rnorm(50))
s3d<-scatterplot3d(N[,1],N[,2],N[,3],color=rainbow(n),type="p",pch=0
,xlab="x",ylab="y ",zlab="z")
s3d$points3d(M[,1],M[,2],M[,3],col=rainbow(n),type="p",pch=15)

Divide Voronoi cell using azimuth in R

I have generated a Voronoi tessellation for N number of points in 2D space using the deldir R package.
Now I want to divide each Voronoi cell into three Voronoi cells according to given azimuth described as below:
Azimuth is given as an input. E.g.: azimuth = 0 means an area should be separated by 2 lines at angle = 0 to angle = 120. Next area by angle = 120 to angle = 240 and last area is the remainder.
Azimuth is the starting angle from north for this separation and always it spans 120 degrees. In more detail, from each point Voronoi is generated exactly three lines are drawn dividing previous Voronoi cell into three Voronoi cells.
Can this be achieved using the deldir package? if not can anyone suggest a extension for this?
I don't know any easy/implemented way of doing this. However, you could try creating those lines manually.
I would try something along the lines of:
Access the coordinates of the edges of a voronoi polygon using deldir()
Convert the coordinates into line objects using the sp package
Create line objects that reach from the "center"-point to the border of the plot (calculating the end points based on your azimuth)
Find intersections of the lines created in 3 with the lines created in 2 (check How to get the intersection point of two vector?)
Create new (shorter) lines starting from your original point and ending at the intersection point retrieved from step 4.
Plot the lines created in 5.
Loop for every polygon
This may well be a very clumsy solution, but it is the only workaround I could come up with ;)

jfreechart xy series plot data points

In JFreechart xySeries I want to plot the lines using a very dense set of points in order to show curves with precision, however, I want to plot the points with less density. For example, I have 100 data points each one is 1 unit apart on the x axis, but I only want to plot the point every 5 unit. I do,however, want the lines to be connected every 1 unit in order to show the curve with high density.
Is this possible?
You can subclass XYLineAndShapeRenderer and override getItemShapeVisible(int series, int item).

Resources