R commands (class, object.size) hang - r

I have run into a strange and impossible to reproduce outside of the context of my code problem. When in browser mode, certain basic R commands just hang. For instance, class() and object.size() never return, running on objects that should be 1-2 MB in size. I'm running R 3.6.3 on ubuntu 18.04 from the command line. Any thoughts on what this might mean? The code does NOT hang when not run in the browser mode.

Related

Problems With Interactive Viewers Running R in VSCode

I am getting started with running R scripts in VSCode. Things are generally running fine, except for unexpected results with some of the viewers. I'm running Mac OS Mojave 10.14.6.
First, any table / list I try to view (using the View() command) generates this error:
Error in check_for_XQuartz(file.path(R.home("modules"), "R_de.so")) :
X11 library is missing: install XQuartz from www.xquartz.org
So I went ahead and installed XQuartz. Viewing dataframes then worked, but it spawned a separate window, rather than a VSCode tab, that was very primitive: slow to render, without any interactivity (no sorting of columns or searching, etc. of the type shown at https://github.com/REditorSupport/vscode-R/wiki/Interactive-viewers).
Second, I'm having similar problems with rendering plots. Plotting works, but it spawns a separate window, titled "Quartz 2 (*)", rather rendering in VSCode.
I have installed httpgd, and enabled r.plot.useHttpgd in VSCode settings.
Any advice, anyone? Big thanks in advance.

Julia exits when running code with MATLAB.jl

When trying to execute any commands from MATLAB.jl in julia, the matlab command window opens, and Julia immediately exits with no errors, warnings, or messages. Has anyone else encountered this before? I'm working on translating some MATLAB code to julia and using MATLAB.jl to check that the sparse matrices are the same for both pieces of code.
I'm on a Windows computer and have tried following the instructions on the MATLAB.jl github repo. I've also tried adding Matlab to path and executing the code from the Julia REPL, but keep encountering the same problem.
I can get mxarray executes, however, trying it seems like anything which requires a matlab session causes julia to quit, e.g. mxcall, md"", and MSession.
Was able to solve the problem by opening julia through the command prompt as an administrator and running ] build MATLAB and ] test MATLAB. If the terminal was not opened as administrator, it would build, however, during the testing it would return exit error: 3765269347, which seems to be a windows-specific internal process error.
After this has been done, MATLAB.jl seems to work even when it is not opened directly with admin rights.

R package: Error appears not in Windows but in Linux

guys.
I am currently trying to build an R package (using rcpp). By this suggestion, I encountered an error, which was fixed by putting the following line in src/Makevar and/or src/Makevar.win.
PKG_CXXFLAGS = -DRCPP_ARMADILLO_FIX_Field
However, this error disappeared when I run my function in Windows on my laptop, but it again appeared in Linux. (I usually wirte the code in Windows on my laptop and run the code by using Linux for parallel computing provided by my university) It seems that that line can remove the flag in Windows but cannot remove it in Linux.
How can this happen, and how can I fix this?

R: Memory Allocation on Ubuntu for R vs Rscript

I have created a script, and when I run it line-by-line on Ubuntu, everything works from end-to-end, however, when I run it using Rscript it fails due to a memory allocation error.
I have tried to remove excess variables using rm followed by gc, and I have tried to run the code using R CMD BATCH, but nothing seems to work.
Does anyone know why memory allocation is different between running R and Rscript?
Sorry, I cannot really do a reproducible example for this problem due to the sensible data, but the packages I use are RJDBC with the setting options(java.parameters = "-Xmx8g") on a computer with 16 Gb of RAM, and I also use the parallel-package, which is where the error occurs.

Memory error when kniting in R

I try to knit an Rdata file in R studio and get an error that cannot allocate vector 1,8mb.
I understand that I have memory issue so I tried to use memory.limit() as suggested on another post but I got an error
memory.size() is Windows-specific.
I also made extra RAM using a usb and changing swappiness but nothing happened. I'm using Ubuntu 14.04 32bit, R Version 3.3.0 32bit and also I have Windows O/S installed.
The problem is that you're on a 32-bit installation of R and you've used up the (very small) amount of memory it can handle. If you just switch to 64-bit you won't get this error.
The error message is because you invoked a Windows-specific command on Ubuntu, but that's really not relevant because with 32-bit R there's a hard limit on memory which you've already hit.
I know this is confusing because it's complaining about a very small size vector (1.8 MB) but that just means that the remaining amount of memory 32-bit R can handle is less than that.
If you were on Windows you might need to set the memory limit in addition to using 64-bit R, but if you're using Ubuntu then just using 64-bit R should solve the problem.
RStudio Instructions
I'm basing this on my version of RStudio, yours might be slightly different but it should be very close.
Click Tools
Click Global Options...
With the "General" (default) screen selected click Change where it says "R version:"
Select Use your machine's default version of R64 (64-bit)
Click OK
Allow RStudio to restart

Resources