Not sure whether it's intended or not, but there are comments on this in the documentation:
For tempdir , the path of the per-session temporary directory.
On Windows, both will use a backslash as the path separator.
On a Unix-alike, the value will be an absolute path (unless tmpdir is set to a relative path), but it need not be canonical (see normalizePath ) and on macOS it often is not.
Check this:
> tempdir_output <- tempdir()
> normalised_tempdir_output <- normalizePath(tempdir_output)
>
> tempdir_output
[1] "/var/folders/p4/qzqlr4dd6s97ykbwztn90nlwrkzyyg/T//RtmpBs7sMr"
> normalised_tempdir_output
[1] "/private/var/folders/p4/qzqlr4dd6s97ykbwztn90nlwrkzyyg/T/RtmpBs7sMr"