0

I would like to create a 3d surface from a set of points (x,y,z) like this scenario simple R 3d interpolation/surface plot but using a specific interpolation method called pycnophylactic. There's a package called pycno with this method but I'm new in R and can't understand well how can I do it. Can anyone help me, provide a sample? My data is something like this:

x <- c(-19.915909,-19.918794,-19.914678,-1.991492,-19.916232)
y <- c(-43.942983,-43.943198,-43.940344,-43.942168,-43.939507)
z <- c(7.910,5.693,6.958,7.116,790.843)

Thanks in advance!

Community
  • 1
  • 1

1 Answers1

0

I used the "akima" package to interpolate the z variable. Here's how the 3D plot would look for your x, y and z.

dens <- akima::interp(x,y,z, duplicate = "mean")
plot_ly(x=dens$x,y=dens$y,z=dens$z) %>% add_surface()

enter image description here

Ajean
  • 5,528
  • 14
  • 46
  • 69
Tarun Parmar
  • 181
  • 13