pca3d plot customization and package rgl use?

Hello, I made a 3D plot in pca3d and i want to customize it, so if i should use rgl or some other package. And also i want to save this 3D plot as a movie.

df <- tibble::tribble(
             ~SampleName, ~Yellow_A, ~Purple_A, ~Dullness_A, ~Smoothness_A, ~Gritty_A, ~SweetAromatics_AR, ~MustyEarthy_AR, ~Beany_AR, ~Potato_AR, ~Earthy_AR, ~Cooked_AR, ~Cardboard_AR, ~Umami_AR, ~Metallic_AR, ~Buttery_AR,
        "Russian Banana",         6,         0,           9,             4,         2,                1.5,             3.5,         0,          9,          4,          6,           3.5,         4,           3L,          2L,
            "Vermillion",         0,       1.5,           9,             8,         0,                  0,               4,         0,          9,          0,          6,             4,       3.5,           0L,          0L,
            "Masquerade",         6,         0,          12,            11,         0,                  0,               4,         0,        7.5,          0,          3,           2.5,         3,           0L,          0L,
          "Rio Colorado",       1.5,         0,        11.5,           1.5,       1.5,                  0,               0,         2,        7.5,          0,          4,           2.5,         2,           0L,          0L,
           "POR12PG28-3",        12,         0,         9.5,             9,         2,                  0,               0,       2.5,          8,          2,          4,             3,         3,           0L,          0L,
                "Valery",        13,         0,           9,            12,         0,                  2,               0,         0,          5,          0,          2,             2,         0,           0L,          0L,
            "CO99076-6R",         2,         0,          12,          12.5,         0,                  0,               0,         0,        8.5,        2.5,          4,           2.5,         3,           0L,          0L,
           "CO05068-1RU",       1.5,         0,          11,            12,         0,                  0,               0,         0,          8,          2,          5,           2.5,         3,           0L,          0L,
         "Canela Russet",         2,         0,          12,            12,         0,                  0,             2.5,         0,        7.5,          0,          4,           2.5,         3,           0L,          0L,
          "AC99330-1P/Y",        11,         0,          11,             9,         2,                1.5,               0,         0,          9,          0,          6,           1.5,       3.5,           2L,          0L,
              "Atlantic",       2.5,         0,          11,            12,         0,                  0,               0,         2,          7,          2,        3.5,             3,       2.5,           0L,          0L,
        "Purple Majesty",         0,         7,          11,            11,       1.5,                  0,             3.5,         0,        8.5,          0,          4,           3.5,       2.5,           0L,          0L
        )
head(df)
#> # A tibble: 6 x 16
#>   SampleName Yellow_A Purple_A Dullness_A Smoothness_A Gritty_A SweetAromatics_~
#>   <chr>         <dbl>    <dbl>      <dbl>        <dbl>    <dbl>            <dbl>
#> 1 Russian B~      6        0          9            4        2                1.5
#> 2 Vermillion      0        1.5        9            8        0                0  
#> 3 Masquerade      6        0         12           11        0                0  
#> 4 Rio Color~      1.5      0         11.5          1.5      1.5              0  
#> 5 POR12PG28~     12        0          9.5          9        2                0  
#> 6 Valery         13        0          9           12        0                2  
#> # ... with 9 more variables: MustyEarthy_AR <dbl>, Beany_AR <dbl>,
#> #   Potato_AR <dbl>, Earthy_AR <dbl>, Cooked_AR <dbl>, Cardboard_AR <dbl>,
#> #   Umami_AR <dbl>, Metallic_AR <int>, Buttery_AR <int>

Created on 2020-08-07 by the reprex package (v0.3.0)
Here is code:

library(FactoMineR)
library(Factoshiny)
#> Warning: package 'Factoshiny' was built under R version 4.0.2
#> Loading required package: shiny
#> Warning: package 'shiny' was built under R version 4.0.2
#> Loading required package: FactoInvestigate
#> Warning: package 'FactoInvestigate' was built under R version 4.0.2
#> Loading required package: ggplot2
library(factoextra)
#> Warning: package 'factoextra' was built under R version 4.0.2
#> Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa
library(ggpubr)
#> Warning: package 'ggpubr' was built under R version 4.0.2
library(corrplot)
#> Warning: package 'corrplot' was built under R version 4.0.2
#> corrplot 0.84 loaded
library(pca3d)
#> Warning: package 'pca3d' was built under R version 4.0.2
df <- read.csv("F:/mfa_file.csv", stringsAsFactors = F)
colnames(df)[1] = "sample_name"
colnames(df)[23] = "O Potato ID"
colnames(df)[24] = "Raw Potato"
df1 <- subset(df, select = c(1,23:31,34:41,43))
df2 <- df1[,-1]
df4 <- subset(df, select = c(1,7:22))
df5 <- df4[,-1]
res.pca <- prcomp(df5, scale = F)
fviz_eig(res.pca)

rownames(res.pca$x) <- df1$sample_name
library(rgl)
#> Warning: package 'rgl' was built under R version 4.0.2
pca <- prcomp(df2, scale. = F)
pca3d(pca, show.labels = T)
#> [1] 0.11397032 0.08319438 0.06651207
#> Creating new device

Created on 2020-08-07 by the reprex package (v0.3.0)

I found this page for rgl:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.