有用的话,请采纳哇,这对我很重要!!!
# 打开文件 file <- file("data.txt", "r") # 读取文件中的数据 data <- scan(file, what = numeric(), nlines = 1, sep = " ") # 关闭文件 close(file) # 输出读取到的数据 print(data)