Hi Lubomir:
There are a couple of ways to get the current logged in user in a LabKey R report.
-
There is an implicit variable "labkey.user.email" that will return the email address of any user. This and other substitutions are listed on the Help tab in the R report builder, and in the documentation here.
--
print(labkey.user.email)
-
You can use the Rlabkey package which includes "labkey.whoami" that will return the display name (or user ID) if you prefer that. You can also use the substitution token "labkey.url.base" to provide the URL for you. Documentation for Rlabkey is on CRAN here.
--
library(Rlabkey)
user <- labkey.whoAmI(labkey.url.base)
print(user$id)
print(user$displayName)
Hopefully one of these will meet your needs,
--Molly