sta-363-s20 / community

Discussion, Q&A, everything you want to say, formatted nicely
1 stars 0 forks source link

Exercise 6 - output function into data frame #49

Closed juserrano closed 4 years ago

juserrano commented 4 years ago
2020-02-24 (1)

I am having issues outputting the data frame for exercise 6. I have tried some variations of the code, and even the basic data frame code we used in previous labs but I always get this error: Error in summarise(mse_1, mse_2, mse_3, n_k = n()) : object 'mse_1' not found

Does anyone know what the proper code is?

LucyMcGowan commented 4 years ago

You can combine lines 87-97 by having p1 p2 and p3 all created in the same mutate call and mse_1 mse_2and mse_3 all created in the same summarise like this:

Auto_2 %>%
  filter(k ==k) %>% 
  mutate(
     p1 = ---,
     p2 = ---,
     p3 = ---
  ) %>%
  summarise(
    mse_1 = ---,
    mse_2 = ---,
    mse_3 = ---,
    n_k = n()
)
juserrano commented 4 years ago

Thank you! That worked out!

midupree commented 4 years ago

@LucyMcGowan I am having a similar issue, but that object (k) is not found. I took the advice you gave above and implemented it in my coding. Here is the full rundown:

Screen Shot 2020-02-26 at 12 26 48 PM