# agridatasets - A Comprehensive Collection of Agricultural and Agronomic Datasets # Version 0.1.0 # Copyright (C) 2026 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 . # arabica_water library(testthat) # Test 1: Check that the object is a data.frame and has 8 columns test_that("arabica_water is a data.frame with 8 columns", { expect_s3_class(arabica_water, "data.frame") expect_equal(ncol(arabica_water), 8) expect_equal(length(arabica_water), 8) }) # Test 2: Check the number of rows test_that("arabica_water has 4 rows", { expect_equal(nrow(arabica_water), 4) }) # Test 3: Validate column names test_that("arabica_water has correct column names", { expect_named( arabica_water, c("code", "s3_a", "s2_a", "s1_a", "s1_b", "s2_b", "s3_b", "wts") ) }) # Test 4: Check data types test_that("arabica_water has correct data types", { expect_type(arabica_water$code, "character") expect_type(arabica_water$s3_a, "character") expect_type(arabica_water$s2_a, "character") expect_type(arabica_water$s1_a, "character") expect_type(arabica_water$s1_b, "character") expect_type(arabica_water$s2_b, "character") expect_type(arabica_water$s3_b, "character") expect_type(arabica_water$wts, "character") })