If you are a package author, you are hopefully well aware of upcoming changes in package structure when we move to 2.14 in about a week. One of the changes is that all packages will require a NAMESPACE, and one will be generated for you in the event you do not make one (the R equivalent of your Miranda rights in the US). So being good citizen I was trying to figure this out. Here is the section from R-exts:
1.6.5 Summary – converting an existing package
To summarize, converting an existing package to use a namespace involves several simple steps:
Identify the public definitions and place them in export directives. Identify S3-style method definitions and write corresponding S3method declarations. Identify dependencies and replace any require calls by import directives (and make appropriate changes in the Depends and Imports fields of the DESCRIPTION file). Replace .First.lib functions with .onLoad functions or useDynLib directives.
To ensure I do the right thing here, can someone give a short clear definition/answer (am I breaking a rule by having several small but related questions together?). All answers should take 2.14 into account, please:
- A definition of NAMESPACE as used by R
- Is there a way to generate a NAMESPACE prior to build and check, or do we b/c once and then edit the NAMESPACE created automatically?
- The difference between "Depends:" and "Imports:" in the DESCRIPTION file. In particular, why would a I put a package in "Depends:" instead of the "Imports:" or vice versa?
- It sounds like "require" is no longer to be used, though it doesn't say that. Is this the correct interpretation?
Thanks!