buildProd: Build Product Data

View source: R/buildProd.R

buildProdR Documentation

Build Product Data


Builds a unique product identifier and price. The price of the product is generated randomly within the minimum and the maximum range provided as input.


buildProd(numOfProd, minPrice, maxPrice)



A number. This defines the number of unique products.


A number. This is the minimum value of the product's price range.


A number. This is the maximum value of the product's price range.


A product ID is alphanumeric with prefix "sku" which signifies a stock keeping unit. This prefix is followed by a numeric ranging from 1 and extending to the number of products provided as the argument within the function. For example, if there are 10 products, then the product ID will range from sku01 to sku10. This ensures that the product ID is always of the same length. For these product IDs, the product price will be within the range of minPrice and maxPrice arguments.


A character with product identifier and price.


df <- buildProd(numOfProd = 1000, minPrice = 5, maxPrice = 100)
df <- buildProd(numOfProd = 29, minPrice = 3, maxPrice = 50)

conjurer documentation built on Jan. 22, 2023, 1:16 a.m.