Before any analysis can begin, the R environment must be in a clean state and the raw dataset must be read into memory. This step removes any leftover objects from previous sessions and loadsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/frxxxnz/1ACC0216-TB1-2026-1/llms.txt
Use this file to discover all available pages before exploring further.
hotel_bookings.csv into a data frame that all subsequent sections will operate on.
Cleaning the environment
Callingrm(list=ls()) deletes every object currently held in memory. This prevents name collisions and ensures that results are fully reproducible when the script is re-run from the top.
upc-grupo5-tb1.R
Reading the CSV file
upc-grupo5-tb1.R
read.csv() is a convenience wrapper around read.table() pre-configured for comma-separated files. The two explicit parameters matter for downstream processing:
| Parameter | Value | Effect |
|---|---|---|
header | TRUE | Treats the first row of the file as column names rather than data. |
stringsAsFactors | FALSE | Keeps character columns as plain character vectors. Factors are created explicitly in section 3.3, which gives full control over level ordering. |
df, the data frame used throughout the rest of the workflow.
The working directory must contain
hotel_bookings.csv. Set it with setwd() or through your IDE’s project settings before running this script. You can verify the current directory with getwd().