我在 R 中看不到我的观点

I cannot see the plot of my points in R

我正在尝试使用 R 语言绘制 u 向量。 我通过将 SVD 应用于一些训练数据获得了 U。 我已经为 tm 和 ggplot2 下载了有用的库。 我想绘制向量 U 的二维,它由 Dokument Terms 矩阵的 SVD 产生。这是通过我的训练数据得到的 这是我的代码:

#Read the training files:
#load the text mining package
library(tm)
library(ggplot2)


#Load the names of the training documents
myfiles = DirSource("C:\Users\Sondos\Downloads\HW-07-data\HW-07-data\training",pattern="^c.*")
#create a corpus and read the files
training=Corpus(myfiles )
# to get an impression of the training object type
training
# to get a deeper look into the documents type
#inspect(training)
#to convert the documents to a document term matrix use
dtm = DocumentTermMatrix(training,control=list(tolower=F))

m = as.matrix(dtm)

s=svd(m)
#store vector U 
k = s$u


plot.new()
points(1:length(k2), k2)

问题是我看不到剧情。 有人对此有想法吗?

points 向现有地块添加点。尝试 plot(k2)。应该不需要显式调用 plot.new