l******n 发帖数: 9344 | 1 自己写了一个function,和一个package里边的函数同名
如果需要同时使用,咋办? | a***d 发帖数: 336 | 2 this is what I usually do. there are probably much better ways of doing it.
your function is usually in .globalEnv unless you specify otherwise.
so to get your function, use:
fun1 <- get(funcNm, env=.GlobalEnv)
use search() to find out position of the package. if the package is the nth
package in the search path, use:
fun2 <- get(funcNm, pos=n)
【在 l******n 的大作中提到】 : 自己写了一个function,和一个package里边的函数同名 : 如果需要同时使用,咋办?
| l******n 发帖数: 9344 | 3 good, thanks
nth
【在 a***d 的大作中提到】 : this is what I usually do. there are probably much better ways of doing it. : your function is usually in .globalEnv unless you specify otherwise. : so to get your function, use: : fun1 <- get(funcNm, env=.GlobalEnv) : use search() to find out position of the package. if the package is the nth : package in the search path, use: : fun2 <- get(funcNm, pos=n)
| t*****i 发帖数: 426 | |
|