Skip to content

Instantly share code, notes, and snippets.

@natbusa
Last active October 6, 2016 03:29
Show Gist options
  • Save natbusa/7010191 to your computer and use it in GitHub Desktop.
Save natbusa/7010191 to your computer and use it in GitHub Desktop.
Extract Cars93 to a cvs file using R and the MASS library
library("MASS")
write.csv(Cars93, 'cars93.csv')
@jemima16
Copy link

jemima16 commented Oct 6, 2016

data(Cars93) in the MASS package contains data on 93 makes of car
sold in the USA.

  1. The Type variable classifies the type of market the car is aimed at.
    Find the cheapest car in each type, and the car with the greatest fuel
    efficiency
  2. Compute the mean horsepower for each type, and the difference between
    each cars horsepower and the mean for its type
  3. Create two new data frames for US and non-US cars.
  4. Use write.table() to save the US car data to a file. Read it in and
    check to see that all the factors are correctly set as factors.

I need help with this. i will appreciate if you write with R language.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment