-2

i try to run a IRF analysis on a Data frame with 3 variables:

Time Series Data Frame

Where Model1 looks like this:

Model1

library(vars) and library(varEst) are used

However, when i try

plot(varp.irfs, plot.type="multiple")

following error appears:

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'plot': object 'varp.irfs' not found

Which refers to a missing object varp.irfs.

Also, if i try alternatives like:

plot(irf(Model1,n.ahead=10))

I get similar error message:

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'plot': no applicable method for 'irf' applied to an object of class "varest"
  • 1
    Can you provide some example data, package names, etc. to reproduce the error? – mri Oct 17 '22 at 13:32
  • 1
    Hello, StackOverflow is mainly english-speaking, which means that you're more likely to get some help if your error messages are in English. Check [this answer](https://stackoverflow.com/questions/13575180/how-to-change-language-settings-in-r) to know how to change language settings in R – bretauv Oct 17 '22 at 13:34
  • > plot(irf(Model1,n.ahead=10)) Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'plot': no applicable method for 'irf' applied to an object of class "varest" > – Säge Zwiebel Oct 17 '22 at 13:41
  • 1
    Your error message says some object isn't found—did you actually define it? Otherwise see the [guidance](https://stackoverflow.com/q/5963269/5325862) on making an example folks can help with – camille Oct 17 '22 at 14:02
  • 1
    If the problem was solved by changing the order of loading libraries, this should be closed as a typo, which I've voted to do. It shouldn't be answered (twice) to say that was the case, because that's the sort of thing you want to check in your first debugging steps and not that is likely useful to future users. But that's precisely why we ask for reproducible examples—we don't know what order you've loaded libraries in your code – camille Oct 17 '22 at 15:06

1 Answers1

-2

Solution - as expected was independent of any data examples. The library (vars) has to be loaded singularly, so no other libary uses same function. So disabling and enabling libraries in multiple code runs was the solution.

  • 1
    Again, this is not how this website works. You are supposed to provide a minimal example so that others can reproduce the error. Otherwise it's nearly impossible to find out where the error comes from. Please have a look at the `guidance` provided by camille in the comments before asking another question. By the way, if another library masks your functions, you can still call them: `libraryName::libraryFunction` , (e.g. `vars::VAR()`) – mri Oct 18 '22 at 06:26