Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssa(numeric_vector) raise an error. #238

Closed
MikhailZvagelsky opened this issue Oct 30, 2018 · 3 comments
Closed

ssa(numeric_vector) raise an error. #238

MikhailZvagelsky opened this issue Oct 30, 2018 · 3 comments

Comments

@MikhailZvagelsky
Copy link

MikhailZvagelsky commented Oct 30, 2018

I have R script test.r:

require(Rssa)
ssa(rep(c(1, 2, 3, 2), 100))

It works fine with R interpreter:

$ /Library/Frameworks/R.framework/Versions/3.3/Resources/bin/R
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)
 ........................
> require(Rssa)
Загрузка требуемого пакета: Rssa
Загрузка требуемого пакета: svd
Загрузка требуемого пакета: forecast

Присоединяю пакет: ‘Rssa’

Следующий объект скрыт от ‘package:stats’:

    decompose

> ssa(rep(c(1, 2, 3, 2), 100))

Call:
ssa(x = rep(c(1, 2, 3, 2), 100))

Series length: 400,     Window length: 200,     SVD method: eigen
Special triples:  0

Computed:
Eigenvalues: 50,        Eigenvectors: 50,       Factor vectors: 0

Precached: 0 elementary series (0 MiB)

Overall memory consumption (estimate): 0.08212 MiB
>

But I get an error when launch the script:

$ Rscript --version
R scripting front-end version 3.3.2 (2016-10-31)
$ Rscript --verbose /Users/mikhail.zvagelsky/programms/test.r
running
  '/Library/Frameworks/R.framework/Versions/3.3/Resources/bin/R --slave --no-restore --file=/Users/mikhail.zvagelsky/programms/test.r'

Загрузка требуемого пакета: Rssa
Загрузка требуемого пакета: svd
Загрузка требуемого пакета: forecast

Присоединяю пакет: ‘Rssa’

Следующий объект скрыт от ‘package:stats’:

    decompose

Ошибка в .setupMethodsTables(fdef, initialize = TRUE) :
  попытка получить слот "group" из объекта базового класса ("NULL") без слотов
Вызовы: ssa ... getMethodsForDispatch -> .getMethodsTable -> .setupMethodsTables
Выполнение остановлено

The Rscript uses exactly the same R binary.
Can you please suggest how to tame this error.

@asl
Copy link
Owner

asl commented Oct 30, 2018

Looks like Rscript does not import methods package by default.

Does require(methods) fix the issue?

@MikhailZvagelsky
Copy link
Author

Yes it resolves the issue!
Thank you Anton.

@MikhailZvagelsky
Copy link
Author

That is interesting.
Should the methods package be in dependences of Rssa?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants