RosettaCodeData/Task/Call-a-foreign-language-function/R/call-a-foreign-language-function-2.r
2026-04-30 12:34:36 -04:00

6 lines
190 B
R

s <- "Hello World!"
system("R CMD SHLIB rtask.c")
dyn.load("rtask.dll")
#Output from .C() is always a list, so take only the first element from it
result <- .C("test", s)[[1]]
print(result)