knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Introduction

This package is created for price analysis of shopping sites.The motivation behind it is the problems that shoppers face when looking at two different sites and wanting to easily compare the prices. In this package will be ways to compare prices in a data frame while also searching the table. Other functions includes web scrapping for price bar plots, currency changes, and parsing numbers. This can be used for big shopping events like black Friday or even better cyber Monday. In the future I would like to update the currency function to take in more currencies and update the functionality of the bar plots.

library(shopscrape)

Installation

Run the command

Install.packages("shopscrape")

Functions

Webscrapping Functions

shopScrape("https://www.thereformation.com/categories/new?gclid=CjwKCAiAm7OMBhAQEiwArvGi3EYt2jozZbzQktEYy2iInclcxHpJKKnWfqu3Jo2mHfABJ-R90ghQVhoCmwAQAvD_BwE" , ".product-prices__price span , .product-summary__name a","https://www.zara.com/us/en/woman-must-haves-l4503.html?v1=1609213", ".price__amount-current , #main .link span")
basicPrice("https://www.thereformation.com/categories/new?gclid=CjwKCAiAm7OMBhAQEiwArvGi3EYt2jozZbzQktEYy2iInclcxHpJKKnWfqu3Jo2mHfABJ-R90ghQVhoCmwAQAvD_BwE" , ".product-prices__price span , .product-summary__name a")
priceAna("https://www.thereformation.com/categories/new?gclid=CjwKCAiAm7OMBhAQEiwArvGi3EYt2jozZbzQktEYy2iInclcxHpJKKnWfqu3Jo2mHfABJ-R90ghQVhoCmwAQAvD_BwE" , ".product-prices__price span , .product-summary__name a")
library(rvest)
resultsZara <- read_html("https://www.zara.com/us/en/woman-must-haves-l4503.html?v1=1609213")


vals <- priceNum(resultsZara,".price__amount-current")

Currency Exchange Function

currencyFunc(usd= 2.78)
currencyFunc(euro=3)

Format Function

x<- c(1:10)
y<- c(1:9)

samelNA(x,y)

Future Work

This package can be used in the future to do a price analysis of similar type of eCommerce stores. For example, one can do a study of the two similar eCommerce stores that sells groceries and clothes like Walmart and Target. To do so you would create a table of their products with my shopScrape function to get a general view. Then you can use the priceAna function to generate a histogram of the products based on their category.



getbarnes/shopscrape documentation built on Jan. 8, 2022, 8:42 a.m.