Does anyone know if it is possible to restrict the execution of a certain code created in R to a certain local machine? If so, what would be the code?
Does anyone know if it is possible to restrict the execution of a certain code created in R to a certain local machine? If so, what would be the code?
The Sys.info()
command returns system information, including the name of the machine on the network ( nodename
).
Sys.info()
# sysname release
# "Windows" "7 x64"
# version nodename
# "build 7601, Service Pack 1" "TBRDBZVRLZ1"
# machine login
# "x86-64" "tbrvlj"
# user effective_user
# "tbrvlj" "tbrvlj"
With this command you can identify nodename
and include a conditional in your code:
nname <- Sys.info()['nodename']
if(nname == 'TBRDBZVRLZ1') {
print("executa o código")
} else {
print("não executa o código")
}
# [1] "executa o código"