The snippet edition via my package

For example, we type mat then the R studio predicts as follows:

matrix(data, nrow = rows, ncol = cols)

By editing the snippet in the Tools > Global Options > Code > Edit Snippets , the R studio
can predict the variables names. But this is ONLY on my computer. I want to edit the snippet of the OTHER computer by my code included in my package so that the user of my package can use my functions more comfortably. #'@export can gives package user the completion (prediction). I expect such a thing for editing the snippet for the other computer.

Ref:https://stackoverflow.com/questions/54231387/how-to-define-a-function-so-that-the-r-studio-can-predict-its-variable?noredirect=1#comment95288943_54231387

maybe take a look at this package : https://github.com/dgrtwo/snippr

1 Like

Thank you for reply. I want to upload my package on CRAN. Unfortunately, your suggested package snippr is not on CRAN. I cannot use this package. but thank you. If is there some package on CRAN please let me know.

I do not know why someone is only upload only on github but not CRAN ? Is there some reason ?

It takes extra work to have a package satisfy CRAN's standard, and it might not get accepted. Also typically a package author wants to give his package a decent test run on github, have some feedback, solve the main bugs, be sure about the interface, document its function well etc... Breaking changes are less "forgiveable" when the package has been released on CRAN. You can open an issue and ask the author why the package isn't on CRAN, maybe he just thinks there's no demand.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.