# 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 . # apple_canker library(testthat) # Test 1: Check that the object is a data.frame and has 5 columns test_that("apple_canker is a data.frame with 5 columns", { expect_s3_class(apple_canker, "data.frame") expect_equal(ncol(apple_canker), 5) expect_equal(length(apple_canker), 5) }) # Test 2: Check the number of rows test_that("apple_canker has 36 rows", { expect_equal(nrow(apple_canker), 36) }) # Test 3: Validate column names test_that("apple_canker has correct column names", { expect_named( apple_canker, c("inoculum", "gen", "block", "y", "n") ) }) # Test 4: Check data types test_that("apple_canker has correct data types", { expect_type(apple_canker$inoculum, "integer") expect_s3_class(apple_canker$gen, "factor") expect_equal(nlevels(apple_canker$gen), 3) expect_s3_class(apple_canker$block, "factor") expect_equal(nlevels(apple_canker$block), 4) expect_type(apple_canker$y, "integer") expect_type(apple_canker$n, "integer") })