To get the most out of this community, you should e familiar with this post:
First and foremost, please ask!
A core goal of community is to be a friendly place to chat about topics related to data science, R, and RStudio.
We know that posting to technical forums can be intimidating. But know that many here would love to see you overcome your inhibition and engage with us.
Here are a few tips some folks here think might be helpful.
Before you post
Check Out R Documentation - R has built in documentation on packages and functions .
For example typing ?lm into your R console will open the documentation on the lm function .
Search - Be sure to search for the basic keywords of your question with your favorite search engine, Stack Overflow, and R-Help. Stack Overflo…
To know how to create a REPR oducible EX ample (reprex), please go through the following post:
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.…
Now, I can create what you want quite easily with the plot3Drgl
package as follows:
# loading library
library(plot3Drgl)
# simulating co-ordinates
sim_x <- rnorm(n = 100)
sim_y <- rnorm(n = 100)
sim_z <- rnorm(n = 100)
# plotting 3D scatterplot
scatter3Drgl(x = sim_x,
y = sim_y,
z = sim_z,
colvar = NULL)
I don't know how to upload an interactive plot here. If you run this, you'll get a new window where you will be able to rotate, zoom, etc. You can explore more options from the documentation.
Note that, I only plotted the points, instead of joining them. I didn't quite understand how did you plot your diagram. One of the points (labelled Sada-Melik
or something like that) is connected to two points, which makes me think that you may be plotting vertices and edges separately. If you want to plot a graph, I think igraph
package will be useful, but I haven't used it much.
Hope this helps.