Using a single observation in a LM()

No idea why I changed your data frame from RData2019 to RStat2019. Sorry!

The native pipe operator will use the LHS (left hand side) for the first unnamed argument on the RHS (right hand side). If you name the first argument, then it will go in the second position, which in this case is the data.

RData2019 |> lm(SINGLE ~ OpeningDay + Friday)

will give an error, but

RData2019 |> lm(formula = SINGLE ~ OpeningDay + Friday)

will work fine.

The native pipe also uses _ as a simple placeholder

RData2019 |> lm(SINGLE ~ OpeningDay + Friday, data = _)

For procedure purpose when I re due this with the 2022 data I should reprex the data and change or add the structure of the data like you did in your code.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.