Re: [R] How to link two R packages together

2012-08-02 Thread Xuan Zhao
ome directory which is just the path shown after typing cd &&pwd. But It doesn't work, so I thought "~/" might be something else. Thank you so much for the help, I really appreciate that! Yours, Xuan -Original Message- From: R. Michael Weylandt [mailto:michael.

Re: [R] How to link two R packages together

2012-08-02 Thread Xuan Zhao
ey.ps...@gmail.com] Sent: Thursday, August 02, 2012 10:40 AM To: Xuan Zhao Cc: r-help@r-project.org Subject: Re: [R] How to link two R packages together Hi Xuan, I would expect ~/R/ to be the R_HOME directory, though perhaps I am wrong. Also, you only need a depends or an imports, not both. At a simpl

Re: [R] How to link two R packages together

2012-08-02 Thread Xuan Zhao
not the host of the server, does that matter? Thank you so much for the help! Yours, Xuan -Original Message- From: Bert Gunter [mailto:gunter.ber...@gene.com] Sent: Thursday, August 02, 2012 9:42 AM To: Joshua Wiley Cc: Michael Weylandt; r-help@r-project.org; Xuan Zhao Subject: Re: [R

[R] How to link two R packages together

2012-08-01 Thread xuan zhao
Hi, I have built two R packages. One of them (PKG1) needs to use the functions of the other package (PKG2). So I need to link these two packages together, so that the functions of PKG2 can be available to PKG1. And when I load one package using 'library("PKG1")', PKG2 can be loaded at the same. An

[R] Turn categorical array into matrix with dummy variables

2012-07-27 Thread xuan zhao
Hi All, I want to turn a categorical array (array with factors) into a matrix with dummy variables. like array=c(a,a,b,b,b) should be turned into: a b 1 0 1 0 0 1 0 1 0 1 Do you know any way of doing this? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Turn-categorical-a

[R] problem with loading the dynamic object(.so file) inside a R package

2012-06-22 Thread xuan zhao
I have built a R package including the C code. My question is: Can the shared object get loaded automatically as we load the R package? In my case, I have to do dyn.load("dirc/filename.so") in the R script to load the shared object, which is very inconvenient. Is there anyway to make R to load this