Watts-College / cpp-528-fall-2021

https://watts-college.github.io/cpp-528-fall-2021/
2 stars 2 forks source link

Lab 05 - Error with knitting #41

Open Sanaz-27 opened 2 years ago

Sanaz-27 commented 2 years ago

Hello professor @castower,

I'm getting this error when knitting, although no errors when running the chunk in the .RMD file

Results when knitting: error

Results when running chunk: Capture

Can you please help! I have tried to look up the solution but nothing is working except adding this line of code to the knit chunk :( knitr::opts_chunk$set(error = TRUE) which makes the file knit but does not produce the same result as in the .RMD file?!

Thanks, Sana

castower commented 2 years ago

Hello @Sanaz-27, Did you import your regression data set from your source file?

Sanaz-27 commented 2 years ago

Hello @Sanaz-27, Did you import your regression data set from your source file?

yes, I did @castower


import::here("S_TYPE",
             "d",
             "df",
             "d3",
             "s3",
             "PLOTS",
             "%>%",
             .from = here::here("D:/Sanaz/MASTER/ASU/Semesters/Fall 2021/CPP 528/cpp-528-fall-2021-group-06/labs/wk05/lab_05_source.R"),
             .character_only = TRUE)
castower commented 2 years ago

Okay, can you send me your .RMD file? I'll take a look.

Sanaz-27 commented 2 years ago

Okay, can you send me your .RMD file? I'll take a look.

Done.

Thank you so much.

castower commented 2 years ago

Hello @Sanaz-27, The error is occurring because your nmtc.reg and lihtc.reg data sets are not created within your .RMD or imported from your source files prior to trying to model them with stargazer. You'll have to create these data sets first and then graph them.

You can import them from your source file by listing them in the import:

import::here("S_TYPE",
             "d",
             "df",
             "d3",
             "s3",
             "PLOTS",
             "%>%",
             "nmtc.reg",
              "lihtc.reg",
             .from = here::here("labs/wk05/lab_05_source.R"),
             .character_only = TRUE)
Sanaz-27 commented 2 years ago

Hello @Sanaz-27, The error is occurring because your nmtc.reg and lihtc.reg data sets are not created within your .RMD or imported from your source files prior to trying to model them with stargazer. You'll have to create these data sets first and then graph them.

You can import them from your source file by listing them in the import:

import::here("S_TYPE",
             "d",
             "df",
             "d3",
             "s3",
             "PLOTS",
             "%>%",
             "nmtc.reg",
              "lihtc.reg",
             .from = here::here("labs/wk05/lab_05_source.R"),
             .character_only = TRUE)

@castower , thank you, that was the trick, it works perfectly now.