Wrapping R code in parenthesis like this (NCORES <- nb_cores()) ensures that the output of the function nb_cores() is both assigned to the variable NCORES and also printed to the R console.
(NCORES <- nb_cores())
nb_cores()
NCORES