首页 > 编程知识 正文

log.error,errorlog有什么用

时间:2023-05-05 19:21:09 阅读:255893 作者:402

Error in xy.coords(x, y, xlabel, ylabel, log) :  'x' and 'y' lengths differ

目录Error in xy.coords(x, y, xlabel, ylabel, log) :  'x' and 'y' lengths differ问题:解决:

完整问题:

问题:

#两个向量长度不同

#define x and y variablesx <- c(2, 5, 5, 8)y <- c(22, 28, 32, 35, 40, 41)#attempt to create scatterplot of x vs. yplot(x, y) 解决:

#数据长度对等,以x为基础

#define x and y variablesx <- c(2, 5, 5, 8)y <- c(22, 28, 32, 35, 40, 41)#create scatterplot of first 4 pairwise values of x vs. yplot(x, y[1:length(x)])

#把x序列补齐;

#define x and y variables to have same lengthx <- c(2, 5, 5, 8, 9, 12)y <- c(22, 28, 32, 35, 40, 41)#confirm that x and y are the same lengthlength(x) == length(y)[1] TRUEcreate scatterplot of x vs. yplot(x, y)

> #define x and y variables
> x <- c(2, 5, 5, 8)
> y <- c(22, 28, 32, 35, 40, 41)

> #attempt to create scatterplot of x vs. y
> plot(x, y)
Error in xy.coords(x, y, xlabel, ylabel, log) : 
  'x' and 'y' lengths differ

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。