Watts-College / cpp-528-fall-2022

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

Lab 04 tutorial - issue with import::here #20

Closed sjone128 closed 1 year ago

sjone128 commented 2 years ago

Similar to Bethany's problem in lab 03, the import::here function is not working for me. I attached a screenshot of my screen and did the following steps.

Here's the error: Error: Cannot assign name to different value in the given environment. Name already in use. (traceback below)

  1. loaded the lab_04_source.r into the project environment
  2. moved the lab_03 files to another folder, so there wouldn't be any interference.
  3. cleared the environment, and the output, and restarted R.
  4. restarted my laptop
  5. looked for the file in other places on my machine

@castower, any advice would be so appreciated! image

10. stop(e$message, call. = FALSE) 9. value[3L] 8. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 7. tryCatchList(expr, classes, parentenv, handlers) 6. tryCatch(eval.parent(import_call), error = function(e) stop(e$message, call. = FALSE)) 5. import::from(.from = here::here("labs/lab_04_source.R"), "S_TYPE", "panel.cor", "panel.smooth", "jplot", "d", "df", "cbsa_stats_df", .character_only = TRUE, .into = { environment() ... 4. eval(expr, p) 3. eval(expr, p) 2. eval.parent(cl) 1. import::here("S_TYPE", "panel.cor", "panel.smooth", "jplot", "d", "df", "cbsa_stats_df", .from = here::here("labs/lab_04_source.R"), .character_only = TRUE)

castower commented 2 years ago

Hello @sjone128, if you clear your environment before running the import step do you receive the same error message?

Also, do you have any steps before that one that imports functions/variables with the same name?

sjone128 commented 2 years ago

Hi @castower - I appreciate your help!

I closed the project, cleared the environment/output, and restarted R to try your suggestion. I opened the project and only loaded the project file and the lab04 files from the R environment. Unfortunately, I got the same error. I'm running into the error in the first code chunk for the lab04 tutorial. I tried running by loading from my file search too but that didn't work either.

castower commented 2 years ago

Hey @sjone128 can you send me your two files and I'll take a look?

sjone128 commented 2 years ago

Hi @castower, thank you for your response yesterday! I tried your idea with no success. I sent you a couple of emails with an update on what I've done to fix the error.

sjone128 commented 1 year ago

To close this issue: We were unable to find the error and resolved the issues by including the eval=FALSE. No solution was shared when I received my graded lab. If I find a solution I'll reopen this issue and post the solution.

castower commented 1 year ago

Hi @sjone128, I'll take a look at this also.