kids_ages = c(12, 11, 12, 13, 14, 13, 12, 10, 12, 12, 14, 13)

mean(kids_ages)
median(kids_ages)

subset_ages = c(kids_ages < 11 | kids_ages>13)
subset_ages[1:length(subset_ages)]

names(kids_ages) = c("John", "Rachel", "Joe", "Anne", "Theresa", "Samuel", "Marcus", "Andrew", "Kate", "Jane", "Martha", "David")

kids_ages[c(2,4)]

kids_ages[5]
kids_ages[5] = 13
kids_ages[5]

under_12 = kids_ages[kids_ages<12]

under_12[1:length(under_12)]

product_pricing = c(5.6, 11.2, 4.5, 0.25, 1, 23)
product_pricing[1: length(product_pricing)]
# Half Price
half_price = product_pricing/2

half_price[1:length(half_price)]

#promoted price
promotion = product_pricing*(1+c(0.2,0,0.4,0,0.5,0))

promotion[1:length(promotion)]

# squared price
squared_prices = product_pricing*product_pricing

squared_prices[1:length(squared_prices)]

subset_products = product_pricing[1:3]
subset_products[1:3]

maximum_price = max(product_pricing)
maximum_price

num_products = length(product_pricing)
num_products

transform_price = (product_pricing+5)/product_pricing
transform_price[1:length(transform_price)]

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: