This paper presents gtapshape, an R package that allows the user to flexibly disaggregate the national endowments used in the computational general equilibrium (CGE) models based on the GTAP-AEZ framework.By allowing the user to specify the set of subnational boundaries in the form of a shapefile, gtapshape allows for a richer understanding of how within-country heterogeneity impacts the results of CGE models.gtapshape's modular strategy also allows for fast updating of the database as new sources of data become available.gtapshape is fully written in R and hosted in GitHub as free and open software.This should facilitate its incorporation into specialized workflows.