Rstudio snippet editor glitching, making it extremely difficult to edit snippets - r

I'm having issues with Rstudio, where I'm trying to edit my code snippets, but when I go to Tools -> Global Options -> Code -> Edit Snippets.., the snippet editor opens up with the window behind the global options pop-up, while the text for the editor shows up in front of the global options pop up. I'm using R version 4.0.2, and I've tried deleting and re-downloading R and R studio, as well as restarting my session. I'll include a picture of my issue:
also, here's my session info
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.2 rsconnect_0.8.16 tools_4.0.2 yaml_2.2.1

Setting rendering engine to 'Desktop OpenGL' solved this for me.

Related

Is memory.limit() broken?

I run memory.limit() on my 48G Windows 10 machine and it returned 1.759219e+13. This is head scratching. I am using R 3.6.1.
Is memory.limit() broken? Any other way to obtain memory limit?
Here is my sessionInfo():
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.1 tools_3.6.1
This is an issue with RStudio (hopefully fixed in the next update). It works well in RGui.
You can use disk.frame::df_ram_size() instead. It works on Windows 10 with RStudio and R 3.6.1.
You can install disk.frame using install.packages("disk.frame")

Can't get the colon separator between figure number and caption in bookdown

I have this in my _bookdown.yml for a word document I'm trying to render with bookdown. Even if don't create a _bookdown.yml file, I still don't get a ":" separator.
delete_merged_file: true
language:
label:
fig: 'Figuee '
tab: 'TABLE '
ui:
chapter_name: "Chapter "
but it shows up in the word document as:
Figuee 1 blah-blah
with no colon between the figure number and the caption. For the life of me, I don't see where that is specified nor where I can change it. I'm sure I'm missing something simple somewhere.
sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server 2012 R2 x64 (build 9600)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bookdown_0.7
loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1 knitr_1.20 xfun_0.3
This is a bug of bookdown, which I just fixed on Github. Please try the development version:
remotes::install_github('rstudio/bookdown')

Unable to use svDialogs without attaching to search path

I need to obtain user input from the svDialogs R package, e.g. using svDialogs::dlgInput(). However, attempting to do this without attaching the package with library() or require() gives an error:
svDialogs::dlgInput("Example")
Error in svDialogs::dlgInput("Example") : attempt to apply non-function
The following works fine:
library(svDialogs)
svDialogs::dlgInput("Example")
Why might this be, and what might be a way around it? I have the current CRAN version of the package (0.9.57).
Update
I have tried installing previous versions of svDialogs, as well as comparing my code with the source code from the cgam package, which depends on svDialogs. Currently the entire svDialogs package is imported in my NAMESPACE, which is how it is used in cgam. But I still get the same error unless I first run library(svDialogs). Any tips?
Update 2
I also imported the entire svGUI package in my NAMESPACE, with no luck.
sessionInfo() R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale: [1] LC_COLLATE=English_United States.1252
LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages: [1] stats graphics grDevices utils
datasets methods base
other attached packages: [1] svDialogs_0.9-57 svGUI_0.9-55
loaded via a namespace (and not attached): [1] compiler_3.4.3
tools_3.4.3

Czech encoding in R

I have installed RStudio on a new computer, and has developed encoding issues. When I type accented text in console (no file writing or reading involved, just plain console) I lose Czech accents (as in this example - notice the accented N and Č)
> "Ňuf ňuf ňufičky"
[1] "Nuf nuf nuficky"
I know it is a settings issue - I have other R installations that behave correctly - but I am unable to find exact place in my settings to force UTF-8 behavior. Any help would be appreciated.
My session info is:
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.2 tools_3.4.2 yaml_2.1.14
For the benefit of posterity - I overcame my problem by setting code page to 1250 (while keeping US English as my language).
if (.Platform$OS.type == 'windows') {
Sys.setlocale(category = 'LC_ALL','English_United States.1250')
} else {
Sys.setlocale(category = 'LC_ALL','en_US.UTF-8')
}
in the .Rprofile
Perhaps:
new.locale <- ifelse(.Platform$OS.type=="windows", "Czech_Czech Republic.1250", "en_US.UTF-8")
Sys.setlocale("LC_CTYPE", new.locale)
Also learn to specify your OS.

Error attempting to write history

Before a project is open, R rapidly throws this error:
Surprisingly, I do not find anything related to this error with google. Even if, apparently, it does not cause problems to the working session, I am interested in its effects, to avoid possible future inconveniences.
> sessionInfo()
R version 3.2.4 (2016-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.2.4
Here an example of the subsequent working directory, even if this behaviour occurs for any project I open. It does not occurs when opening an isolated script.
getwd()
[1] "C:/Users/MaurizioLocale/OneDrive/Data_Science/10_Capstone_project/CP_Natural_Language"

Resources