R emacs windows - windows

I'm a newbie, so bear with me. ive gone through instructions offered on Paul E. Johnson's site on using R and emacs on a windows platform. Ive downloaded both the 32 bit and 64 bit versions of R 3.0.3 and Professor Goulet’s Emacs-ESS compilation. however when running gnu emacs, no R icon appears on the button bar. Moreoever, Ive tried right-clicking on an R file and tried opening it with runemacs.exe but that doesnt work. Windows refuses to display runemacs.exe as an option. R run on its own works fine though. Both R and Gnu emacs are stored in program files (not in program filesx86) if that helps. Also in the R folder there subfolders for both R 3.0.3 as well as R 3.0.0. Please help!

Have you started ESS from Emacs?
M-x R
Also, what is the path where you've installed R? That could be the issue and you likely need to edit a configuration file in Emacs. For example, in the site-start.el file.
;; Path to R executable. Uncomment and edit as needed if R is
;; installed in such an unusual place that ESS can't find it. (And
;; then keep updating with each R update!)
;(setq-default inferior-R-program-name
; "c:/program files/r/r-2.7.1/bin/rterm.exe")
So you probably want to uncomment this and:
(setq-default inferior-R-program-name
"c:/path/to/where/you/installed/r/r-3.0.3/bin/rterm.exe")
This is for the Goulet package and this configuration file is mentioned on the website.
EDITED: because I realized that I overlooked that you had used Goulet's package initially.

Related

RStudio Desktop: r is taking longer to start than usual

I have been running rstudio desktop for several months but recently I went to start it and it says "r is taking longer to start than usual" and the loading wheel just spins and spins but it never opens.trys to load but never opens I am running the latest versions of R and Rstudio as of this post. I am running windows 10 as my operating system.
I have tried deleting .Rdata, Rprofile.site, .Rprofile and .Renviron files. I have uninstalled and reinstalled both R and Rstudio to the default locations. I have tried clearing the global environment and the DNS cache. When I try to start R with an OS command it says "R is not recognized as an internal or external command, operable program or batch file." Yet if I use the short cut I am able to open base R.
Any suggestions on how to resolve this issue would be much appreciated I have been trying to fix this for days but have found nothing but dead ends. Please let me know if there is more data I can provide that would be useful in resolving this issue.
Thank you.
I am answering this for posterity, the OP of this question reported being able to resolve their issue in another forum. Their solution was:
I had to uninstall R and Rstudio
Launch "run" enter %localappdata% and delete all files pertaining to R or Rstudio
Launch "run" enter %appdata% go to roaming and delete the Rstudio files there
Got to where I had my R packages installed and delete those
Then I had to reinstall R and RStudio
I ran into this same strange error and I was able to resolve it without touching R or my packages:
Uninstall RStudio
Launch "run" enter %localappdata% and delete all files pertaining to Rstudio
Launch "run" enter %appdata% go to roaming and delete the Rstudio files there
Reinstall RStudio
Try to remove remove all config files like .Rprofile, .Renviron, and .Rdata from your working directory, this worked for my case.
More details

change Rstudio R version from outside Rstudio

I changed Rstudio's R version to a non-default one from Tools-options. Now when I reopen Rstudio, it fails to start. Just a blank window with Rstudio title. Uninstall and reinstall didn't help.
Is there a way to change Rstudio's R version from outside Rstudio, say a config file?
OK, found the config in the file
AppData\Roaming\RStudio\desktop.ini

Getting Edwin to open Scheme file correctly with C-x C-f

I am learning SICP. I'm using Edwin 3.116 that installed with MIT-Scheme on my Windows 7 (32-bit) / AMD (64-bit) machine.
For the life of me I have not been able to discover why Edwin is unable to open and read a file correctly:
When I open an existing .scm file (with my code in it) Edwin just opens a blank buffer with my file name.
If I then save it, my code gets over-written with blankness. So clearly Edwin is not at pains to write.
Apart from not being able to find any answers, I have had no success with the following:
C-x C-f followed by full path D:\my-schemes\filename.scm (while the default directory was at C:.....)
M-x cd followed by d:\my-schemes followed by C-x C-f filename.scm
Quit, restart MIT-Scheme and re-try above commands
Uninstall-reinstall MIT-Scheme and re-try above commands
Is there something I have not done - like specify some parameter in some configuration file? (The Installation guide does not require any special config. for Windows, other than to follow the installer.)
I'm getting by with copy-pasting code from file-to-buffer and writing from buffer-to-file for now, but my scheming could be so much better if I could get Edwin to read too.
just in case you might not yet found a solution. I encountered the same problem and just found one that worked for me so I'm thinking sharing my solution.
If you installed with the default setting, everything is installed in 'Program Files/...'. The problem with this seems to be that the directory name contains space. When I tried saving in other directory without space, and I could write to a file. I can open the file with a normal text editor, but when I open with Edwin all I saw was a blank page. I tried installing an older version (MIT GNU scheme 9.0) and it worked as mentioned in this bug report: http://savannah.gnu.org/bugs/?35250
vutha's suggestion of installing in a directory without spaces didn't work for me because I needed to access files inside a folder with spaces in the name. But it pointed me in the right direction. There is a bug in versions 9.1 and 9.2 that completely brakes Edwin in Windows.
The only thing that worked was to uninstall the latest version (there is a uninst.exe file in the installation folder) and then install version 9.0.

Set up Vim to work with R and Sweave in Windows

I have installed vim in windows and would like to configure it so i can send code to R. I want to also use Sweave with it. However, i have Googled and failed to find clear step-by-step instructions on how to set this up.
my attempts so far:
installed Vim using executable from ftp://ftp.vim.org/pub/vim/pc/gvim73_46.exe
downloaded R-plugin from https://github.com/jcfaria/Vim-R-plugin/zipball/master and extracted it to a folder on my pc. following instructions in the r-plugin.txt file, i installed python-3.2.msi and pywin32-216.1.win32-py3.2exe. I extracted the plugin zip-file to C:\Program Files (x86)\Vim\vimfiles\ merging like-named folders together. then i opened Vim and typed :helptags C:\Program Files (x86)\Vim\vimfiles\doc. I closed Vim then I started R and reopened Vim. I typed :new anewfile.R and got the error message
"Python interface must be enabled to run Vim-R-Plugin. Please do ':h r-plugin-installation details
and when i type this i get
error149, no help for r-plugin-installation
I also did not see the buttons that send code to R.
I failed to understand the instruction that , "You may have to
adjust the value of |vimrplugin_sleeptime|."
What should i do?
-I already have Miktex 2.9 on my PC. will Vim see it? How do I set up Vim to see Latex?
Will appreciate any help.
Note: I have used rstudio with Sweave and also eclipse but there are some issues i need to resolve and hence need to try vim and see how it will work out.
I suppose that this solution will not satisfying you completely but Rstudio IDE features a basic VIm editing mode: Global Option > Code Editing > Enable vim editing mode.
I think the windows binaries of Vim 7.3 need Python 2.7 or 3.1. You can check the information that you get via :version; the linked Python version is somewhere in it.
So my solution would be installing Python 2.7 (+pywin32 for python 2.7). Also, check if Python is working in Vim before trying to use the R plugin.

Emacs in Windows

