You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, we have code examples with comments explaining the code. It would be nice to be able to translate those comments.
Example:
Original:
# Load packages
library(tidyverse) # for {dplyr} functions and the pipe %>%
library(rio) # for importing data
library(here) # for easy file referencing
library(cleanepi)
Translated to Spanish:
# Cargar paquetes
library(tidyverse) # para las funciones de {dplyr} y el pipe %>%
library(rio) # para importar los datos
library(here) # para referencia sencilla de archivos
library(cleanepi)
The text was updated successfully, but these errors were encountered:
Currently we do not parse the code at all. To parse it and differentiate comments from code, we'd need to use a code parser (base R + xmlparsedata would allow us to use XPath; treesitter).
In code comments how would we escape code. For instance we don't want to translate variable names, package names, etc.
At the moment because we do not translate code comments, one would obtain better results by extracting/repeating the ideas of the code comments in text around the code chunks.
In the code below we use the packages tidyverse (for dplyr functions and the pipe), rio (for importing data), here (for easy file referencing) and cleanepi.
```r# Load packages
library(tidyverse) # for {dplyr} functions and the pipe %>%
library(rio) # for importing data
library(here) # for easy file referencing
library(cleanepi)
```
Sometimes, we have code examples with comments explaining the code. It would be nice to be able to translate those comments.
Example:
Original:
Translated to Spanish:
The text was updated successfully, but these errors were encountered: