我见过有人将矢量元素粘贴到其RStudio编辑器中,然后通过键盘快捷键将这些元素转置到编辑器中。此快捷方式实质上在矢量元素之间的每个空间处引入了换行符。在此向量的转置视图中,程序员可以使用RStudio的Alt + Click功能在每个元素之后添加文本(例如逗号),然后将所有项目转置回宽视图。
我查看了RStudio KeyBoard Shortcuts Cheat Sheet,但在这里没有发现任何描述。
在RStudio编辑器中是否有键盘快捷键可以执行从宽到长的转换?
# stage 1 original vector pasted into editor
"element1" "element2" "element3"
# stage 2 transpose to long view of vector via unknown keyboard shortcut
"element1"
"element2"
"element3"
# stage 3 place cursor after each element simultaneously via alt + click and then add commas to all lines simultaneously
"element1",
"element2",
"element3",
# final stage tranpose back to wide view
"element1", "element2", "element3",