hw3.docx - Reading table and cleaning data#Reading tables csc=read.csv\"C\/Users\/pc\/Desktop\/hotels.csv,header=T#Attach files attach(csc Number of

hw3.docx - Reading table and cleaning data#Reading tables...

This preview shows page 1 - 3 out of 6 pages.

Reading table and cleaning data #Reading tables csc= read.csv ( "C:/Users/pc/Desktop/hotels.csv" , header= T) #Attach files attach (csc) Number of observations nrow (csc) ## [1] 366644 Types of hotel, B&B and others length ( which (hotel_type == "Hotel" )) ## [1] 184421 length ( which (hotel_type == "B & B" )) ## [1] 119674 length ( which (hotel_type == "Other" )) ## [1] 62549 Which numberic variables should be treated as categorial variables? str (csc) ## 'data.frame': 366644 obs. of 31 variables: ## $ ï..hotel_code : int 1 2 3 4 5 6 7 8 9 10 ... ## $ country_code : Factor w/ 217 levels "ABW","AFG","AGO",..: 204 204 204 204 204 204 204 204 204 204 ... ## $ country_name : Factor w/ 217 levels "Afghanistan",..: 207 207 207 207 207 207 207 207 207 207 ... ## $ location_code : int 60880 28995 29006 30524 30584 30677 30709 30712 30712 30781 ... ## $ location_name : Factor w/ 49729 levels "'Eua Island",..: 1357 1524 2373 13952 17031 25695 27995 28576 28576 33678 ... ## $ hotel_type : Factor w/ 3 levels "B & B","Hotel",..: 2 2 1 1 1 1 2 1 1 1 ... ## $ rooms : int 547 60 5 9 4 3 6 4 4 6 ... ## $ bubble_rating : num 4 4 5 4.5 2.5 NA NA 5 5 4.5 ... ## $ bubble_one : int 14 4 1 0 5 0 0 0 1 2 ... ## $ bubble_two : int 35 7 1 0 1 0 0 0 0 0 ... ## $ bubble_three : int 89 11 1 0 0 0 0 0 4 4 ... ## $ bubble_four : int 233 30 11 3 0 0 0 5 17 10 ... ## $ bubble_five : int 307 36 105 1 3 0 0 113 197 50 ... ## $ page_position : int 4 1 1 2 1 0 0 1 2 1 ... ## $ out_of : int 69 5 2 2 1 1 63 4 4 1 ...
Image of page 1
## $ reviews : int 1082 101 113 4 8 0 0 117 214 62 ... ## $ domestic_reviews : int 959 96 105 4 8 0 0 96 191 61 ... ## $ international_reviews : int 123 5 8 0 0 0 0 21 23 1 ... ## $ reviews_per_room : num 1.978 1.683 22.6 0.444 2 ... ## $ visitor_country1 : Factor w/ 161 levels "AGO","ALB","AND",..: 152 152 152 152 152 125 152 152 152 152 ... ## $ visitor_country2 : Factor w/ 170 levels "AFG","AGO","ALB",..: 159 41 41 27 27 161 56 56 56 76 ... ## $ visitor_country3 : Factor w/ 174 levels "AFG","AGO","ALB",..: 9 27 27 134 133 133 27 77 27 79 ... ## $ management_response_rate: num 0.3759 0.1275 0.0164 0 0 ... ## $ independent_flag : int 1 1 1 1 1 1 1 1 1 1 ... ## $ traffic : int 60643 6971 4405 889 1673 789 367 4352 6345 3988 ...
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 6 pages?

  • Spring '09
  • HARTLEY
  • Na Na Hey Hey Kiss Him Goodbye, Qu.

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes