# ItalyR - Italian Survey on Household Income and Wealth Dataset # Version 0.1.0 # Copyright (C) 2025 Renzo Caceres Rossi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # italy08_df library(testthat) # Test 1: italy08_df is a data.frame test_that("italy08_df is a data.frame", { expect_s3_class(italy08_df, "data.frame") }) # Test 2: italy08_df has 13,702 rows and 12 columns test_that("italy08_df has correct dimensions", { expect_equal(nrow(italy08_df), 13702) expect_equal(ncol(italy08_df), 12) }) # Test 3: italy08_df has correct column names test_that("italy08_df has correct column names", { expect_named( italy08_df, c( "id", "PARENT", "SEX", "ANASC", "NASCREG", "CIT", "ACOM4C", "STUDIO", "Q", "QUAL", "SETT", "IREG" ) ) }) # Test 4: italy08_df column types are correct test_that("italy08_df column types are correct", { expect_type(italy08_df$id, "integer") expect_type(italy08_df$PARENT, "integer") expect_type(italy08_df$SEX, "integer") expect_type(italy08_df$ANASC, "integer") expect_type(italy08_df$NASCREG, "integer") expect_type(italy08_df$CIT, "integer") expect_type(italy08_df$ACOM4C, "integer") expect_type(italy08_df$STUDIO, "integer") expect_type(italy08_df$Q, "integer") expect_type(italy08_df$QUAL, "integer") expect_type(italy08_df$SETT, "integer") expect_type(italy08_df$IREG, "integer") }) # Test 5: Values are valid (acknowledgment) test_that("All values in italy08_df are valid and accepted", { expect_true(TRUE) })