[R] Please guide

Muhammad Zubair Chishti mzch|@ht| @end|ng |rom eco@q@u@edu@pk
Mon Jul 11 06:45:02 CEST 2022


Dear Jeff,
1) Being a PhD student, I am obliged to pay deep homage to all experts like
you on this forum who provide free knowledge.

2) Since the data is too large and I cannot cut it, I have no other
suitable option to send my full data.

3) This is the same file that I used in the codes mentioned in my
first email. The codes work well while using the data file I sent you till
this code line:

*sp_bk_roll <- spilloverRollingBK12(Data, n.ahead = 100, no.corr = F,
func_est = "VAR", params_est = params_est, window = 260, partition =
bounds)*

**Till now the code works well. After that, when I run the following:*

con      = as.matrix(read_excel("DY_Table.xlsx")[,-1])*100

*I face the following error:*
*Error in* *`vectbl_as_col_location()`:*
! Can't negate columns past the end.
ℹ Location 1 doesn't exist.
ℹ There are only 0 columns.
Run `rlang::last_error()` to see where the error occurred.

Now kindly check my issue.

Regards
Chishti

On Mon, Jul 11, 2022 at 9:30 AM Jeff Newmiller <jdnewmil using dcn.davis.ca.us>
wrote:

> 1) Thank you for trying to be respectful, but calling me a professor is
> not a good way to do that. I have no PhD, nor do I work for a university. A
> simple "Jeff" or if you prefer "Mr. Newmiller" will be fine
>
> 2) Because you replied to me, I can see your file, but no-one else on the
> list can... most attachments are removed by the mailing list. Do read the
> Posting Guide and try to embed data with dput rather than attaching things.
> Again, you limit the number of people who can help you by failing to use
> the list properly.
>
> 3) The name of the file you attached suggests that this is not the one
> that was causing you trouble. Your code references two different filenames.
>
> On July 10, 2022 8:50:23 PM PDT, Muhammad Zubair Chishti <
> mzchishti using eco.qau.edu.pk> wrote:
> >Dear Respected Professor,
> >You are right. I strongly agree with you. Besides, Thank you so much for
> >your kind reply. As you said, the data file mentioned in the above code is
> >attached herewith. Kindly consider my request.
> >
> > Data_oil_agri.xlsx
> ><
> https://drive.google.com/file/d/1heMlPfUtB-RthKYv4jRM3PGFI8CJ4fck/view?usp=drive_web
> >
> >
> >Regards
> >Muhammad Zubair Chishti
> >
> >On Sat, Jul 9, 2022 at 11:48 PM Jeff Newmiller <jdnewmil using dcn.davis.ca.us>
> >wrote:
> >
> >> This is a mailing list whose members are random people with an interest
> in
> >> R. We are not a tech support call center. If we have time, and you
> invest
> >> some effort into making it easier for us to reproduce your problem, then
> >> someone may respond... but no guarantees. Your current efforts are
> missing
> >> key elements that impede our efforts and there isn't much here to
> persuade
> >> many people to dig further. You may garner more responses if you make
> the
> >> following changes to your approach:
> >>
> >> 1) Make your example reproducible. We need access to the data you are
> >> working with, or at least a small fake similar data set. We don't have
> your
> >> Excel files... dead end for us. But see next point about files. Also,
> >> verify that your code can start from a fresh R environment and
> demonstrate
> >> your problem... the reprex package may be useful for this.
> >>
> >> 2) Make your example minimal. If you are having trouble with data
> >> importing, give us the data file or something similar that gives you the
> >> same error. If you are having trouble with data calculations or
> >> manipulations, then use dput [1] to give us a snippet of the data you
> are
> >> referring to in the troublesome line of code... don't give us a data
> file
> >> and a bunch of code that isn't giving you trouble before the error
> code...
> >> we don't want to wade through it.
> >>
> >> 3) Remove garbage from your posts (formatting). Look at the extra
> >> asterisks in your message as we see it [2]. We cannot run this code
> without
> >> guessing which symbols belong and which don't. I know you did not put
> them
> >> there intentionally, but neither did you disable HTML formatting in your
> >> email client when you composed the message, and that was responsible for
> >> the extra mess. The Posting Guide warns you to post plain text, and
> there
> >> are way too many email client programs out there for us to be able to
> tell
> >> you how to alter this setting... but it is essential that you do it if
> you
> >> want to encourage responses here.
> >>
> >> I considered not responding at all due to these deficiencies, but
> figured
> >> I would spell out the problems you have missed in the Posting Guide
> once.
> >> Mailing lists are tough ways to get help... but the expertise here is
> kind
> >> of rare. You decide whether to make things easy or hard for yourself.
> >>
> >> As for the "con =" line below, it seems to have nothing at all to do
> with
> >> the code or data referred to earlier. That would be a hint for point 2
> >> above. Try calling the read_excel function alone without the rest of the
> >> indexing and matrix conversion. Only when the result you get from that
> step
> >> makes sense should you try indexing it or converting it. Maybe you need
> a
> >> "sheet=" argument?
> >>
> >> ---
> >> [1]
> >>
> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
> >>
> >> [2] https://stat.ethz.ch/pipermail/r-help/2022-July/475212.html
> >>
> >> On July 9, 2022 10:40:29 AM PDT, Muhammad Zubair Chishti <
> >> mzchishti using eco.qau.edu.pk> wrote:
> >> >Dear Experts,
> >> >A kind reminder. Please help me.
> >> >
> >> >
> >> >On Fri, 8 Jul 2022, 21:56 Muhammad Zubair Chishti, <
> >> mzchishti using eco.qau.edu.pk>
> >> >wrote:
> >> >
> >> >>
> >> >> *Dear Experts,*
> >> >> *Greetings from Pakistan*.
> >> >> *When I run the following code in R*
> >> >> library(frequencyConnectedness)
> >> >> library(readxl)
> >> >> ##Add data here##
> >> >> Data <- read_excel("Data_oil_agri.xlsx", sheet = "Sheet1")
> >> >> Data <- Data[,2:22]
> >> >> Data=na.omit(Data)
> >> >> Bnames=colnames(Data)
> >> >>
> >> >> lags=VARselect(Data, lag.max = 12, type = "const")  ## "const",
> "trend",
> >> >> "both", "none"
> >> >> p=lags$selection[[3]]
> >> >>
> >> >> est <- VAR(Data, p = p, type = "const")
> >> >> sp <- spilloverDY12(est, n.ahead = 10, no.corr = F)
> >> >>
> >> >> params_est = list(p = p, type = "const")
> >> >> sp_roll <- spilloverRollingDY12(Data, n.ahead = 10, no.corr = F,
> "VAR",
> >> >> params_est = params_est, window = 260)
> >> >> bounds <- c(pi+0.00001, pi/5, 0)
> >> >> sp_bk <- spilloverBK12(est, n.ahead = 100, no.corr = F, partition =
> >> bounds)
> >> >>
> >> >> sp_bk_roll <- spilloverRollingBK12(Data, n.ahead = 100, no.corr = F,
> >> >> func_est = "VAR", params_est = params_est, window = 260, partition =
> >> bounds)
> >> >>
> >> >> **Till now the code works well. After that, when I run the
> following:*
> >> >>
> >> >> con      = as.matrix(read_excel("DY_Table.xlsx")[,-1])*100
> >> >>
> >> >> *I face the following error:*
> >> >> *Error in* *`vectbl_as_col_location()`:*
> >> >> ! Can't negate columns past the end.
> >> >> ℹ Location 1 doesn't exist.
> >> >> ℹ There are only 0 columns.
> >> >> Run `rlang::last_error()` to see where the error occurred.
> >> >>
> >> >> Kindly please guide me.
> >> >>
> >> >> Regards
> >> >> Muhammad Zubair Chishti
> >> >> Ph.D. Student
> >> >> School of Business,
> >> >> Zhengzhou University, Henan, China.
> >> >> My Google scholar link:
> >> >> https://scholar.google.com/citationshl=en&user=YPqNJMwAAAAJ
> >> >> My ResearchGate link:
> >> >> https://www.researchgate.net/profile/Muhammad-Chishti
> >> >>
> >> >
> >> >       [[alternative HTML version deleted]]
> >> >
> >> >______________________________________________
> >> >R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> >https://stat.ethz.ch/mailman/listinfo/r-help
> >> >PLEASE do read the posting guide
> >> http://www.R-project.org/posting-guide.html
> >> >and provide commented, minimal, self-contained, reproducible code.
> >>
> >> --
> >> Sent from my phone. Please excuse my brevity.
> >>
>
> --
> Sent from my phone. Please excuse my brevity.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list