r基线校正
我对编码和R的新手相对较新。我正在尝试对我拥有的拉曼数据进行基线校正。我的数据分为两行,一个x和y轴。我相信数据需要是矩阵,因此它不起作用的原因?我试图遵循各种指南以使其正常工作。这是代码。请尝试帮助我出错的地方。 SETWD链接到正确的位置,但已删除。
library(baseline)
library(inspectr)
library(spectrolab)
setwd("")
exam = read.delim("top.txt", header=F)
mattt = as.matrix(exam)
bc.irls = baseline(mattt["spectra"][1,, drop=FALSE])
#bl3 <- baseline(spectra(mattt), method = 'irls')
plot(bc.irls)
我关注的原始方法
# Load data
data(milk)
# The baseline() function is an S4 wrapper for all the different
# baseline correction methods. The default correction method
# is IRLS. Data must be organized as row vectors in a matrix
# or data.frame.
bc.irls <- baseline(milk$spectra[1,, drop=FALSE])
## Not run:
# Computationally heavy
plot(bc.irls)
谢谢!
I am relatively new to coding and R in general. I am trying to do baseline correction for Raman data I have. My data is in two rows, an x and y-axis. I believe that the data needs to be a matrix and thus the reason why it is not working? I have tried to follow various guides to get it working. This is the code. Please try and help me where I am going wrong. The setwd is linked to the correct place but have removed.
library(baseline)
library(inspectr)
library(spectrolab)
setwd("")
exam = read.delim("top.txt", header=F)
mattt = as.matrix(exam)
bc.irls = baseline(mattt["spectra"][1,, drop=FALSE])
#bl3 <- baseline(spectra(mattt), method = 'irls')
plot(bc.irls)
The original method I am following
# Load data
data(milk)
# The baseline() function is an S4 wrapper for all the different
# baseline correction methods. The default correction method
# is IRLS. Data must be organized as row vectors in a matrix
# or data.frame.
bc.irls <- baseline(milk$spectra[1,, drop=FALSE])
## Not run:
# Computationally heavy
plot(bc.irls)
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论