You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I am experiencing the following issue:
I have pca results from a huge dataset but I want to display only a portion of the labels in a scoreplot (p$rotation object); I wiah to display only labels extracted from a clustering procedure so a subset of rownames(p$rotation ) belonging to let say cluster X.
here a toy example (still not working)
data(iris)
Perform PCA on the iris dataset (excluding the species column)
Subset of rows to plot (for example: points 1, 50, and 100)
subset_indices <- c(1, 50, 100)
biplot(pca_result,
lab = rownames(iris[, 1:4]), # Pass all labels from the full dataset
selectLab = subset_indices, # Only label the subset of points (indices)
showLoadings = TRUE, # show variable loadings
colby = iris$specie, # Optionally color by metadata column
shape = iris$specie, # Optionally shape by metadata column
pointSize = 5, # Customize point size
legendPosition = 'right')
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, :
arguments imply differing number of rows: 4, 150
I am working with rstudio associated to R4.4.1 and with latest version of PCA tools
Thanks in advance for your advice. Kind regards, Maria
The text was updated successfully, but these errors were encountered:
Hello I am experiencing the following issue:
I have pca results from a huge dataset but I want to display only a portion of the labels in a scoreplot (p$rotation object); I wiah to display only labels extracted from a clustering procedure so a subset of rownames(p$rotation ) belonging to let say cluster X.
here a toy example (still not working)
data(iris)
Perform PCA on the iris dataset (excluding the species column)
pca_result <- pca(iris[, 1:4], metadata = iris$specie)
Subset of rows to plot (for example: points 1, 50, and 100)
subset_indices <- c(1, 50, 100)
biplot(pca_result,
lab = rownames(iris[, 1:4]), # Pass all labels from the full dataset
selectLab = subset_indices, # Only label the subset of points (indices)
showLoadings = TRUE, # show variable loadings
colby = iris$specie, # Optionally color by metadata column
shape = iris$specie, # Optionally shape by metadata column
pointSize = 5, # Customize point size
legendPosition = 'right')
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, :
arguments imply differing number of rows: 4, 150
I am working with rstudio associated to R4.4.1 and with latest version of PCA tools
Thanks in advance for your advice. Kind regards, Maria
The text was updated successfully, but these errors were encountered: