Column 'xyz' does not exist

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Column 'xyz' does not exist

Tolulope Adeagbo
So I'm having this error:

column 'Previous stage does not exist'

bal_matrix = loan_data_2 %>% as.tibble() %>%
  dplyr::arrange(Account_number) %>%
  dplyr::group_by(Previous_stage, Current_stage) %>%
  dplyr::summarise(
    Total_bal = sum(Balance, na.rm = TRUE)
  ) %>%
  tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)

Please assist.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Column 'xyz' does not exist

Uwe Ligges-3
Don't use pipes but functional programming style, then you can eaasily
traceback() and use debugging tools.

Best,
Uwe Ligges


On 30.07.2019 11:03, Tolulope Adeagbo wrote:

> So I'm having this error:
>
> column 'Previous stage does not exist'
>
> bal_matrix = loan_data_2 %>% as.tibble() %>%
>    dplyr::arrange(Account_number) %>%
>    dplyr::group_by(Previous_stage, Current_stage) %>%
>    dplyr::summarise(
>      Total_bal = sum(Balance, na.rm = TRUE)
>    ) %>%
>    tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)
>
> Please assist.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Column 'xyz' does not exist

Tolulope Adeagbo
Thanks Uwe, maybe i can be clearer; the error is: Warning: Error in :
Column `Previous_stage` is unknown.
Ans please what do you mean by functional programming style?

On Tue, Jul 30, 2019 at 10:18 AM Uwe Ligges <[hidden email]>
wrote:

> Don't use pipes but functional programming style, then you can eaasily
> traceback() and use debugging tools.
>
> Best,
> Uwe Ligges
>
>
> On 30.07.2019 11:03, Tolulope Adeagbo wrote:
> > So I'm having this error:
> >
> > column 'Previous stage does not exist'
> >
> > bal_matrix = loan_data_2 %>% as.tibble() %>%
> >    dplyr::arrange(Account_number) %>%
> >    dplyr::group_by(Previous_stage, Current_stage) %>%
> >    dplyr::summarise(
> >      Total_bal = sum(Balance, na.rm = TRUE)
> >    ) %>%
> >    tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)
> >
> > Please assist.
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] 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.
> >
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Column 'xyz' does not exist

Uwe Ligges-3
Use the functional style such as mean(x) instead of the piping style
such as x %>% mean.

Best,
Uwe Ligges






On 30.07.2019 11:26, Tolulope Adeagbo wrote:

> Thanks Uwe, maybe i can be clearer; the error is: Warning: Error in :
> Column `Previous_stage` is unknown.
> Ans please what do you mean by functional programming style?
>
> On Tue, Jul 30, 2019 at 10:18 AM Uwe Ligges
> <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Don't use pipes but functional programming style, then you can eaasily
>     traceback() and use debugging tools.
>
>     Best,
>     Uwe Ligges
>
>
>     On 30.07.2019 11:03, Tolulope Adeagbo wrote:
>      > So I'm having this error:
>      >
>      > column 'Previous stage does not exist'
>      >
>      > bal_matrix = loan_data_2 %>% as.tibble() %>%
>      >    dplyr::arrange(Account_number) %>%
>      >    dplyr::group_by(Previous_stage, Current_stage) %>%
>      >    dplyr::summarise(
>      >      Total_bal = sum(Balance, na.rm = TRUE)
>      >    ) %>%
>      >    tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)
>      >
>      > Please assist.
>      >
>      >       [[alternative HTML version deleted]]
>      >
>      > ______________________________________________
>      > [hidden email] <mailto:[hidden email]> 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.
>      >
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Column 'xyz' does not exist

Ivan Calandra-5
In reply to this post by Tolulope Adeagbo
Hi,

I would guess that your data object (matrix, data.frame?) does not have
a column called "Previous_stage".
Maybe you just misspelled it; remember that R is case-sensitive.

Please forgive me if I'm completely off!

HTH,
Ivan

--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra

On 30/07/2019 11:26, Tolulope Adeagbo wrote:

> Thanks Uwe, maybe i can be clearer; the error is: Warning: Error in :
> Column `Previous_stage` is unknown.
> Ans please what do you mean by functional programming style?
>
> On Tue, Jul 30, 2019 at 10:18 AM Uwe Ligges <[hidden email]>
> wrote:
>
>> Don't use pipes but functional programming style, then you can eaasily
>> traceback() and use debugging tools.
>>
>> Best,
>> Uwe Ligges
>>
>>
>> On 30.07.2019 11:03, Tolulope Adeagbo wrote:
>>> So I'm having this error:
>>>
>>> column 'Previous stage does not exist'
>>>
>>> bal_matrix = loan_data_2 %>% as.tibble() %>%
>>>     dplyr::arrange(Account_number) %>%
>>>     dplyr::group_by(Previous_stage, Current_stage) %>%
>>>     dplyr::summarise(
>>>       Total_bal = sum(Balance, na.rm = TRUE)
>>>     ) %>%
>>>     tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)
>>>
>>> Please assist.
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> [hidden email] 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.
>>>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Column 'xyz' does not exist

Jeff Newmiller
In reply to this post by Tolulope Adeagbo
Your example is not reproducible [1][2][3] as recommended by the Posting Guide (referenced in the footer of this and every message on this mailing list).

[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

[3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette)

On July 30, 2019 2:03:01 AM PDT, Tolulope Adeagbo <[hidden email]> wrote:

>So I'm having this error:
>
>column 'Previous stage does not exist'
>
>bal_matrix = loan_data_2 %>% as.tibble() %>%
>  dplyr::arrange(Account_number) %>%
>  dplyr::group_by(Previous_stage, Current_stage) %>%
>  dplyr::summarise(
>    Total_bal = sum(Balance, na.rm = TRUE)
>  ) %>%
>  tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)
>
>Please assist.
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] 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.

______________________________________________
[hidden email] 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.