what is wrong in the log file

Question1: I want to put a log file in c:/Temp/test.log.

The program below creates a sub-folder log and log file

in c:/Temp/log/test.log. Why is it not in c:/Temp/test.log?

Question2: I'm anticipating that contents in the log file

are the same as in console which contains codes and results.

But it only contains ambiguous notes (see attached 2)

Any suggestions? Thanks in advance!

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()

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.