{"id":16614835,"url":"https://github.com/renkun-ken/vscode-rcpp-demo","last_synced_at":"2025-03-21T14:31:21.233Z","repository":{"id":75471002,"uuid":"230275489","full_name":"renkun-ken/vscode-rcpp-demo","owner":"renkun-ken","description":"A demo project of writing and debugging Rcpp in VSCode","archived":false,"fork":false,"pushed_at":"2023-09-11T13:48:41.000Z","size":23,"stargazers_count":54,"open_issues_count":1,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-15T06:14:34.675Z","etag":null,"topics":["debugging","demo","rcpp","rstats","vscode"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renkun-ken.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-26T14:13:17.000Z","updated_at":"2024-06-27T17:15:51.000Z","dependencies_parsed_at":"2024-10-28T10:30:24.441Z","dependency_job_id":"8e104f22-4655-43f6-b5f8-5a64807a7757","html_url":"https://github.com/renkun-ken/vscode-rcpp-demo","commit_stats":{"total_commits":19,"total_committers":4,"mean_commits":4.75,"dds":"0.26315789473684215","last_synced_commit":"ba141df807e4e26f743a611219d186fe93619083"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renkun-ken%2Fvscode-rcpp-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renkun-ken%2Fvscode-rcpp-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renkun-ken%2Fvscode-rcpp-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renkun-ken%2Fvscode-rcpp-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renkun-ken","download_url":"https://codeload.github.com/renkun-ken/vscode-rcpp-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244815167,"owners_count":20514908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","demo","rcpp","rstats","vscode"],"created_at":"2024-10-12T02:07:56.082Z","updated_at":"2025-03-21T14:31:21.221Z","avatar_url":"https://github.com/renkun-ken.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vscode-rcpp-demo\n\nThis project is a minimal example of writing and debugging [Rcpp](http://www.rcpp.org/) in VSCode.\n\nFor writing and debugging [cpp11](https://cpp11.r-lib.org) in VSCode, you may\ngo to [vscode-cpp11-demo](https://github.com/renkun-ken/vscode-cpp11-demo).\n## Preview\n\n* Code editing\n\n![Code editing](https://user-images.githubusercontent.com/4662568/71535253-8f2d2380-293f-11ea-920e-8a58a944fb50.gif)\n\n* Debugging\n\n![Debugging](https://user-images.githubusercontent.com/4662568/71535254-8f2d2380-293f-11ea-85cc-0828234d3c26.gif)\n\n## Configuration\n\nBefore configuration, install VSCode [C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).\n\n### Code editing\n\nFor C/C++ source code editing, only `.vscode/c_cpp_properties.json` is needed. When the proper paths of included headers are\nprovided, the full-featured C/C++ editing features including auto-completion, hover, definition, type inference, etc. will work.\nSource code editing does not require that the code is in a package.\n\nIn this repo, `c_cpp_properties.json` is supposed to work with R 4.0 under Ubuntu 16.04 or above. You may need to alter the\npaths according to your system and C/C++ dependencies of your package.\n\nFor example, if your package depends on [RcppArmadillo](https://github.com/RcppCore/RcppArmadillo), you may run the following R\ncode to determine the include path:\n\n```r\nRcppArmadillo:::CxxFlags()\n```\n\nThen you may add the following path to `includePath`:\n\n```text\n${env:HOME}/R/x86_64-pc-linux-gnu-library/4.0/RcppArmadillo/include\n```\n\nFor more code editing features, please visit [Edit C++ in Visual Studio Code](https://code.visualstudio.com/docs/cpp/cpp-ide).\n\n### Debugging\n\nRcpp debugging is easy to configure when the code is in an R package that uses Rcpp like how this repo is organized.\n\nSince `R` is not a binary executable but a bash script in which required environment variables are setup to start an R session,\nwe also need to setup those environment variables for the debugger to run the R session.\n\n`.vscode/debug.R` and `.vscode/tasks.json` are the code to capture those environment variables and to run before debugging.\nYou may need, initially, to run twice in debugging mode before environment variables are properly picked up in `.vscode/.env`\n\n`.vscode/launch.json` defines the debugger configuration which in this repo works for R 4.0 under Ubuntu 16.04 or above.\n\nFor more debugging features, please visit [Debug C++ in Visual Studio Code](https://code.visualstudio.com/docs/cpp/cpp-debug).\n\n## More information\n\nWhen properly configured, the Rcpp development environment is full-featured as general C/C++ development in VSCode.\n\nPlease visit [C/C++ for Visual Studio Code](https://code.visualstudio.com/docs/languages/cpp) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenkun-ken%2Fvscode-rcpp-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenkun-ken%2Fvscode-rcpp-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenkun-ken%2Fvscode-rcpp-demo/lists"}