Running examples in ‘vrmlgen-Ex.R’ failed
The error most likely occurred in:

> ### Name: cloud3d
> ### Title: Draw a 3D scatter plot
> ### Aliases: cloud3d
> ### Keywords: utilities misc
> 
> ### ** Examples
> 
> 
> 
> curdir <- getwd()
> outdir <- tempdir()
> setwd(outdir)
> 
> 
> # example 1: visualize random 3D input data
> mat <- matrix(runif(99, 0, 3), ncol = 3)
> 
> # create random class assignment vector with three classes
> y <- round(runif(33, 0, 2))
> y <- ifelse(y == 0, "class 1", ifelse(y == 1, "class 2", "class 3"))
> 
> # create ouput using numbers from 1 to length(y) as metalabels
> cloud3d(mat, labels = y, metalabels = 1:length(y), col.axis = "black",
+         col.lab = "blue", col.bg = "white", type = "vrml",
+         filename = "result.wrl", htmlout = "result.html")

Output file "result.wrl" was generated in folder /Volumes/Temp/tmp/Rtmp3L7D1C.
> 
> # show the output in a web-browser 
> # (VRML-plugin must be installed!)
> if(file.exists(paste("file://",file.path(outdir,
+                 "result.html"), sep = "")))
+ {
+   browseURL(paste("file://",file.path(outdir,
+                   "result.html"), sep = ""))
+ }
> 
> 
> # example 2: visualization of Edgar Anderson's Iris data
> # using density estimation contour surfaces (requires misc3-package!)
> irismat <- iris[,1:3]
> cloud3d(irismat, labels = iris[,5], vrml_showdensity = TRUE,
+         col.axis = "blue", col.lab = "black", lab.axis = colnames(irismat),
+         type = "vrml", filename = "result2.wrl", htmlout = "iris.html")
Loading required package: misc3d
tcltk DLL is linked to '/opt/R/arm64/lib/libtk8.6.dylib'
Error: package or namespace load failed for ‘misc3d’:
 .onLoad failed in loadNamespace() for 'tcltk', details:
  call: fun(libname, pkgname)
  error: Tcl/Tk libraries are missing: install the Tcl/Tk component from the R installer
Error in .vdensecalc(x, h = h, weights = weights, rawdata = rawdata, filename = filename) : 
  In order to draw contour surfaces, please first install the misc3d package!
Calls: cloud3d -> .vcloud -> .vdense -> .vdensecalc
Execution halted