# agridatasets - A Comprehensive Collection of Agricultural and Agronomic Datasets # Version 0.1.1 # 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 . # soybean_cultivars library(testthat) # Test 1: Check that the object is a data.frame and has 3 columns test_that("soybean_cultivars is a data.frame with 3 columns", { expect_s3_class(soybean_cultivars, "data.frame") expect_equal(ncol(soybean_cultivars), 3) expect_equal(length(soybean_cultivars), 3) }) # Test 2: Check the number of rows test_that("soybean_cultivars has 40 rows", { expect_equal(nrow(soybean_cultivars), 40) }) # Test 3: Validate column names test_that("soybean_cultivars has correct column names", { expect_named( soybean_cultivars, c("cult", "bloc", "prod") ) }) # Test 4: Check data types test_that("soybean_cultivars has correct data types", { expect_s3_class(soybean_cultivars$cult, "factor") expect_equal(nlevels(soybean_cultivars$cult), 10) expect_s3_class(soybean_cultivars$bloc, "factor") expect_equal(nlevels(soybean_cultivars$bloc), 4) expect_type(soybean_cultivars$prod, "double") })