Hello, Can someone please help me make 3d plot video? I prepared a 3D plot and i dont know why actual sample names are missing on the plot and also can i record this as a video.
Here is my 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"
colnames(df)[25] = "Starchy"
colnames(df)[26] = "Cardboard"
colnames(df)[27] = "Umami"
colnames(df)[28] = "Beany"
colnames(df)[29] = "Cooked"
colnames(df)[30] = "Earthy"
colnames(df)[31] = "Musty-earthy"
colnames(df)[32] = "Egg"
colnames(df)[33] = "Sweet"
colnames(df)[34] = "Salt"
colnames(df)[35] = "Metallic"
colnames(df)[36] = "Bitter"
colnames(df)[37] = "Astringent"
colnames(df)[38] = "Nutty"
colnames(df)[39] = "O Sweet Impr"
colnames(df)[40] = "Vegetable complx"
colnames(df)[41] = "Raw potato peel"
colnames(df)[42] = "Sweet potato"
colnames(df)[43] = "Cauliflower"
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, show.bbox = TRUE)
#> Error in pca3d(pca, show.labels = T, show.bbox = TRUE): unused argument (show.bbox = TRUE)
#adding box around
Created on 2020-10-01 by the reprex package (v0.3.0)
Here is data:
squads <- 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, ~Vegetable.complex_AR,
"Russian Banana", 6, 0, 9, 4, 2, 1.5, 3.5, 0, 9, 4, 6, 3.5, 4, 3L, 2L, 0,
"Vermillion", 0, 1.5, 9, 8, 0, 0, 4, 0, 9, 0, 6, 4, 3.5, 0L, 0L, 0,
"Masquerade", 6, 0, 12, 11, 0, 0, 4, 0, 7.5, 0, 3, 2.5, 3, 0L, 0L, 0,
"Rio Colorado", 1.5, 0, 11.5, 1.5, 1.5, 0, 0, 2, 7.5, 0, 4, 2.5, 2, 0L, 0L, 0,
"POR12PG28-3", 12, 0, 9.5, 9, 2, 0, 0, 2.5, 8, 2, 4, 3, 3, 0L, 0L, 0,
"Valery", 13, 0, 9, 12, 0, 2, 0, 0, 5, 0, 2, 2, 0, 0L, 0L, 0,
"CO99076-6R", 2, 0, 12, 12.5, 0, 0, 0, 0, 8.5, 2.5, 4, 2.5, 3, 0L, 0L, 0,
"CO05068-1RU", 1.5, 0, 11, 12, 0, 0, 0, 0, 8, 2, 5, 2.5, 3, 0L, 0L, 2.5,
"Canela Russet", 2, 0, 12, 12, 0, 0, 2.5, 0, 7.5, 0, 4, 2.5, 3, 0L, 0L, 2,
"AC99330-1P/Y", 11, 0, 11, 9, 2, 1.5, 0, 0, 9, 0, 6, 1.5, 3.5, 2L, 0L, 0,
"Atlantic", 2.5, 0, 11, 12, 0, 0, 0, 2, 7, 2, 3.5, 3, 2.5, 0L, 0L, 0,
"Purple Majesty", 0, 7, 11, 11, 1.5, 0, 3.5, 0, 8.5, 0, 4, 3.5, 2.5, 0L, 0L, 0
)
heads(squads)
#> Error in heads(squads): could not find function "heads"
Created on 2020-10-01 by the reprex package (v0.3.0)