fusen icon indicating copy to clipboard operation
fusen copied to clipboard

Create RStudio Add-ins and snippets to add partial templates

Open statnmap opened this issue 4 years ago • 1 comments

You probably have it already, but I can think of Rstudio add-in which creates the properly named {fusen}-chunks. User chooses "Add example", "Add function" and the chunk is created with correct name.

This will create the complete set function, example, tests.

  • [ ] Allow to name with a function name like
    • [x] Create a function that allows to add this template. A parameter is the name of the "my_name" function.
    • [x] Create the RStudio Addin that asks for the parameter
    • [ ] Create a snippet if it is possible ?
## my_name
```{r function-my_name}
my_name <- function(){
}
```

```{r example-my_name}
my_name()
```

```{r tests-my_name}
test_that("my_name works", {
  expect_error(my_name(), regexp = NA)
})
```

statnmap avatar Jul 06 '21 12:07 statnmap

Maybe "Add a function chunkset" and it adds function, example and test chunks.

dmi3kno avatar Jul 08 '21 10:07 dmi3kno

The addin is implemented and you can define a custom function name:
image image

statnmap avatar Jun 02 '23 13:06 statnmap