简体   繁体   English

match.arg(opt_crit)中的错误:“ arg”必须为NULL或字符向量

[英]Error in match.arg(opt_crit) : 'arg' must be NULL or a character vector

Error in match.arg(opt_crit) : 'arg' must be NULL or a character vector match.arg(opt_crit)中的错误:“ arg”必须为NULL或字符向量

occurs when trying to run my script in r. 尝试在r中运行我的脚本时发生。

I have tried to find the solution for it, but it seems to be pretty specific, and little help for me. 我试图找到解决方案,但是它似乎很具体,对我几乎没有帮助。

My dataset contains 3936 obs of 7 variables. 我的数据集包含3936个Obs,包含7个变量。

environment, skill, volume, datetime, year, month, day 环境,技能,数量,日期时间,年,月,日

Classes ‘tbl_df’, ‘tbl’ and 'data.frame':   3696 obs. of  7 variables:
 $ environment: chr  "b2b" "b2b" "b2b" "b2b" ...
 $ skill      : chr  "BO Bedrift" "BO Bedrift" "BO Bedrift" "BO Bedrift" ...
 $ year       : num  2017 2017 2017 2017 2017 ...
 $ month      : num  1 1 1 1 1 2 2 2 2 3 ...
 $ day        : num  2 9 16 23 30 6 13 20 27 6 ...
 $ volume     : num  360 312 305 222 113 ...
 $ datetime   : Date, format: "2017-01-02" "2017-01-09" "2017-01-16" "2017-01-23" ...

but when trying to run 但是当尝试跑步时

volume_ets <- volume_tsbl %>% ETS(volume)

this message shows in the console 此消息显示在控制台中

Error in match.arg(opt_crit) : 'arg' must be NULL or a character vector

I tried somewhat of a shortcut, but nothing helped, 我尝试了一些捷径,但没有任何帮助,

volume_tsbl$volume <- as.numeric(as.character(volume_tsbl$volume))

Tried to run 试图运行

volume_ets <- volume_tsbl %>% ETS(volume)

this message shows in the console 此消息显示在控制台中

Error in match.arg(opt_crit) : 'arg' must be NULL or a character vector

I tried somewhat of a shortcut, but nothing helped, 我尝试了一些捷径,但没有任何帮助,

volume_tsbl$volume <- as.numeric(as.character(volume_tsbl$volume))

volume_ets <- volume_tsbl %>% ETS(volume)

my tsibble looks like this; 我的小舌看起来像这样;

volume_tsbl <- volume %>¤ as_tsibble(key = c(skill, environment), index = c(datetime), regular = TRUE )

Expected the code to run, but it does not. 希望代码能够运行,但事实并非如此。

This is the result of an interface change made in late 2018. The change was to make model functions (such as ETS() ) create model definitions, rather than fitted models. 这是在2018年末对接口进行更改的结果。更改是使模型函数(例如ETS() )创建模型定义,而不是拟合模型。 Essentially, ETS() no longer accepts data as an input, and the specification for the ETS model would become ETS(volume) . 本质上, ETS()不再接受数据作为输入,并且ETS模型的规范将变为ETS(volume)

The equivalent code in the current version of fable is: 当前寓言版本中的等效代码为:

volume_ets <- volume_tsbl %>% model(ETS(volume))

Where the model() function is used to train one or more model definitions ( ETS(volume) in this case) to a given dataset. 使用model()函数将一个或多个模型定义(在这种情况下为ETS(volume)训练到给定数据集。

You can refer to the pkgdown site for fable to see more details: http://fable.tidyverts.org/ In particular, the ETS() function is documented here: http://fable.tidyverts.org/reference/ETS.html 您可以参考pkgdown网站获取寓言,以了解更多详细信息: http ://fable.tidyverts.org/特别是ETS()函数在此处记录: http : //fable.tidyverts.org/reference/ETS。 html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 警告:match.arg中的错误:&#39;arg&#39;必须为NULL或字符向量 - Warning: Error in match.arg: 'arg' must be NULL or a character vector match.arg(regions) 中的错误:“arg”必须为 NULL 或字符向量 - Error in match.arg(regions) : 'arg' must be NULL or a character vector Shiny 应用程序中的“match.arg(position) 错误:‘arg’必须为 NULL 或字符向量” - "Error in match.arg(position) : 'arg' must be NULL or a character vector" in Shiny app match.arg(p.adjust.method)中的错误:“ arg”必须为NULL或字符向量 - Error in match.arg(p.adjust.method) : 'arg' must be NULL or a character vector match.arg(position) 中的闪亮错误:“arg”必须为 NULL 或字符向量 - shiny Error in match.arg(position) : 'arg' must be NULL or a character vector 运行应用程序时出现闪亮错误:match.arg(position) 中的错误:&#39;arg&#39; 必须为 NULL 或字符向量 - Shiny Error when running App: Error in match.arg(position) : 'arg' must be NULL or a character vector 尝试运行以下代码中的插补函数时,“match.arg(what) 中的错误:&#39;arg&#39; 必须为 NULL 或字符向量” - "Error in match.arg(what) : 'arg' must be NULL or a character vector" when trying to run the impute function in the below code match.arg(mvnTest)中的错误:“ arg”的长度必须为1 - Error in match.arg(mvnTest) : 'arg' must be of length 1 &#39;arg&#39;必须为NULL或字符向量 - 'arg' must be NULL or a character vector 对多个 arguments 使用 match.arg 时出错 - Error in using match.arg for multiple arguments
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM