In addition to the .Rhistory file,
RStudio maintains a database of all commands which you have ever entered into the Console. You can browse and search this database using the History pane. (source)
This one appears to still be searchable even when .Rhistory has been deleted.
How can I empty it? Cleaning it up might be necessary after, for example, installing from a private repo using a password, when I know other users have access to the computer. For example, I was a bit anxious seeing this popping up, after entering pass into the search field... (ノ゚0゚)ノ~
Thanks to Phann's hint, I found:
Deleting history_database seems to do the job. An empty database file is automatically recreated when starting RStudio again (tested on MacOS and Linux). The folder where to find history_database depends on your os and is described for the more general case here.
MacOS and Linux
~/.rstudio-desktop
Windows Vista, 7 and 8
%localappdata%\RStudio-Desktop # (i.e. Phann's path, I guess)
Windows XP
%USERPROFILE%\Local Settings\Application Data\RStudio-Desktop
Linux RStudio-Server
~/.rstudio
On my Win7 system, I found the file history_database within C:/Users/../AppData/Local/RStudio-Desktop. It has a unix-like time stamp per line followed by a command.
I would guess that if you empty this file, the history is cleared. But I haven't tried the solution yet, so better make a copy of the file to be on the save side.
The file should be in a similar folder in Win10.
Related
I have recently started using R for uni. I want to save my code using either save as or ctrl+s. However, the saved file is empty more often than not. For some reason, the files save normally on a few occasions. However, they also became empty after saving changes to the script.
I couldn't find any solution for the problem, neither here nor anywhere else.
I am using RStudio installed via Anaconda on an Windows 10 x64 Notebook, if that helps.
Thanks a lot for the responses! I'd be glad to provide more details if needed!
This is what the saved files look like from File Explorer:
I just meet the exactly same problem. I solved it by checking and changing RStudio -> File -> "Save as Encoding" from "ISO-8859-1 (System default)" to "UTF-8", then the file was saved. I'm trying to recover my previous 0kb files...
i couldn't reproduce the error but i also don't like to use the anaconda environment.
if the problem is saving the text file than may i suggest to do just that and save the code in a regular .txt file?
if this is not an option you can try to find out what happens if you save the r studio code on a different drive (or usb/flash drive)
###########################################################
EDIT 14.07.2022
Interestingly enough, just today (14.07.2022) I had the same problem. After installing R 4.2.1 everything worked fine until I changed the encoding (from utf-8 to windows 1252), at which point all the files in my project were overwritten and are now empty. Changing back to an older version of R (4.1.3) allowed me to display/save/use all scripts again (from backups).
Using the answer provided by #Shidan it is possible to open the data in R-4.2.1 as well.
This problem does not seem to be connected to Anaconda but an encoding issue between Rstudio and any R distribution above (and including) 4.2.
While trying to figure out why my output images from my node applications are not functioning currently, I decided to try the GraphicsMagick GUI.
On a windows 7 pro 64x I open the gm gui, and opened one of the windows default images.
Then, without performing any operations on it, I just saved it under a different filename: "test.jpg"
Save prompts no errors.
Now, when I go to the saved file. I get no thumbnail for it:
When I try to open the file, I get the following error:
I tried googling this error to no avail.
Something is broken when I save my file in gm.
Note: This problem does no occur with ImageMagick.
I tried installing multiple versions and releases of GM. None work.
I am running a windows 7 pro x64 with 64gb ram, and dual cpu (have no idea is that's relevant).
Also, how can I check if this is a permissions issue? The user running this app has administrator permissions, but.. maybe something get's broken?
As you can see i'm completely at a loss.
I've got a problem with my web application. A query that completes in a few seconds in SQLite 3.7.4 on Windows takes a whole 6 minutes in SQLite 3.6.22 on Linux. On the very same database file. It contains a few WHERE NOT EXISTS parts so I can imagine something has been optimised there.
But the SQLite version is fixed on the Linux side, it's bound to the distribution so I cannot update it. When I tried a current Linux binary and uploaded it to the server, the shell just said the file would not exist. It was there, ls found it and it was mode 755 by my own user...
And I can't find that specific version for Windows as well to try it in the other direction. The SQLite download site only contains the very current version and nothing else. There's not even an archive of older releases...
Does anybody know where I can find older versions? Preferably as binary as I don't want to spent hours to get it compiled.
You can check out and compile older releases from the Fossil repository.
Running RStudio in MAC (not server) and would like to know where to locate the Rprofile.site file in my working directory. Yes I have read ?Startup and I know exactly what I want to do with it (provided I find the file first) and yes I know where my getwd() is.
I have also gone through a bunch of posts in SO already which vaguely touch on/ answer this. Surely this will keep coming up so I will ask the question: Is there a literal file we can open and update with all the great start up code that has been shared and if so, where is it located in a MAC directory OR is there something more to it as I cannot locate this file.
1 answer I found mentions to create a text file then use terminal to copy visible contents of text file to invisible Rprofile? INVISIBLE??
Rprofile.site and .Rprofile are different files. Only files with a lead "." are treated as invisible by the Mac Finder. You didn't specify which OSX version you're using. If it's pre-Mountain Lion, you can IIRC use System Preferences to choose to display invisible files in Finder windows. Apparently it's more difficult in MountainLion. There are third-party tools like Onyx which allow you do set invisibility as well.
Given all that, I recommend you check the FAQ and forums at RStudio for specific info on where RStudio's installation expects to see these files.
Can R be run from a CD-ROM drive? The computer is a stand-alone (no network or Internet connection) and I can't install anything on it, nor can I use a flash drive.
Thanks.
What do you mean by "can't install"?
You don't need to install R, you can just run it from a folder copied from somewhere else. If you have hard disk storage on the PC then you can copy C:\Program Files\R from one machine onto a CD-ROM, then take the CD-ROM to the cripplebox, copy it to wherever you store your files and run it from there. Worst case scenario is you have to change the R_HOME environment variable. Works for Linux and Windows (you didnt say what OS you are on).
...unless your sysadmins have disabled executable permissions for your hard disk storage. Which is a real BOFH thing to do.
...but if they've done that I'd also suspect they've disabled executables from CD-ROM too.
...and if you don't have any writable hard disk storage, how the heck are you going to do any analysis?
...the real fix may be to kick the sysadmins until you tell them you can't do your job without R installed on the machine.
You may have trouble with packages, but otherwise, the instructions for installing R on a USB key should be pertinent.