airbnb <- readr::read_csv("data/listings.csv")
dim(airbnb)
## [1] 25946 96
Airbnb Inside collects data from publicly available information from the Airbnb website. The data consists of 96 variables including all listings details as well as guest reviews. We will decide in four steps which variables will be used in our analysis. Using the kableExtra
package, we can take a closer look at the first 24 columns:
id | listing_url | scrape_id | last_scraped | name | summary | space | description | experiences_offered | neighborhood_overview | notes | transit | access | interaction | house_rules | thumbnail_url | medium_url | picture_url | xl_picture_url | host_id | host_url | host_name | host_since | host_location |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6983 | https://www.airbnb.com/rooms/6983 | 2.018102e+13 | 2018-10-18 | Copenhagen ‘N Livin’ | Lovely apartment located in the hip Nørrebro area, close to bars, cafés and restaurants. The room itself is rather small, but sleeps two. Has a bed, hangers and a cupboard. Large living room with couch, chair and small table, as well as a large dining table for dinner. Large bathroom with good shower and washing machine. Kitchen with new gas stove, pots and pans, coffee machine and other amenities. Also a small table, where you can have breakfast. | Beautiful and cosy apartment conveniently located in the hip Nørrebro area, close to cafés, bakeries, shops, and bars. The apartment has three bedrooms and a living room, as well as a large bathroom and a fully equipped kitchen. You will be renting the small room, which sleeps 2 people. Situated in the outskirts of central Copenhagen, in the charming multi-cultural “Nørrebro”-area, close to shopping amenities and a 10-min walk from both Copenhagen Business School (CBS) and University of Copenhagen, and a 15-min walk from Tivoli and the town hall square, this apartment offers a room with a (narrow) double bed (sleeps (Phone number hidden by Airbnb) cm) and a closet and a desk, as well as a living room with a sofa (not a sofa bed!) and a dining table. The bathroom includes a shower, and towels will be provided for free. There is also a washing machine, which you are welcome to use. The apartment also has a small, but well-equipped kitchen, which can be used for cooking, as long as it’s l | Lovely apartment located in the hip Nørrebro area, close to bars, cafés and restaurants. The room itself is rather small, but sleeps two. Has a bed, hangers and a cupboard. Large living room with couch, chair and small table, as well as a large dining table for dinner. Large bathroom with good shower and washing machine. Kitchen with new gas stove, pots and pans, coffee machine and other amenities. Also a small table, where you can have breakfast. Beautiful and cosy apartment conveniently located in the hip Nørrebro area, close to cafés, bakeries, shops, and bars. The apartment has three bedrooms and a living room, as well as a large bathroom and a fully equipped kitchen. You will be renting the small room, which sleeps 2 people. Situated in the outskirts of central Copenhagen, in the charming multi-cultural “Nørrebro”-area, close to shopping amenities and a 10-min walk from both Copenhagen Business School (CBS) and University of Copenhagen, and a 15-min walk from Tivoli and the town h | none | Nice bars and cozy cafes just minutes away, yet the street itself is quiet and you won’t be bothered by loud music. | NA | Bus 66 runs to the central station. Forum metro is about 10 min walk from the apartment; from there you can reach the airport. However, a trip to Copenhagen is not complete without a bike ride. Everyone here gets around by bike, and I highly recommend you rent one while you are here. | Bedroom, living room, kitchen, and bathroom for shared use. You will be sharing the apartment with two people. | We are usually at work during day time, but will be home most evenings and happy to chat or share a meal. | No smoking allowed! No pets. | NA | NA | https://a0.muscache.com/im/pictures/42044170/f63c4d99_original.jpg?aki_policy=large | NA | 16774 | https://www.airbnb.com/users/show/16774 | Simon | 2009-05-12 | Copenhagen, Capital Region of Denmark, Denmark |
26057 | https://www.airbnb.com/rooms/26057 | 2.018102e+13 | 2018-10-18 | Lovely house - most attractive area | Our lovely house in the center of the city is placed in a small silence street. 50 meter from the popular Emmery-bacery, and restaurant and cafees around. You are in a walkingdistans to all main attractions, and have the “lakes” in your backyards. | Totally charming old 150 m2 stone house from year 1870 - in a very unique part of the City called “Kartoffelrækkerne”. It’s like a mini-community in a very central part of Copenhagen - the most attractive area in Copenhagen - in the heart of the city, but still in peace and quiet. Within walking distance you will find the lakes, several museums, shops, cafés, bars, parks and restaurants. The house is modern and renovated in a handsome way with respect for the old style and architecture. Three floors. 1st floor: Living room, kitchen and dining room, with direct entrance to a charming and sunny “patio”, guest toilet. 2nd floor: 1 bedroom with double bed, 1 music room with a piano and with entrance to a lovely veranda, a full bathroom with a shower and bath tub. 3rd floor: 3 bedrooms - one with double bed (140), one with 1 1/2 bed (120), and one single bed(90). The house is perfect for a family of 4 or 6 persons - also with children. You will love the house:-) Encantadora antigua casa de | Our lovely house in the center of the city is placed in a small silence street. 50 meter from the popular Emmery-bacery, and restaurant and cafees around. You are in a walkingdistans to all main attractions, and have the “lakes” in your backyards. Totally charming old 150 m2 stone house from year 1870 - in a very unique part of the City called “Kartoffelrækkerne”. It’s like a mini-community in a very central part of Copenhagen - the most attractive area in Copenhagen - in the heart of the city, but still in peace and quiet. Within walking distance you will find the lakes, several museums, shops, cafés, bars, parks and restaurants. The house is modern and renovated in a handsome way with respect for the old style and architecture. Three floors. 1st floor: Living room, kitchen and dining room, with direct entrance to a charming and sunny “patio”, guest toilet. 2nd floor: 1 bedroom with double bed, 1 music room with a piano and with entrance to a lovely veranda, a full bathroom with a sho | none | The neighborhood is the most famous one and the most “upper-class” in the city center. You are in a house with small garden and a “patio”, and still - you are in the center. You are inside the “city walls”, and in walking-distance to everything. Transporting yourself around in the city by bike is nice thing to do (but not a “must”), like we - living in town, always do. | NA | Walking-distance to metro/station for transport out of town | You will have access to the whole house | NA | We will leave the house clean and in good and cozy shape, and expect you to take care of the house, joy your stay and feel home when you are here, but also leave the house in the same shape and conditions. It is a no-shoes-inside-home:-) | NA | NA | https://a0.muscache.com/im/pictures/bfbca07e-4cc1-42ce-822b-aa878a656e7c.jpg?aki_policy=large | NA | 109777 | https://www.airbnb.com/users/show/109777 | Kari | 2010-04-17 | Copenhagen, Capital Region of Denmark, Denmark |
26473 | https://www.airbnb.com/rooms/26473 | 2.018102e+13 | 2018-10-18 | City Centre Townhouse Sleeps 1-12 persons | TOWN HOUSE ON KNABROSTRÆDE - located in the absolute ❤️ of Copenhagens old town. Close to everything! Located off ‘Strøget’. You will find old town’s foodie walking street “Strædet” just round the corner, offering a wide range of restaurants and cafes. 5-10mins walk to various cultural sites which include Thorvaldsens Museum, Borgen, National Museum, DAC/Blox, TIVOLI, the Metro as well as the main station. ENJOY! | The house is a total of 240sqm divided on 4 floors and consists of 6 bedrooms, 1 large open living room / dining room and 2 ½ bathrooms. Fully furnished and equipped kitchen, it comes with all linen & towels. 5 bedrooms have comfortable, large double beds and a single room with a fold-out small double bed plus extra two loft beds.(loft beds are accesable by the ladder and are not sitable for eldery people) The top room is family friendly. Amenities include internet, cable TV, dishwasher, microwave, coffee machine, etc. Blankets, pillows, bed linens, towels, cable and internet subscriptions, utilities such as heat, water and electricity consumption all included. Weekly and monthly rates are available upon request. | TOWN HOUSE ON KNABROSTRÆDE - located in the absolute ❤️ of Copenhagens old town. Close to everything! Located off ‘Strøget’. You will find old town’s foodie walking street “Strædet” just round the corner, offering a wide range of restaurants and cafes. 5-10mins walk to various cultural sites which include Thorvaldsens Museum, Borgen, National Museum, DAC/Blox, TIVOLI, the Metro as well as the main station. ENJOY! The house is a total of 240sqm divided on 4 floors and consists of 6 bedrooms, 1 large open living room / dining room and 2 ½ bathrooms. Fully furnished and equipped kitchen, it comes with all linen & towels. 5 bedrooms have comfortable, large double beds and a single room with a fold-out small double bed plus extra two loft beds.(loft beds are accesable by the ladder and are not sitable for eldery people) The top room is family friendly. Amenities include internet, cable TV, dishwasher, microwave, coffee machine, etc. Blankets, pillows, bed linens, towels, cable and interne | none | NA | NA | NA | NA | NA | Please be respectful to the neighbors and keep the noise down after 10 pm. After taking a shower, please air the bathroom. There is under no circumstances allowed smoking in the house or outside the windows. Please turn off the lights when leaving the house. Please latch the windows (both when closed or open) to avoid strong wind damaging the windows. | NA | NA | https://a0.muscache.com/im/pictures/8e132ba0-b68c-4878-92ae-2cf4476df95a.jpg?aki_policy=large | NA | 112210 | https://www.airbnb.com/users/show/112210 | Oliver | 2010-04-22 | Copenhagen, Capital Region of Denmark, Denmark |
29118 | https://www.airbnb.com/rooms/29118 | 2.018102e+13 | 2018-10-18 | Best Location in Cool Istedgade | NA | The apartment is situated in the middle of the lively Istedgade, with lots of coffee shops, restaurants, bars, designer stores etc around, just outside a park and playground: Skydebanehaven. So you can not hear the noise from Istedgade, but enjoy the perks of having it a stone from the main entrance. The place is only 8 min. walk from the main station: København H and 12 min. from Tivoli and The City Hall. So everything is within reach. The apartment is 90 m2: two big living rooms en suite - one of which is my work space, here is my piano and a massage bed. There is a big kitchen (fully equipped with juicer, dishwasher and what not - from kitchen you can go to the balcony, nice for having morning coffee, since its located to the east. From the kitchen a small hallway leads to the bathroom and the bedroom. Bathroom with shower and a washing machine and the bedroom is nice and quiet facing the backyard, which you can see from the french doors. Wifi is included, as is clean bedsh | The apartment is situated in the middle of the lively Istedgade, with lots of coffee shops, restaurants, bars, designer stores etc around, just outside a park and playground: Skydebanehaven. So you can not hear the noise from Istedgade, but enjoy the perks of having it a stone from the main entrance. The place is only 8 min. walk from the main station: København H and 12 min. from Tivoli and The City Hall. So everything is within reach. The apartment is 90 m2: two big living rooms en suite - one of which is my work space, here is my piano and a massage bed. There is a big kitchen (fully equipped with juicer, dishwasher and what not - from kitchen you can go to the balcony, nice for having morning coffee, since its located to the east. From the kitchen a small hallway leads to the bathroom and the bedroom. Bathroom with shower and a washing machine and the bedroom is nice and quiet facing the backyard, which you can see from the french doors. Wifi is included, as is clean bedsh | none | NA | NA | NA | NA | NA | Smoking is allowed on the balcony only. Please no outdoor shoes indoors. No playing the piano if you can’t play, if you CAN play, please play only between the hours of 10 am and 5 pm. due to my neighboors. Kindly take out the trash when you leave and note that since there is no cleaning fee, I expect you to leave the place in same condition as when you came, which is clean :-) | NA | NA | https://a0.muscache.com/im/pictures/236213/33956c43_original.jpg?aki_policy=large | NA | 125230 | https://www.airbnb.com/users/show/125230 | Nana | 2010-05-15 | Copenhagen, Capital Region of Denmark, Denmark |
29618 | https://www.airbnb.com/rooms/29618 | 2.018102e+13 | 2018-10-18 | Artsy and familyfriendly home in lovely Copenhagen | Artsy, bright and spacious flat, close to the city centre, nice bars and restaurants, parks and transport. Ideal for a small group of friends or a family to hang out in Copenhagen for summer vacation. | It’s a three bedroom apartment with a spacious living room and a spacious kitchen. The main bedroom has a double bed. Next to the main bedroom, there is a children’s bedroom with a baby/toddler size bed. In the living room, there is a sofa bed. And next to the living room there is a small bedroom with a camp bed. So there is room for a family of 5 including a toddler, or a group of friends (4 people in total). The kitchen is fully equipped with everything for making great dinners or just plain breakfast if you prefer staying out all day. | Artsy, bright and spacious flat, close to the city centre, nice bars and restaurants, parks and transport. Ideal for a small group of friends or a family to hang out in Copenhagen for summer vacation. It’s a three bedroom apartment with a spacious living room and a spacious kitchen. The main bedroom has a double bed. Next to the main bedroom, there is a children’s bedroom with a baby/toddler size bed. In the living room, there is a sofa bed. And next to the living room there is a small bedroom with a camp bed. So there is room for a family of 5 including a toddler, or a group of friends (4 people in total). The kitchen is fully equipped with everything for making great dinners or just plain breakfast if you prefer staying out all day. We will not be around during your stay but you are most welcome to contact us if you need tips for Copenhagen or how the washing machine works. The apartment is situated in Østerbro, very close to the more lively Nørrebro with lots of bars, restaurants, | none | The apartment is situated in Østerbro, very close to the more lively Nørrebro with lots of bars, restaurants, supermarkets and little cute shops. Let us know what you are looking for and we will provide you with special tips for your stay. You can easily access the city centre from the flat - 5 minutes by bus or 15 minutes walk along the city lakes. | Please note that the bed in the second bedroom is a camp bed. It works fine but it’s not a soft madras. Please note that the airbnb reviews concern our listing when we offered only two rooms of the flat and not the entire place. | There are good bus connections very close to the flat towards the city centre and to railway stations if you fancy a trip out of town. Our flat is just 3 stop (5 aprx. minutes) from Nørreport Station (the city centre), where you can connect to S-train, metro and trains to the airport, Malmö and Humlebæk, Lousiana Museum of Modern Art. A bike is the easiest way to get around Copenhagen. However, the public transport system is working very well as well. | NA | We will not be around during your stay but you are most welcome to contact us if you need tips for Copenhagen or how the washing machine works. | Please respect that this is our home. | NA | NA | https://a0.muscache.com/im/pictures/547e4a06-9c79-4b01-a36e-0f4fe0ce068c.jpg?aki_policy=large | NA | 127577 | https://www.airbnb.com/users/show/127577 | Simon And Anna | 2010-05-18 | Copenhagen, Capital Region of Denmark, Denmark |
31094 | https://www.airbnb.com/rooms/31094 | 2.018102e+13 | 2018-10-18 | Very central and cozy, new kitchen | NA | Welcome to our home, we hope you will enjoy your trip to Copenhagen! 64 m2 vacation rental for 1-3 people in central Copenhagen. The appartment is very centrally located in walking distance to most major attractions. The nearest trainstation is only 300m away, and the citytrains run every 6 minutes. The central trainstation and city centre is only a kilometer away, and still, the appartment is situated in a very quiet street. The kitchen is new and fully equipped with a dishwasher and a little table for two. The appartment has it’s own toilet and bath. If you prefer to go out and eat, there are plenty of good restaurants within walking distance. There is wireless internet for free. The bedroom is equipped with a doublebed and the living room with a sofa and a dining table. Pillows, duvets, bed clothes and towels are provided according to the number of persons staying in the apartment. Children under 3 years are free of charge. Very nice green courtyard where you can dine or grill. | Welcome to our home, we hope you will enjoy your trip to Copenhagen! 64 m2 vacation rental for 1-3 people in central Copenhagen. The appartment is very centrally located in walking distance to most major attractions. The nearest trainstation is only 300m away, and the citytrains run every 6 minutes. The central trainstation and city centre is only a kilometer away, and still, the appartment is situated in a very quiet street. The kitchen is new and fully equipped with a dishwasher and a little table for two. The appartment has it’s own toilet and bath. If you prefer to go out and eat, there are plenty of good restaurants within walking distance. There is wireless internet for free. The bedroom is equipped with a doublebed and the living room with a sofa and a dining table. Pillows, duvets, bed clothes and towels are provided according to the number of persons staying in the apartment. Children under 3 years are free of charge. Very nice green courtyard where you can dine or grill. Wh | none | What else is nearby? To be honest, I think our neighbourhood “Vesterbro” is the coolest in Copenhagen. Just 100 meters away you have Sdr. Boulevard, which is a lovely open boulevard, where lots of the cool kids hang out in the afternoon and evening. Istedgade is only 300 meters away with lots of great but not too expensive restaurents, winebars and clothes shops. “Kødbyen” (The old meat packing district), which has now been made into trendy restaurents, bars and nightclubs - only 350 meters away.. If you feel more like authentic old bars, there are plenty nearby.. There are lots of parks around. The beautiful harbour is great for swimming and only 1 km away. You will be able to manage you days here on foot ;-).. | NA | NA | NA | NA | Be Good :-) Listed below are a few house rules • Please remove shoes when inside the apartment • No smoking (smoking only allowed on the street) • When using the sofa as a bed, a sheet will be provided and must be used. | NA | NA | https://a0.muscache.com/im/pictures/19408864/7c4cd0ec_original.jpg?aki_policy=large | NA | 129976 | https://www.airbnb.com/users/show/129976 | Ebbe | 2010-05-22 | Copenhagen, Capital Region of Denmark, Denmark |
32379 | https://www.airbnb.com/rooms/32379 | 2.018102e+13 | 2018-10-18 | 1668 ft2 artist flat on Vesterbro | Bright Artistic luxury apartment in very trendy area of Copenhagen, located on the 3rd floor of protected back building without traffic noise. 4 room apartment, where the size will be flexible in terms of how many rooms you order: 1 or 2 bedroom’s or incl weekendbed in livingroom OBS Free Parking plot in the basement area in the periode June 28 - July 12 2017. | 1668 ft2 ft2 bright luxurious apartment with wireless Internet on wonderful location in Copenhagen. The apartment is located in a historic building in the backyard - away from traffic, but with the city’s pulse. APARTMENT Your hostess is an artist and appreciate the visual environment. The apartment can accommodate up to 4 people ( 5 including weekend bed on the loungesofa ), either a family or mature couples sharing and are super delicious also for example a couple who want special frames on their visit to Copenhagen. There are five rooms which are distributed by: - Large bedroom with double bed and TV - Large bedroom with king size bed, TV and wardrobe - Small room with a single bed - Large living room with a lounge sofa, weekend bed, TV, DVD, WiFi - Large dining room with CD player - Kitchen with space to eat and washing machine, dishwasher, microwave, etc. - two new bathrooms. You can see my floor plan in one of my pictures. AREA 10-minute walk from the main train station, the even | Bright Artistic luxury apartment in very trendy area of Copenhagen, located on the 3rd floor of protected back building without traffic noise. 4 room apartment, where the size will be flexible in terms of how many rooms you order: 1 or 2 bedroom’s or incl weekendbed in livingroom OBS Free Parking plot in the basement area in the periode June 28 - July (Phone number hidden by Airbnb) bright luxurious apartment with wireless Internet on wonderful location in Copenhagen. The apartment is located in a historic building in the backyard - away from traffic, but with the city’s pulse. APARTMENT Your hostess is an artist and appreciate the visual environment. The apartment can accommodate up to 4 people ( 5 including weekend bed on the loungesofa ), either a family or mature couples sharing and are super delicious also for example a couple who want special frames on their visit to Copenhagen. There are five rooms which are distributed by: - Large bedroom with double bed and TV - Large bedroom | none | NA | NA | it’s a nice place, just in the Urban city, with transport super nearby, to all attraction | When booking you will always have the whole apartment to yourselves. The size will be flexible in terms of how many rooms you order: When you book two people, you will have the entire apartment, with a large double room (your choice between the two) with king size bed. When you book 3, you will also get the chamber, with a single bed. Booking for 4 people you get your access to two large double bedrooms with king size beds where the bed in the room with red chairs can be made into two single beds, as required. When booking 5 people, you will get the whole apartment with two bedrooms. incl. a nice weekend bed in the living room. | My apartment, super bright, placed in the most Hip area in Copenhagen, is ready for you, while I’m in abroard for a Scenography conference. My neighbor will welcome you, guide you and give the keys. | When booking you will always have the whole apartment to yourselves. The size will be flexible in terms of how many rooms you order: When you book two people, one will have the entire apartment, with a large double room (your choice between the two) with king size bed. When you book 3, you will also get the chamber, with a single bed. Booking for 4 people you get you access to two large double bedrooms with king size beds where the bed in the room with red chairs can be made into two single beds, as required. When booking 5 people, you will get the whole apartment (165 m2) with all three bedrooms. When booking 6 people will also get a nice weekend bed in the living room. If you want all three bedrooms for 3 people, please book for 4 guests and send the owner message. | NA | NA | https://a0.muscache.com/im/pictures/4088872/c50aeb23_original.jpg?aki_policy=large | NA | 140105 | https://www.airbnb.com/users/show/140105 | Lise | 2010-06-07 | Copenhagen, Capital Region of Denmark, Denmark |
Out of the first 24 columns, we will keep the following variables:
Out of the first 24 columns we will delete the following variables:
host_about | host_response_time | host_response_rate | host_acceptance_rate | host_is_superhost | host_thumbnail_url | host_picture_url | host_neighbourhood | host_listings_count | host_total_listings_count | host_verifications | host_has_profile_pic | host_identity_verified | street | neighbourhood | neighbourhood_cleansed | neighbourhood_group_cleansed | city | state | zipcode | market | smart_location | country_code | country |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
I’m currently working as an environmental consultant for a large engineering consultancy in Copenhagen. When I’m not at work, I spend time doing sports (playing football, running, cross fit), or doing indoor activities such as reading books and listening to music. I have recently taken an interest in cooking, and I love great food. I’m outgoing, happy and love good company. And I love my bike as any other person from Copenhagen.. | N/A | N/A | N/A | TRUE | https://a0.muscache.com/im/users/16774/profile_pic/1401276934/original.jpg?aki_policy=profile_small | https://a0.muscache.com/im/users/16774/profile_pic/1401276934/original.jpg?aki_policy=profile_x_medium | Nørrebro | 1 | 1 | [‘email’, ‘phone’, ‘reviews’] | TRUE | FALSE | Copenhagen, Hovedstaden, Denmark | Nørrebro | Nrrebro | NA | Copenhagen | Hovedstaden | 2200 | Copenhagen | Copenhagen, Denmark | DK | Denmark |
We are a family with 2 children, and living in a great and beautiful house placed in a very special part in central Copenhagen called Kartoffelraekkerne. It’s like a small village in the center of the city! The house is available from time to time - when we are travelling/working abroad. We’re looking forward to hearing from you. | within a day | 100% | N/A | TRUE | https://a0.muscache.com/im/users/109777/profile_pic/1359537563/original.jpg?aki_policy=profile_small | https://a0.muscache.com/im/users/109777/profile_pic/1359537563/original.jpg?aki_policy=profile_x_medium | Indre By | 1 | 1 | [‘email’, ‘phone’, ‘facebook’, ‘reviews’, ‘jumio’, ‘offline_government_id’, ‘government_id’] | TRUE | FALSE | Copenhagen, Hovedstaden, Denmark | Indre By | Indre By | NA | Copenhagen | Hovedstaden | 2100 | Copenhagen | Copenhagen, Denmark | DK | Denmark |
Gentle male, have travelled the world for 20 years and have in the process learnt about the art of housing. While I prefer to let you conquer the city on your own paths, please feel free to use my experience if you need any tips & advice. Will do my best to give you a perfect slice of Copenhagen. In my spare time I love consuming good food, taking long walks on the beaches or watching movies. I live & work here and can be contacted with any comments & questions. |
within a day | 70% | N/A | FALSE | https://a0.muscache.com/im/users/112210/profile_pic/1364494488/original.jpg?aki_policy=profile_small | https://a0.muscache.com/im/users/112210/profile_pic/1364494488/original.jpg?aki_policy=profile_x_medium | Indre By | 2 | 2 | [‘email’, ‘phone’, ‘facebook’, ‘reviews’, ‘jumio’, ‘government_id’] | TRUE | TRUE | Copenhagen, Hovedstaden, Denmark | Indre By | Indre By | NA | Copenhagen | Hovedstaden | 1210 | Copenhagen | Copenhagen, Denmark | DK | Denmark |
I have a Master of Arts in Musicology and I work as vocal coach and a singer and I LOVE to travel and meet people from all over the world. | N/A | N/A | N/A | FALSE | https://a0.muscache.com/im/users/125230/profile_pic/1371558644/original.jpg?aki_policy=profile_small | https://a0.muscache.com/im/users/125230/profile_pic/1371558644/original.jpg?aki_policy=profile_x_medium | Vesterbro | 1 | 1 | [‘email’, ‘phone’, ‘reviews’] | TRUE | FALSE | Copenhagen, Hovedstaden, Denmark | Vesterbro | Vesterbro-Kongens Enghave | NA | Copenhagen | Hovedstaden | 1650 | Copenhagen | Copenhagen, Denmark | DK | Denmark |
We are Simon and Anna, 40ies, professionals, have a toddler who makes life even more beautiful, love plants, music, want to try to be bee farmers, want to keep on fishing, travel to new places, meet new people and keep good friends. | N/A | N/A | N/A | FALSE | https://a0.muscache.com/im/users/127577/profile_pic/1354054705/original.jpg?aki_policy=profile_small | https://a0.muscache.com/im/users/127577/profile_pic/1354054705/original.jpg?aki_policy=profile_x_medium | Østerbro | 1 | 1 | [‘email’, ‘phone’, ‘facebook’, ‘reviews’, ‘jumio’, ‘government_id’] | TRUE | TRUE | Copenhagen, Hovedstaden, Denmark | NA | sterbro | NA | Copenhagen | Hovedstaden | 2100 | Copenhagen | Copenhagen, Denmark | DK | Denmark |
Hi and welcome. My name is Ebbe, I am a medical doctor working in Copenhagen. I live in the flat with my girlfriend Lea who is working as a nurse. We love sports, music and travelling, and we look forward welcoming you to CPH |
within an hour | 100% | N/A | FALSE | https://a0.muscache.com/im/users/129976/profile_pic/1371667869/original.jpg?aki_policy=profile_small | https://a0.muscache.com/im/users/129976/profile_pic/1371667869/original.jpg?aki_policy=profile_x_medium | Vesterbro | 1 | 1 | [‘email’, ‘phone’, ‘facebook’, ‘reviews’, ‘jumio’, ‘offline_government_id’, ‘government_id’] | TRUE | FALSE | Copenhagen, Capital Region of Denmark, Denmark | Vesterbro | Vesterbro-Kongens Enghave | NA | Copenhagen | Capital Region of Denmark | 1719 | Copenhagen | Copenhagen, Denmark | DK | Denmark |
As profession - Set and Costumedesigner for Avangarde Theatre, Modern Dance and Performance. A traveler, enjoy to se the whole world, meet people and talk about the world situation | within an hour | 100% | N/A | TRUE | https://a0.muscache.com/im/users/140105/profile_pic/1289485314/original.jpg?aki_policy=profile_small | https://a0.muscache.com/im/users/140105/profile_pic/1289485314/original.jpg?aki_policy=profile_x_medium | Vesterbro | 4 | 4 | [‘email’, ‘phone’, ‘reviews’, ‘jumio’, ‘offline_government_id’, ‘selfie’, ‘government_id’, ‘identity_manual’] | TRUE | FALSE | Copenhagen, Hovedstaden, Denmark | Vesterbro | Vesterbro-Kongens Enghave | NA | Copenhagen | Hovedstaden | 1620 | Copenhagen | Copenhagen, Denmark | DK | Denmark |
From columns 25 to 48 we will keep the following:
And drop all columns below:
latitude | longitude | is_location_exact | property_type | room_type | accommodates | bathrooms | bedrooms | beds | bed_type | amenities | square_feet | price | weekly_price | monthly_price | security_deposit | cleaning_fee | guests_included | extra_people | minimum_nights | maximum_nights | calendar_updated | has_availability | availability_30 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
55.68798 | 12.54571 | TRUE | Apartment | Private room | 2 | 1.0 | 1 | 1 | Real Bed | {TV,“Cable TV”,Wifi,Kitchen,“Paid parking off premises”,Heating,Washer,“Smoke detector”,Essentials,Hangers,“Hair dryer”,Iron,“Laptop friendly workspace”,“translation missing: en.hosting_amenity_49”,“translation missing: en.hosting_amenity_50”,“Room-darkening shades”,“Hot water”,“Bed linens”,Microwave,“Coffee maker”,Refrigerator,Dishwasher,“Dishes and silverware”,“Cooking basics”,Oven,Stove,“Garden or backyard”,“Luggage dropoff allowed”,“Paid parking on premises”} | 97 | $356.00 | NA | NA | $0.00 | $32.00 | 1 | $65.00 | 2 | 15 | 4 days ago | TRUE | 3 |
55.69163 | 12.57459 | TRUE | House | Entire home/apt | 6 | 1.5 | 4 | 4 | Real Bed | {TV,Wifi,Kitchen,“Indoor fireplace”,Heating,“Family/kid friendly”,Washer,Dryer,“Smoke detector”,“Fire extinguisher”,Essentials,Shampoo,Hangers,“Hair dryer”,Iron,“Laptop friendly workspace”,Bathtub,“High chair”,Crib,“Hot water”,“Bed linens”,“Patio or balcony”,“Garden or backyard”,“Long term stays allowed”} | NA | $2,101.00 | NA | NA | $5,000.00 | $1,100.00 | 4 | $350.00 | 3 | 30 | 2 weeks ago | TRUE | 24 |
55.67590 | 12.57698 | TRUE | House | Entire home/apt | 12 | 2.5 | 6 | 8 | Real Bed | {TV,Internet,Wifi,Kitchen,“Buzzer/wireless intercom”,Heating,“Family/kid friendly”,Hangers,“Hair dryer”,Iron,“Self check-in”,Lockbox} | NA | $3,097.00 | $17,532.00 | $67,146.00 | $3,730.00 | $522.00 | 1 | $0.00 | 3 | 31 | yesterday | TRUE | 6 |
55.67069 | 12.55430 | TRUE | Apartment | Entire home/apt | 2 | 1.0 | 1 | 1 | Real Bed | {Wifi,Kitchen,“Paid parking off premises”,Heating,“Family/kid friendly”,Washer,Essentials,Hangers,“Hair dryer”,Iron,“Laptop friendly workspace”,“Baby bath”,“Changing table”,“High chair”,“Children’s books and toys”,Crib,“Pack ’n Play/travel crib”,“Room-darkening shades”,“Children’s dinnerware”,“Hot water”,Microwave,Refrigerator,Dishwasher,“Dishes and silverware”,“Cooking basics”,Oven,Stove,“Patio or balcony”,“Host greets you”} | NA | $802.00 | NA | NA | NA | $300.00 | 1 | $0.00 | 7 | 14 | 5 months ago | TRUE | 0 |
55.69375 | 12.56945 | TRUE | Apartment | Entire home/apt | 4 | 1.0 | 3 | 3 | Real Bed | {TV,Internet,Wifi,Kitchen,“Buzzer/wireless intercom”,Heating,Washer,Dryer,“Smoke detector”,“Fire extinguisher”,Essentials,Iron,“Laptop friendly workspace”,“Baby bath”,“Changing table”,“High chair”,“Children’s books and toys”,“Window guards”,“Table corner guards”,“Room-darkening shades”,“Children’s dinnerware”,“Hot water”,Refrigerator,Dishwasher,“Dishes and silverware”,“Cooking basics”,Oven,Stove,“Long term stays allowed”,Other,“Paid parking on premises”} | NA | $860.00 | $2,984.00 | $8,953.00 | NA | $75.00 | 1 | $0.00 | 7 | 31 | today | TRUE | 0 |
55.66744 | 12.55516 | TRUE | Apartment | Entire home/apt | 3 | 1.0 | 1 | 3 | Real Bed | {TV,“Cable TV”,Internet,Wifi,Kitchen,“Buzzer/wireless intercom”,Heating,“Family/kid friendly”} | 689 | $750.00 | $4,700.00 | NA | $1,000.00 | NA | 2 | $100.00 | 2 | 10 | a week ago | TRUE | 0 |
55.67368 | 12.55248 | FALSE | Apartment | Entire home/apt | 6 | 2.0 | 3 | 5 | Real Bed | {TV,“Cable TV”,Internet,Wifi,Kitchen,“Free parking on premises”,“Hot tub”,“Buzzer/wireless intercom”,Heating,“Family/kid friendly”,Washer,Dryer,“Smoke detector”,“Carbon monoxide detector”,“First aid kit”,Essentials,Shampoo,Hangers,“Hair dryer”,Iron,“Laptop friendly workspace”,Bathtub,“High chair”,“Children’s books and toys”,Crib,“Room-darkening shades”,“Hot water”,“Bed linens”,“Luggage dropoff allowed”,“Host greets you”} | NA | $1,080.00 | $7,461.00 | $26,112.00 | $1,492.00 | NA | 2 | $298.00 | 3 | 365 | 2 weeks ago | TRUE | 3 |
From the next 24 variables, we will keep the following:
We drop the following:
availability_60 | availability_90 | availability_365 | calendar_last_scraped | number_of_reviews | first_review | last_review | review_scores_rating | review_scores_accuracy | review_scores_cleanliness | review_scores_checkin | review_scores_communication | review_scores_location | review_scores_value | requires_license | license | jurisdiction_names | instant_bookable | is_business_travel_ready | cancellation_policy | require_guest_profile_picture | require_guest_phone_verification | calculated_host_listings_count | reviews_per_month |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | 24 | 29 | 2018-10-18 | 145 | 2009-09-04 | 2018-10-13 | 96 | 10 | 10 | 10 | 10 | 9 | 9 | FALSE | NA | NA | FALSE | FALSE | moderate | FALSE | FALSE | 1 | 1.31 |
48 | 70 | 342 | 2018-10-18 | 43 | 2013-12-02 | 2018-10-04 | 99 | 10 | 10 | 10 | 10 | 10 | 10 | FALSE | NA | NA | FALSE | FALSE | moderate | FALSE | FALSE | 1 | 0.72 |
20 | 35 | 115 | 2018-10-18 | 230 | 2010-10-14 | 2018-10-10 | 90 | 9 | 9 | 10 | 9 | 10 | 9 | FALSE | NA | NA | TRUE | FALSE | moderate | FALSE | FALSE | 2 | 2.36 |
0 | 15 | 290 | 2018-10-18 | 20 | 2010-06-17 | 2018-07-02 | 98 | 10 | 9 | 10 | 10 | 10 | 9 | FALSE | NA | NA | FALSE | FALSE | strict_14_with_grace_period | FALSE | FALSE | 1 | 0.20 |
0 | 0 | 0 | 2018-10-18 | 87 | 2010-07-30 | 2014-08-19 | 94 | 10 | 9 | 10 | 9 | 10 | 9 | FALSE | NA | NA | TRUE | FALSE | moderate | FALSE | FALSE | 1 | 0.87 |
0 | 0 | 0 | 2018-10-18 | 17 | 2010-08-16 | 2017-08-25 | 97 | 10 | 10 | 10 | 10 | 10 | 9 | FALSE | NA | NA | FALSE | FALSE | strict_14_with_grace_period | FALSE | FALSE | 1 | 0.17 |
3 | 3 | 70 | 2018-10-18 | 70 | 2010-08-23 | 2018-09-06 | 98 | 10 | 10 | 10 | 10 | 10 | 9 | FALSE | NA | NA | FALSE | FALSE | moderate | FALSE | FALSE | 2 | 0.70 |
From the last 24 columns we will keep the following:
And drop the following:
Finally, we can build a new data frame which consists of all variables of interest ( in total 37):
dim(airbnb_data)
## [1] 25946 37
glimpse(airbnb_data[7:15])
## Observations: 25,946
## Variables: 9
## $ host_identity_verified <lgl> FALSE, FALSE, TRUE, FALSE, TRUE, FALSE,...
## $ neighbourhood <chr> "Nørrebro", "Indre By", "Indre By", "Ve...
## $ neighbourhood_cleansed <chr> "Nrrebro", "Indre By", "Indre By", "Ves...
## $ latitude <dbl> 55.68798, 55.69163, 55.67590, 55.67069,...
## $ longitude <dbl> 12.54571, 12.57459, 12.57698, 12.55430,...
## $ property_type <chr> "Apartment", "House", "House", "Apartme...
## $ room_type <chr> "Private room", "Entire home/apt", "Ent...
## $ accommodates <dbl> 2, 6, 12, 2, 4, 3, 6, 4, 4, 3, 2, 3, 2,...
## $ bathrooms <dbl> 1.0, 1.5, 2.5, 1.0, 1.0, 1.0, 2.0, 1.0,...
Now we need to perform some steps that are crucial in order to have reliable results in the end. First, we need to make some reasonable assumption. It does not make sense to analyze listings which did not receive any reviews yet and are not verified.
# First cleaning including minimum numbers of review and verified host profile
airbnb_clean <- airbnb_data %>%
filter(host_identity_verified == "TRUE" & number_of_reviews > 0)
dim(airbnb_clean)
## [1] 9772 37
You can see how drastically our number of observations is reduced from 26.000 to almost 9.000.
Next, we will clean all variables that contain prices and convert them to the right format. The variable “extra_people” also consists of $ signs and is therefore recorded as well. Again, we will make the assumptions that we only consider listings which price is above 0 and below 17.500 Dkk.
airbnb_clean <- airbnb_clean %>%
mutate(cleaning_fee_dkk = as.numeric(gsub("[\\$,]", "", airbnb_clean$cleaning_fee))) %>%
mutate(price_dkk = as.numeric(gsub("[\\$,]", "", airbnb_clean$price))) %>%
mutate(extra_people_dkk = as.numeric(gsub("[\\$,]", "", airbnb_clean$extra_people))) %>%
mutate(security_deposit_dkk = as.numeric(gsub("[\\$,]", "", airbnb_clean$security_deposit))) %>%
filter(price_dkk > 0 & price_dkk < 17500 & security_deposit_dkk < 17500)
dim(airbnb_clean)
## [1] 5074 41
Thirdly, we clean the following variables:
airbnb_clean <- airbnb_clean %>% mutate(
superhost = case_when(
host_is_superhost == "TRUE" ~ 1,
host_is_superhost == "FALSE" ~ 0
),
instant = case_when(
instant_bookable == "TRUE" ~ 1,
instant_bookable == "FALSE" ~ 0
)
)
# Clean the names
airbnb_clean <- airbnb_clean %>%
mutate(Neighbourhood=case_when(
str_detect(neighbourhood_cleansed, "Amager st") ~ "Amager Strand",
str_detect(neighbourhood_cleansed, "Amager Vest") ~ "Amager Vest",
str_detect(neighbourhood_cleansed, "Vanlse") ~ "Vanløse",
str_detect(neighbourhood_cleansed, "Nrrebro") ~ "Nørrebro",
str_detect(neighbourhood_cleansed, "Brnshj-Husum") ~ "Brønshøj",
str_detect(neighbourhood_cleansed, "sterbro") ~ "Østerbro",
str_detect(neighbourhood_cleansed, "Vesterbro-Kongens Enghave") ~ "Vesterbro",
TRUE ~ neighbourhood_cleansed
))
For the type of property, we only want types that are mentioned more than 20 times.
airbnb_clean$property_type <- airbnb_clean$property_type %>%
str_replace(., " \\& ", "_") %>%
str_replace(., "\\/", "_") %>%
as_factor()
sort(table(airbnb_clean$property_type), decreasing = T)
##
## Apartment Condominium House
## 4214 384 222
## Townhouse Loft Villa
## 107 85 16
## Houseboat Bungalow Guest suite
## 9 7 7
## Serviced apartment Boat Bed and breakfast
## 5 4 3
## Hostel Other Cabin
## 2 2 2
## Camper_RV Guesthouse Island
## 2 1 1
## Tiny house
## 1
Moreover, we want to look at listings duration, i.e. the number of days the listings exists. In addition, we create a new variable which shows us the price per person per night.
airbnb_clean <- airbnb_clean %>% mutate(
listing_duration = as.numeric(difftime(airbnb_clean$last_scraped, airbnb_clean$first_review, unit = "days")),
price_person = price_dkk/accommodates)
summary(airbnb_clean$listing_duration)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1.0 446.5 812.0 845.2 1178.0 2926.0 3
summary(airbnb_clean$price_person)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 23.67 174.00 226.50 256.17 300.50 4999.33
Before we can start with the more interesting visualization part, we need to transform some variables into dummy variables for the regression analysis later on. Pleasenote that there are only 17 Shared Rooms in the data set which is why we will drop it from further analysis. Furthermore, we create an additive index with all “review” variables. You will see that the variables and therefore the index are heavily right-skewed.
airbnb_clean <- airbnb_clean %>% mutate(
rtype = case_when(
room_type == "Shared room" ~ NA_character_,
room_type == "Entire home/apt" ~ "Entire Apartment",
room_type == "Private room" ~ "Private"
),
home = case_when(
room_type == "Shared room" ~ NA_real_, # drop Shared Rooms
room_type == "Entire home/apt" ~ 1,
room_type == "Private room" ~ 0
),
strict_cancel = case_when(
cancellation_policy == "strict_14_with_grace_period" ~ 1,
cancellation_policy == "moderate" ~ 0,
cancellation_policy == "flexible" ~ 0
),
index = ((airbnb_clean$review_scores_accuracy + airbnb_clean$review_scores_cleanliness
+ airbnb_clean$review_scores_checkin +airbnb_clean$review_scores_communication
+ airbnb_clean$review_scores_location + airbnb_clean$review_scores_value)/6)
) %>%
filter(!is.na(rtype))
Finally, in order to calculate the distance from the listings to the metro stations we need additional data:
library(rvest)
metroURL <- "https://en.wikipedia.org/wiki/List_of_Copenhagen_Metro_stations"
metro_scrap <- metroURL %>%
read_html %>%
html_nodes(xpath='//th') %>% html_nodes("a") %>% html_attr("href") %>% na.omit() %>%
paste0("https://en.wikipedia.org", .) #create link, we only need first 22 lists
# Using purrr instead of for-loops
library(purrr)
# Extract the geo locations and names of the metro stations
names <- map_df(metro_scrap[1:22], ~ tibble(names = read_html(.) %>% html_nodes("#firstHeading") %>% html_text())) %>% distinct()
geo <- map_df(metro_scrap[1:22], ~ tibble(coor = read_html(.) %>% html_nodes(".geo") %>% html_text())) %>%
distinct()
Numextract_coord <- function(string){
as.data.frame(as.numeric(unlist(regmatches(string, gregexpr("[[:digit:]]+\\.*[[:digit:]]*", string)))))
}
df <- Numextract_coord(geo$coor)
lng <- df %>% dplyr::filter(row_number() %% 2 == 0) ## Select even rows
lat <- df %>% dplyr::filter(row_number() %% 2 == 1) ## Select odd rows
metro_df <- cbind(names, lat,lng)
colnames(metro_df) <- c("metro","lat", "long")
metro_df[1:3,]
## metro lat long
## 1 Amager Strand Station 55.65611 12.63167
## 2 Amagerbro Station 55.66336 12.60294
## 3 Bella Center Station 55.63806 12.58294
library(geosphere)
metro_sp <- metro_df[,c("lat", "long")]
# Distance measure to measure the distance between a station and an accommodation
# This is what the haversine formula looks like (it calculates the great-circle distance between two points on a sphere using their longitudes and latitudes. It was in principal aimed at determine the position of a ship. @robusto1957cosine)
hav.dist <- function(long1, lat1, long2, lat2) {
R <- 6371
diff.long <- (long2 - long1)
diff.lat <- (lat2 - lat1)
a <- sin(diff.lat/2)^2 + cos(lat1) * cos(lat2) * sin(diff.long/2)^2
b <- 2 * asin(pmin(1, sqrt(a)))
d = R * b
return(d)
}
# # we get a matrix that contains in the first row the distances between the first accomodation
# and all metro stations:
dist_metacc <- geosphere::distm(cbind(airbnb_clean$longitude, airbnb_clean$latitude),
cbind(metro_sp$lon, metro_sp$lat),
fun = distHaversine)
summary(dist_metacc[,1]) # for the first metro
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 130.3 4755.1 5773.2 5683.1 7017.0 12692.5
head(dist_metacc[,1:3]) # Distances from the first six accomodations to the first three metros
## [,1] [,2] [,3]
## [1,] 4079.600 2145.826 4228.463
## [2,] 6294.354 4322.552 5105.278
## [3,] 5324.121 3534.447 5771.846
## [4,] 5718.512 3752.404 4552.199
## [5,] 6167.790 4249.304 5929.451
## [6,] 7327.779 5576.124 7670.497
# now get the index of the smallest value in each row (margin = 1)
# in other words: for each of the accomodations, get the index of the metro station that is closest
minidx <- apply(dist_metacc, 1, which.min)
print(minidx[1:5])
## [1] 13 10 17 9 9
# add result to data
library(matrixStats)
airbnb_clean$distance <- rowMins(as.matrix(dist_metacc))
head(airbnb_clean$distance)
## [1] 640.8608 656.8279 684.2862 1052.7918 735.8208 2578.1357
# Lets create a proxy "central" in order to control for that
# lat =55.679687, lng = 12.590659 (Coordinates of Nyhaven)
library(AirBnBCopenhagen)
nyhavn_lng <- 12.590659
nyhavn_lat <- 55.679687
airbnb_clean$dist_centrum <- AirBnBCopenhagen::distance(airbnb_clean$longitude,
airbnb_clean$latitude,
nyhavn_lng, nyhavn_lat)
We calculated the distance between the location of a listed rental and the city center, calculated using “Harversine formula” with latitude and longitude in line with Robusto (1957).
Statistic | Mean | St. Dev. | Median | Min | Max |
Price per night (DKK) | 818.01 | 538.99 | 711 | 71 | 14,998 |
Review Index | 9.68 | 0.39 | 9.83 | 4.33 | 10.00 |
Strict Cancellation | 0.36 | 0.48 | 0 | 0 | 1 |
Full apartment/house | 0.86 | 0.35 | 1 | 0 | 1 |
Cleaning Fee (DKK) | 287.12 | 208.14 | 250 | 0 | 4,300 |
Superhost | 0.17 | 0.38 | 0 | 0 | 1 |
Duration of Listing (days) | 833.22 | 529.95 | 804 | 1 | 2,926 |
Instant Bookable | 0.21 | 0.41 | 0 | 0 | 1 |
Security Deposit (DKK) | 1,292.10 | 1,924.58 | 800 | 0 | 16,000 |
No. Accommodates | 3.45 | 1.64 | 3 | 1 | 16 |
Minimum Nights | 3.69 | 17.80 | 3 | 1 | 999 |
No. Bathrooms | 1.07 | 0.27 | 1.00 | 0.00 | 5.50 |
Distance Metro | 1,352.66 | 907.73 | 1,217.30 | 35.46 | 5,362.01 |
Distance Center | 3,087.36 | 1,393.21 | 2,990.55 | 35.61 | 9,238.55 |
Now we have the data in a format ready for visualizing and the regression. The full code can be found in the source code.
Robusto, C Carl. 1957. “The Cosine-Haversine Formula.” The American Mathematical Monthly 64 (1). JSTOR: 38–40.
Wang, Dan, and Juan L Nicolau. 2017. “Price Determinants of Sharing Economy Based Accommodation Rental: A Study of Listings from 33 Cities on Airbnb. Com.” International Journal of Hospitality Management 62. Elsevier: 120–31.