the codes
library(tidyverse)
library(logr)
library(sassy)
options("logr.autolog" = TRUE)
logdir <- 'C:/Temp/'
if (dir.exists(logdir)) {
files <- paste0(logdir,'*.log')
unlink(files)
}
flnm <- 'test.log'
logfl <- paste0(logdir,flnm)
try_log <- file.path(logfl)
lf <- log_open(try_log)
indf <- data.frame(
stringsAsFactors = FALSE,
measid = c(2,1,11073,11073,
11073,11073,3,11073,11073,4),
datec = c("12/22","11/22","10/22",
"09/22","08/22","07/22","06/22","05/22","04/22","03/22"),
n = c(76, 91, 100, 83, 94, 90, 110, 78, 111, 92),
msr_cd = c("STK-2","STK-1","STK-1",
"STK-1","STK-1","STK-3","STK-1","STK-1","STK-1","STK-4")
)
indf <- indf %>%
mutate(msr_cd=ifelse(measid==11073,'STK73',msr_cd))
lab <- data.frame(
stringsAsFactors = FALSE,
measid = c(1, 2, 3, 4),
color = c("Red","Blue","Green","Yellow")
)
all <- inner_join(indf,lab,by="measid")
str(all)
log_close()