Given the following list, do I need to choose between cleaner code or autocompletion or can I have both? I'm using the newest version of RStudio on MacOS 10.10.5.
> l <- list()
> l$`__a` <- data.frame(`__ID` = stringi::stri_rand_strings(10, 1), col = stringi::stri_rand_strings(10, 1), check.names = F )
> l$`__b` <- data.frame(`__ID` = stringi::stri_rand_strings(10, 1), col = stringi::stri_rand_strings(10, 1), check.names = F )
> l$`__c` <- data.frame(`__ID` = stringi::stri_rand_strings(10, 1), col = stringi::stri_rand_strings(10, 1), check.names = F )
Autocomplete, but with backtick symbols (less clean and more difficult to programmatically manipulate):
> l$`__a`
__ID col
1 i u
2 4 V
3 b Y
4 j B
5 k d
6 Z Q
7 T H
8 f A
9 j Y
10 k P
With the [
operator and strings (more clean and easier to programmatically manipulate, but without autocomplete):
> l[["__a"]]
__ID col
1 i u
2 4 V
3 b Y
4 j B
5 k d
6 Z Q
7 T H
8 f A
9 j Y
10 k P
Or is there a third possibility, for example writing all of the code first with backtick symbols and then finding a way to automatically replace them with [[
and ]]
?