【问题标题】:Problems creating plot with boxcox using rapache module function使用 rapache 模块功能使用 boxcox 创建绘图的问题
【发布时间】:2011-08-06 05:20:45
【问题描述】:

我正在尝试使用 MASS 包中的 boxcox 函数创建绘图。

但它正在创建一个 rapache 错误。

r代码:

<%
  csvDF<- read.csv(GET$name1, header=TRUE)
  a<-lm(csvDF[,GET$col_variable]~1)
  require(MASS)

  filename1 <- paste(tempfile(tmpdir='/var/www/images'), '.png', sep='')
  png(filename1)
  bx<-boxcox(a)
  dev.off() 
%>

**GET$name1 是 csv 数据文件地址。 **GET$col_variable 是变量列。

当我丢失“bx

这里是 rapache 错误:

RApache Warning/Error!!!

Error in eval(expr, envir, enclos) : object 'csvDF' not found
RApache Warning/Error!!!

In addition:
RApache Warning/Error!!!

Warning messages:
RApache Warning/Error!!!

1: In readLines(icon, 1) : incomplete final line found on '/var/www/brew/sampleplan/step5_box_cox.php'
RApache Warning/Error!!!

2: In readLines(icon, 1) : incomplete final line found on '/var/www/brew/sampleplan/step5_box_cox.php'
RApache Warning/Error!!!

3: In readLines(icon, 1) : incomplete final line found on '/var/www/brew/sampleplan/step5_box_cox.php'
RApache Warning/Error!!!

4: In readLines(icon, 1) : incomplete final line found on '/var/www/brew/sampleplan/step5_box_cox.php'
RApache Warning/Error!!!

5: In readLines(icon, 1) : incomplete final line found on '/var/www/brew/sampleplan/step5_box_cox.php'
RApache Warning/Error!!!

Function brew returned an object of 'try-error'. Returning HTTP response code 500. 

如有任何建议,我将不胜感激。

【问题讨论】:

    标签: r rapache


    【解决方案1】:

    很难给出完整的答案,因为您的整个设置不可用。错误消息(与警告相反;稍后再担心)是变量csvDF 未找到。目前尚不清楚此错误是在您调用read.csv 之前还是之后发生的。不管怎样,问题不在于调用boxcox。

    还要注意lm 有一个数据参数,可以使您的代码更清晰。尝试类似

    lm_formula <- as.formula(paste(col_variable, "1", sep = "~"))
    a <- lm(lm_formula, data = csvDF)
    

    您还可以从分离读取数据、计算统计数据、创建绘图和将绘图写入文件的代码中受益。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-03
      • 2021-04-23
      • 2021-04-02
      • 1970-01-01
      • 1970-01-01
      • 2021-12-16
      • 2022-07-06
      • 1970-01-01
      相关资源
      最近更新 更多