# data.frame(1:dim(data)[2],data %>% names)
# str(data)
# pulizia dei dati
data$floor[data$floor == "bj"] = 0
# indexNumeric = c(1,4,5,6,9,11,12,18,19,20,23,29,30,43)
data %>%
mutate_at(
vars(
price,
priceByArea,
parkingSpacePrice,
floor,
priceInfo,
size,
rooms,
bathrooms,
numPhotos,
parkingSpace,
latitude,
longitude,
),
as.numeric
) |>
mutate_at(
vars(
propertyType,
operation,
province,
municipality,
district,
country,
status,
newDevelopment,
detailedType,
highlight,
typology,
subTypology,
),
as.factor
) |>
mutate_at(
vars(
hasLift,
hasPlan,
has3DTour,
has360,
hasStaging,
hasVideo,
showAddress,
newDevelopmentFinished,
topNewDevelopment,
topPlus,
hasParkingSpace,
isParkingSpaceIncludedInPrice,
),
as.logical,
) |>
mutate(
across(district, \(x) str_replace_all(x, "-", " - ")),
city_area = if_else(is.na(neighborhood), district, neighborhood),
label = paste0(
"Title: ", title, "\n",
"District: ", city_area, "\n",
"Floor: ", floor, "\n",
"Size: ", size, " m^2\n",
"Price: ", dollar(price, prefix = "€", suffix = "k", scale = .001), "\n",
"Price for m^2: ", dollar(priceByArea, prefix = "€"), "\n",
"Property type: ", propertyType, "\n",
"Rooms: ", rooms, "\n",
"Bathrooms: ", bathrooms, "\n",
"Status: ", status, "\n"
),
) -> data