# 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 . # timber_genetics library(testthat) # Test 1: Check that the object is a data.frame and has 10 columns test_that("timber_genetics is a data.frame with 10 columns", { expect_s3_class(timber_genetics, "data.frame") expect_equal(ncol(timber_genetics), 10) expect_equal(length(timber_genetics), 10) }) # Test 2: Check the number of rows test_that("timber_genetics has 224 rows", { expect_equal(nrow(timber_genetics), 224) }) # Test 3: Validate column names test_that("timber_genetics has correct column names", { expect_named( timber_genetics, c("Locality", "Year", "Replicate", "Subculture", "Elongation", "Multiples", "Rooting", "Germination", "Seed_Length", "Seed_Width") ) }) # Test 4: Check data types test_that("timber_genetics has correct data types", { expect_type(timber_genetics$Locality, "integer") expect_type(timber_genetics$Year, "integer") expect_type(timber_genetics$Replicate, "integer") expect_type(timber_genetics$Subculture, "integer") expect_type(timber_genetics$Elongation, "double") expect_type(timber_genetics$Multiples, "double") expect_type(timber_genetics$Rooting, "double") expect_type(timber_genetics$Germination, "integer") expect_type(timber_genetics$Seed_Length, "double") expect_type(timber_genetics$Seed_Width, "double") })