내가 가지고 있는 데이터 프레임을 " foo" 변수 이름 ',';;
> foo <-c(3,4);
내가 바라는 것은, ',' 에 변환하십시오 " foo" 문자열으로. 그래서 있는 함수
output <- myfunc(foo)
myfunc <- function(v1) {
# do something with v1
# so that it prints "FOO" when
# this function is called
#
# instead of the values (3,4)
return ()
}
'드파르세 사용할 수 있습니다' 와 '' 대체하십시오 afaq 함수명은 인수:
myfunc <- function(v1) {
deparse(substitute(v1))
}
myfunc(foo)
[1] "foo"