Thursday, January 01, 2009

RWinEdt and Windows Vista/Window 7

As a R user, I like to use RWinEdt as the text editor. I write code on it and send code to R by clicking buttons.

I had a spare laptop from Jennifer. It does not have a working screen. I use that to test all kinds of software and OS systems. Recently, I gave up trying to use Fedora (Linux OS). Simply because I do not have enough knowledge to fix it when it crashed. I installed a beta version of Window 7 to see how "wonderful" it is as many people have praised it on their blogs.

One most obvious change that Window 7 has is that it is more friendly to hardware and software. And a Pentium 4 2GHz, 512Ram machine can run it smoothly without lags. I become more and more believe that Window 7 could really be the next generation Window OS system. This is to say that Windows vista is another failed product like one of its predecessors--Window ME.

But there is one feature that Window 7 borrows from Window vista. It has more strict rule of executing or copying files into folders. Sometimes, you need to run the program as the administrator in order to have the full control. Let's go back to RWinEdt.

Install the RWinEdt package in Window vista or Window 7 requires some tricks. Here are the steps:

  1. Start up your R as the administrator (right click the R shortcut and you will see the option)
  2. install RWinEdt package in R Console (install.packages("RWinEdt"))
  3. type help(package="RWinEdt") to see the help file of RWinEdt. In the bottom of the help file, there is a dir path. Write down it or memorize it.
  4. type library(RWinEdt). You will see error messages and it will place a RWinEdt shortcut on the desktop. But the shortcut will not work properly.
  5. go to the aforementioned RWinEdt path and go under the folder "Plugin."
  6. Copy all files *.edt into .....\winedt\macros\R *
  7. Copy files R-*.bmp into .....\winedt\bitmaps\buttons *
  8. Copy files R_*.bmp into .....\winedt\bitmaps\images *
  9. Copy all other files into .....\winedt
  10. close R related windows and restart R again.
RWinEdt should work fine then!

10 comments:

RENU said...

哥哥~
請問一下該怎麼畫3D立體圖呢??
我有一個方程式要畫成立體的~
不曉得R有什麼指令~
找好久找不到...
謝謝

Yu-Sung Su said...

Try scatterplot3d() in "scatterplot3d" package.

Here is the manual:
http://cran.r-project.org/web/packages/scatterplot3d/vignettes/s3d.pdf

Unknown said...

Regarding Windows vista, I recall it was mentioned somewhere that vista is the fastest selling OS from Microsoft. Also vista runs just fine on modern hardware (if not too old) and it is as fast as xp for daily use. (some independent research shows only 5% slower than xp)

I haven't tested 7 yet but from other sources it seems 7 is actually "well tuned" vista. Calling vista a "failed" product would be like calling win 2000 a failed product.

As for the "more strict rule of executing or copying files into folders" feature I think it only applies on certain folders such as "c:\program files" folder. You can install R (or other software) to another folder (e.g. c:\programs) to avoid error (if the software is not smart enough to handle this in vista/7). Actually it is the same case for xp, i.e. if you run under non-administrative account you will find you cannot modify the "c:\program files" folder.

Anonymous said...

Thanks - a nice alternative to learning tinn-R or dealing with the R editor.

Jun-deh said...

Hello, This is Jun-deh Wu from University of North Texas. I also have problems running RWinEdt on Vista. I have followed your steps. But in the step "Copy all files *.edt into .....\winedt\macros\R *", what exactly is the destination folder? Under "Macro", I have "Recorder", "References", and "RegEx", but I don't have a folder called "R". Therefore, I copy all the *.edt files to all three "R*" folders mentioned above. Then, I finished all your steps and ran R. RWinEdt pops up. I tried to send my codes to R, and then a dialogue box showed up and said that "can't open marco file "C:\Program Files (x86).....\Macros/R\R-Source.edt""

Well, as I said, I don't have a "R" folder under "Macros". I am confused about it. How should I solve this problem?

Thank you very much

Jun-deh

Yu-Sung Su said...

To Jun-deh,

You have to create an /R folder under the /Macro folder.

Jun-deh said...

Hello Yu-Sung,

I created a R folder under Macro, and do the steps again. Now RWinEdt can run. Thanks a lot. However, there is still a minor problem that the tag in RWinEdt doesn't work. Normally, the color of the tag is white and it shows the file name. The color of my tag is the same as the background (gray) and it shows nothing. Any suggestion to fix this problem?

Thank you very much

Jun-deh

Yu-Sung Su said...

Hi Jun-deh,

Right click the tag. And uncheck the "Custom Color". You will be able to see the file name.

Jun-deh said...

Hello Yu-Sung,

Yes, it works. Thank you very much.

Jun-deh

bshor said...

These steps used to work with WinEdt 5; but not with WinEdt 6 and R12