part 3 Flashcards
three-way match
- purchase order
- goods receipt
- invoice
all.x = TRUE (merging)
merging should be done in a left-join
left-join
all rows from the left data frame will be included in the result, and matching rows from the right data frame will be added based on the specified columns
use pivot_longer() to reproduce the same result - bank_fin<-gather(bank_fin, key = ‘metric’, value = value, price, change, percent_change, volume, vol_ave, capitalization, pe_ratio)
bank_fin2 <- bank_fin |> pivot_longer(
cols = price:pe_ratio,
names_to = ‘metric’,
values_to = ‘value’)
str(bank_fin2)
set.seed function (R)
ensures that the sequence of random numbers generated byy the computer is reproducible. If you set the same seed, you’ll get the same sequence of random numbers every time you run the code