swirldev / swirl_courses

:mortar_board: A collection of interactive courses for the swirl R package.
http://swirlstats.com
Other
4.33k stars 7.24k forks source link

"Data Analysis" course #458

Open aali-81 opened 4 years ago

aali-81 commented 4 years ago

I am trying to start "Data Analysis" after installing the "openintro" I had the following error when starting the Data Analysis course

| Attempting to load lesson dependencies... | Package ‘plotrix’ loaded correctly! | Package ‘openintro’ loaded correctly! Error: 'cars' is not an exported object from 'namespace:openintro'

| Leaving swirl now. Type swirl() to resume.

elfatherbrown commented 4 years ago

Same here!

image

AnaGuerberof commented 4 years ago

I also have this problem.

Have you found a solution for it?

image

primacassie commented 4 years ago

I believe the problem is that openintro doesn't have the cars dataset anymore but renamed it to cars93. Thus, the reference to cars has to be changed to cars93 to be functioning properly

david-lafontant commented 3 years ago

I believe the problem is that openintro doesn't have the cars dataset anymore but renamed it to cars93. Thus, the reference to cars has to be changed to cars93 to be functioning properly

Absolutely true in my case.

I modified the initLesson.R file inside the _Overview_of_Statistics folder_ .

Before I modified it, the code inside the initLesson.R was:

assign("cars", openintro::cars, envir=globalenv())
  assign("mpg.midsize", cars[cars$type=="midsize","mpgCity"], envir=globalenv())

After the modifications, it is now:

assign("cars", openintro::cars93, envir=globalenv())
  assign("mpg.midsize", cars93[cars93$type=="midsize","mpg_city"], envir=globalenv())

And it is working very fine. Thank you for your suggestion @primacassie

jrmagid commented 2 years ago

I am having a related issue. I was able to fix the cars -> cars93 issue using the instructions in the post from @david-lafontant above, but now it will not correctly run the program because "mpgCity" has been changed to "mpg_city". I modified "mpgcity" to "mpgCity" in the initLesson.R_ file so the program will load, but the course does not run correctly because it does not recognize the correct column name. I changed the column name, but every time I reload swirl it changes it back from "mpgCity" to "mpg_city"

Thank you for your help

clifotieno97 commented 2 years ago

how can this be solved. a set by step break down.