Skip to main content

Documentation 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.

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 loads hotel_bookings.csv into a data frame that all subsequent sections will operate on.

Cleaning the environment

Calling rm(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
# Limpiar el entorno de trabajo
rm(list=ls())

Reading the CSV file

upc-grupo5-tb1.R
# Cargar el dataset con parámetros requeridos
df <- read.csv("hotel_bookings.csv", header = TRUE, stringsAsFactors = FALSE)
read.csv() is a convenience wrapper around read.table() pre-configured for comma-separated files. The two explicit parameters matter for downstream processing:
ParameterValueEffect
headerTRUETreats the first row of the file as column names rather than data.
stringsAsFactorsFALSEKeeps character columns as plain character vectors. Factors are created explicitly in section 3.3, which gives full control over level ordering.
The result is assigned to 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().

Build docs developers (and LLMs) love