How do you run Emacs in Windows?
What is the best flavor of Emacs to use in Windows, and where can I download it? And where is the .emacs file located?
I use EmacsW32, it works great. EDIT: I now use regular GNU Emacs 24, see below.
See its EmacsWiki page for details.
To me, the biggest advantage is that:
it has a version of emacsclient that starts the Emacs server if no server is running (open all your files in the same Emacs window)
it includes several useful packages such as Nxml
it has a Windows installer or you can build it from sources
And concerning XEmacs, according to this post by Steve Yegge:
To summarize, I've argued that XEmacs has a much lower market share, poorer performance, more bugs, much lower stability, and at this point probably fewer features than GNU Emacs. When you add it all up, it's the weaker candidate by a large margin.
EDIT: I now use regular GNU Emacs 24. It also contains Nxml, can be installed or built from sources, and with this wrapper, the Emacs server starts if no server is running. Cheers!
Note that GNU Emacs for Windows comes with two executables to start Emacs: "emacs.exe" and "runemacs.exe". The former keeps a DOS-Prompt window in the background, while the latter does not, so when if you choose that distribution and want to create a shortcut, be sure to launch "runemacs.exe".
Carl
Easiest way to find where the user init file is:
C-h v user-init-file
Easiest way to open it is (in the scratch buffer):
(find-file user-init-file)
and hit C-j to eval
Well, I personally really like what I have been using since I started with Emacs, which is GNU Emacs. It looks like it is built for windows too. That link also answers your .emacs file question. Here is a place you can download it. You should probably get version 22.2 (the latest).
If this is your first time, I hope you enjoy it! I know I absolutely love emacs!
I run it under cygwin. That also gives me a Unix-ish environment for shelling out commands with meta-!
I use a vanilla version of emacs. In my experience, this is very stable, simple, does everything I need, and doesn't add a bunch of bloat that I don't need. The .emacs file can be placed in C:\Users\YourName if the HOME environment variable is set. This is a great way to handle it because it works on a user basis and mimics emacs behavior on Linux. You can download the zip from any gnu software repository mirror in the emacs/windows folder. You want the file that is named emacs-xx.x-bin-i686-pc-mingw32.zip.
There are some great instructions for configuring emacs for windows here. Basically, "installation" boils down to:
Download emacs from a gnu mirror at emacs/windows/emacs-version-bin-i686-pc-mingw32.zip, and extract the zip to an appropriate folder. Preferably C:\emacs to avoid spaces in the filename.
Set the HOME environment variable to C:\Users\username (or whatever you want). Make it a user-only variable (if it is username-specific). This is where your .emacs file goes.
If you want a start menu or desktop shortcut, create a shortcut to bin/runemacs.exe.
Add c:\emacs\emacs-xx.x\bin\ to your path (user or system), so that you can run it from the command line.
Also, you can consider emacs-w64 for 64bit windows systems:
emacs-w64: http://sourceforge.net/projects/emacsbinw64/
See http://www.gnu.org/software/emacs/windows/ntemacs.html. Section 2.1 describes where to get it, and section 3.5 describes where the .emacs file goes (by default, in your home directory, as specified by the HOME environment variable).
I've run both GNU emacs and Xemacs on windows. I used to use it as my primary editor, email client etc, but not it's "just" an editor.
When I recently reinstalled to Vista I installed the latest GNU version. It works fine. So does Xemacs, but it does look like GNU have got their sh*t together so Xemacs isn't as compelling anymore.
I suggest you to use development version of GNU Emacs 23, which is pretty stable and to be released relatively soon. You can get weekly binary builds from the link below.
Latest GNU Emacs as a zip archive
I have a portable version with .emacs configure ready, which setup org mode, I-do, etc. It also included org sample file. I think that is a better start point for new comers.
Basically run with runemacs.bat and everything is ready.
http://nd.edu/~gsong/portable_emacs.html
I've encountered this problem, and discovered the fault (at least in my case) to be the existence of c:\site-lisp\site-start.el, a file that was created when EmacsW32 was installed, and which was not removed when I uninstalled it. (Vanilla GNU Emacs for Windows has c:\site-lisp in its load-path, and will try to load this file, which somehow winds up triggering that error.)
Solution: removing that whole directory (c:\site-lisp) worked for me, but you should just be able to remove the site-start.el file.
The best place to start, to get an MS Windows binary for GNU Emacs is ... GNU Emacs:
http://www.gnu.org/software/emacs/
(Oh, and how did I find that URL? From the Emacs manual, node Distribution. If you have access to Emacs anywhere, that's the place to go for such information.)
On that page you will see everything you need to know about obtaining Emacs. In particular, you will find a section called Obtaining/Downloading GNU Emacs, which links to a nearby GNU mirror. Clicking that link takes you to a page of links that download all Emacs releases since release 21.
More imporantly here, on that page of links you will also see a directory link named windows. Click that to get a page of links to Emacs binaries (executables) for MS Windows. That is the page you want.
Knowing the above information can help when you need to find the page again, if you haven't bookmarked it. But here is the final URL, directly: http://mirror.anl.gov/pub/gnu/emacs/windows/
When forced to use Windows, I ...
Download "Emacs for windows", and save it in some directory (henceforth referred to as EMACS_SOMEWHERE)
Drop a .cmd file in "Startup" to map, "My Documents" to H: drive with subst, or if "My Documents" resides on a remote server, I use the "Map Network Drive" thing in Explorer to have "My Documents" named H:. Then I create an environment variable named HOME in Windows and give it the name of "H:\". Now I can drop my .emacs file in "My Documents" and it will be read by emacs when it launches.
Then I create the H:\bin directory. Then I add "H:\bin" to my Windows "Path" environment variable.
Then I create a H:\bin\emacs.cmd file. It contains one line:
#call drive:\EMACS_SOMEWHERE\emacs-23.2\bin\emacsclientw.exe --alternate-editor=c:\programs\emacs-23.2\bin\runemacs.exe -n -c %*
This is a fair bit of work, but it will enable me to run the one and same emacs from either a windows command prompt or from a cygwin command prompt, provided that /cygdrive/h/bin is added to my cygwin PATH variable. Haven't used this setup for a while but as I recall, when I call the emacs.cmd with a new file over and over, they all end up being buffers in the one and same emacs session.
There was https://bitbucket.org/Haroogan/emacs-for-windows with the latest Emacs 25, but the whole page has been removed.
The benefit of this build and the emacs-w64 above is that they come with jpg, png, tiff DLLs as well as lxml DLL, which is needed for the new eww web browser.
I prefer to run Windows 10 + VcXsrv + Emacs 25 client in WSL. Emacs is my shell.
To access the .emacs file for your profile the easiest way is to open up emacs. Then do C-x C-, type in ~USERNAME/.emacs (or you can use init.el or one of the other flavours). Type your stuff into the file and C-x C-s (I think) to save it.
The actual file is located (in Windows XP) in c:\Documents and Settings\USERNAME.emacs.d(whatever you named the file), or the equivalent spelling/location on your system.
You can download GNU Emacs NT from here direct. It works fine in windows, make sure you create a shortcut to the runemacs.exe file rather than the emacs.exe file so it doesn't show a command prompt before opening!
XEmacs is less stable than GNU Emacs, and a lot of extensions are specifically written for GNU. I would recommend GNU > X.
You can place the .emacs file in the root of the drive it's installed on. Not sure whether you can add it elsewhere too...
Im using emacs32, I only have one problem with it really:
https://stackoverflow.com/questions/3625738/comint-previous-matching-input-in-emacsw32-is-not-interactive
If You Mean Emacs as Latex Editor for Windows 7.
Emacs4LS (Emacs 4 Latex Support under Windows 7) for newcomer for Emacs.
http://chunqishi.github.io/emacs4ls/
Easy Steps to Install.
Plugins Built-In.

Resources