簡體   English   中英

您好,我想通過我在 R 中的數據集創建 tsne plot。 但是當我寫命令時,我得到了這個錯誤

[英]hello i want create tsne plot by my dataset in R . but when i write commands i get this error

library(Rtsne)

setwd("n/g")

expression_data <- read.table(file = "zdata.matrix.xlsx", row.names = 1, sep=',', header = T)
meta_data <- read.table(file = "atac_v1_pbmc_10k_singlecell.xlsx", row.names = 1, sep=',', header = T)

tsne_realData <- Rtsne(expression_data, perplexity=10, check_duplicates = FALSE)

# Error in terms.formula(object, data = data) : 
#  '.' in formula and no 'data' argument

我簡要查看了Rtsne package 文檔和 Rtsne() function 要求數據格式為矩陣。 嘗試將 expression_data 轉換為矩陣,然后再將其傳遞給 Rtsne function。 你可以這樣做:

library(Rtsne)

setwd("n/g")

expression_data <- read.table(file = "zdata.matrix.xlsx", row.names = 1, sep=',', header = T)
meta_data <- read.table(file = "atac_v1_pbmc_10k_singlecell.xlsx", row.names = 1, sep=',', header = T)
expression_matrix <- as.matrix(expression_data)

tsne_realData <- Rtsne(expression_matrix, perplexity=10, check_duplicates = FALSE)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM