0

For example, I am looking into a R function PTdensity.R source code in a package called DPpackage, where I found the author called a fortran function ptdensityu :

 foo <- .Fortran("ptdensityu", ...

The thing is how to find source code for ptdensityu subroutine. It may contains in a certain fortran file in /src/ directory, but how do I know which file is it. (Actually I found it by manually check each file under /src/ and found it is in the /src/PTudensity.f.)

Quick link for the package : link

PS: I used to use this link to search source code, but somehow it does not work any more.

2 Answers 2

2

On a linux box, you use the grep command. In emacs, you build a tags file. In other editors there's probably similar functions. In Windows, can't you right click on a folder, hit Search... and fill in the 'A word or phrase in the file" box. Or install cygwin and use the grep command.

Amazes me that people are using computers without basic skills such as finding a string in a file...

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. It is quite easy, powerful and useful with grep.
0

Have you untarred this...............?

(It was the first subroutine in PTudensity.f)

3 Comments

Yes, I untared it. But the thing is how can you know it's in that file. There might be hundreds of fortran files in /src .
I saw the PTudensity.f file in the directory and opened it in a text editor. There it was. It didn't seem that difficult. For more deeply buried items you should be able to use whatever operating system utilities you like to search within the /src/ directory. Spacedman gives you Linux and Windoze examples. On a Mac I suspect that the Finder search facility uses rep "under the hood".
Thanks. I am trying that. I just blamed myself how I missed the basic idea of 'finding' something. Thanks for the idea.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.