I did programming my method in c++ as function named "test.cc".The syntax of my program is;
./test input.fasta theta > output.txt
Where input.fasta is data file
>0 1000 0
100
>0 1000 1
100
>0 1000 2
101
Theta is numeric value range 2 to 10. The output stored in output.txt file.
For developing R package; First I complied it using following command.
R CMD SHLIB test.cc
that produced "test.dll" file. I load it in R by using following command;
dyn.load("test.dll")
I am trying to call test function, but it gives error while reading data;
.C("test", as.double(input.fasta), as.integer(theta))
I have no experience of using this command; Problem is that how I read input.fasta to .C() and write output to file.
I would be thankful if you provide some idea to deal with this problem.