Home

R–WinEdt

image

Contents

1. execute the main interface End The second example shows a macro that saves the current file and source s it into R CMD Save save the current file GetChildName 9 save the path filename into buffer1 DosToUnix 9 8 translate to in buffer1 copy a newline in buffer2 ReplaceInString 1 gt 0 1 1 9 copy source buffer1 buffer2 into the clipboard CopyToClipboard source 4 8 9 0 LetReg 9 clean up buffers 1 and 2 LetReg 8 Exe b send2R edt execute the main interface End For details on WinEdt s macro language I refer to its manual and the two ver sions of The WinEdt Hacker s Guide by Alexander and Marquardt 1998 and Alexander 1999 DSC 2003 Working Papers 6 Syntax Highlighting v vyX tL see AB e ow Fiter Sets Switches Reserved Words Columns gt Reserved Words Filters Font R compare Before Alpha z IV Default Font I After Alpha 7 T Italic R for if else while M Bold ees I Undertine I Enabled T Stikeout F Priority 0 9 6 Coto I Default Color Jv Default Backaround V Case Sensitive Sme Gay JReservea Word Figure 3 R WinEdt configuring the highlighting scheme A complete list of all available macros is given below The template macros insert templates into the current document of WinEdt One c
2. DSC 2003 Working Papers Draft Versions http www ci tuwien ac at Conferences DSC 2003 R WinEdt Uwe Ligges Abstract In the first part of this paper the status quo of R WinEdt a plug in for the shareware editor WinEdt for Windows is described This description includes the interface between R and WinEdt convenient editing features like syntax highlighting and the installation procedure The second part is aimed at the future of R WinEdt Is it desirable to improve the plug in Possible improvements related to the interface installation procedure and integration of Sweave functionality are discussed 1 Introduction R WinEdt is a plug in for WinEdt a shareware editor for the operating system Windows It provides an interface to R Ihaka and Gentleman 1996 a statisti cal programming language and environment Additionally a highlighting scheme which illuminates the syntactical structure of the R code replaces WinEdt s de faults Shortcuts menus and toolbar buttons are included to provide easy access to common operations for the user s convenience The existing functionality will be presented in Section 3 just after some comments why WinEdt is the editor of my choice in Section 2 Section 4 is aimed at the future of R WinEdt Its interface to R will be dis cussed as well as possible changes and improvements I received quite a lot ques tions related to the installation procedure of R WinE
3. Neuwirth E and Baier T 2001 Embedding R in Standard Software and the other way round In Hornik and Leisch 2001 Rossini A 2001 Literate Statistical Analysis In Hornik and Leisch 2001 Rossini A Machler M Hornik K Heiberger R M and Sparapani R 2001 Emacs Speaks Statistics A universal Interface for Statistical Analysis Technical Report 164 Department of Biostatistics University of Washington URL http software biostat washington edu statsoft ess ess techrep pdf Stallmann R M 1999 The Emacs Editor Boston URL http www gnu org Version 20 7 Venables W N Smith D M and the R Development Core Team 2003 An Introduction to R Version 1 7 0 R Project URL http CRAN R project org manuals html ISBN 3 901167 55 2
4. R e g from history or just evaluate the current line Open and update Rhistory so you can reuse your last commands Templates e g for _ in _ _ Faster starting than with standard configuration of WinEdt Features of WinEdt e g Delimiter Check advanced searching bookmarks macros Independent of another WinEdt running with LaTeX configuration Works now with RGui running in MDI or SDI style and also with S PLUS not supported Archive R WinEdt zip contains install bat simple installation script R ini modified WinEdt initialization file R img R btn modified WinEdt GUI files R bmp Buttons for R WinEdt s GUI R edt WinEdt macros for R interactions Installation Install R rwi020 or later Install WinEdt 5 V 5 2 Build 20001213 or later Note WinEdt is Shareware http www winedt com Unzip the archive into directory winedt plugins r winedt e g c program files winedt team winedt plugins r winedt The directory does not exist probably you have to create it manually DSC 2003 Working Papers 11 In your Windows Explorer double click on install bat If you are running RGui in multiple windows style MDI the default mode should be unchanged For RGui in single window style SDI or if you want to use R WinEdt with S PLUS you can change the R WinEdt mode permanently using the Menu e g R gt Set R sdi mode To invoke
5. following way to edit function is possible but not recommended options editor c program files winedt team winedt winedt c R WinEdt edit e r ini V my legend lt legend fix my legend DSC 2003 Working Papers 12 Known bugs If RGui is minimized it is impossible to send commands from WinEdt to RGui Workaround Don t minimize RGui Works in S PLUS mode only if the command window is opened as windowi Doesn t work with all versions of S PLUS tested with version 4 5 References Alexander J 1999 The WinEdt Hacker s Guide URL http www WinEdt org Alexander J and Marquardt C 1998 The WinEdt Hacker s Guide URL http www WinEdt com Hornik K 2003 The R FAQ Version 1 7 0 R Project URL http CRAN R project org manuals html ISBN 3 901167 51 X Hornik K and Leisch F eds 2001 Proceedings of the 2nd International Workshop on Distributed Statistical Computing March 15 17 Vienna Tech nische Universitat Wien ISSN 1609 395X URL http www ci tuwien ac at Conferences DSC 2001 Proceedings Ihaka R and Gentleman R 1996 R A Language for Data Analysis and Graph ics Journal of Computational and Graphical Statistics 5 3 299 314 Leisch F 2002 Sweave User Manual Institut fiir Statistik und Wahrschein lichkeitstheorie Technische Universit t Wien Vienna Austria URL http www ci tuwien ac at leisch Sweave R Version 1 6 0
6. functions Internal and C e Matrix operators 4 h h h h hinh hoh hXh e Contents within quotes and double quotes e Extraction of list and slot elements e Parenthesis brackets and braces O O e A list of known R functions currently those implemented in all shipped and recommended packages e Content within brackets in library content require content 3 3 Auto Completion A Command Completion Wizard by Holger Danielsson for WinEdt is available at http www WinEdt org Plugins complete php The wizard is quite easy to use but not yet integrated into R WinEdt mainly because I do not know anything about its licensing 4 The Future Aiming at the future of R WinEdt Is it desirable to improve the plug in From my point of view it should be redesigned in order to get Sweave support Section 4 2 and to allow a convenient installation procedure Section 4 3 For the computer scientist s point of view the interface needs to be redesigned as well but not for me being mainly an user 8 dani fbg schwerte de he seems to be disappeared DSC 2003 Working Papers 8 4 1 Interface In Section 3 1 the awkward recent interface which works surprisingly stable ex cept for the RGui is minimized bug has been described Three ways of improved interfaces can be considered e Convincing WinEdt s author to integrate DCOM support e Writing a DDE interface for R e Using socket connec
7. the menu again 8pcom Distributed Component Object Model TDDE Dynamic Data Exchange basic technology of Microsoft s OLE Object Linking and Em bedding DSC 2003 Working Papers 5 8 Press E to open the Edit menu and 9 press P to Paste the contents of the clipboard into the R Console window This macro code is written for working with RGui running in mdi mode a version working with RGui s sdi mode is somewhat simpler SetFocus R Console Wait 150 PostMessage R Console 0104 12 20000001 Wait 150 PostMessage R Console 0105 12 20000001 PostMessage R Console 0102 69 1 PostMessage R Console 0102 80 1 Obviously the interface is an awkward one but it is extremely simple with just 11 7 lines of macro code There is one bug in this macro If RGui is minimized it is not possible to interact with it For a discussion whether it is desirable to improve the interface see Section 4 The question arises what kind of information can be pasted into the R session Two examples are given the first one shows a macro that pastes a selected region of R code from R WinEdt both shortcuts and icons can be set up to invoke macros CMD Copy copy selected text into a buffer ReplaceInString 1 gt 0 1 1 9 add a newline at the end CopyToClipboard 9 1 copy buffer into the clipboard LetReg 9 clear the buffer Exe b send2R edt
8. R WinEdt from startmenu or desktop create a shortcut to WinEdt as follows c program files winedt team winedt winedt C R WinEdt e r ini In R use something like for example in your Rprofile options editor c program files winedt team winedt winedt c R WinEdt edit e r ini V options pager c program files winedt team winedt winedt C R WinEdt e r ini V Used WinEdt parameters Remark There is a difference between c and C c name New instance of WinEdt called name will be started C name If an instance name of WinEdt is already running it will be used So you can run WinEdt as LaTeX and R editor at the same time e name Using name as initialization file V Running in virgin mode Examples HHHHH Recommended procedure Open WinEdt with something like c program files winedt team winedt winedt C R WinEdt e r ini i e ideally the shortcut you have already created Then create a new document and write an R function Click on the symbol R source or press ALT S You will be asked to specify a filename e g R prog1 R If RGui is running it will be focussed and source will be called HHEHH options pager c program files winedt team winedt winedt C R WinEdt e r ini V file show Rhistory Mark some lines click the R paste button or use Alt P as shortcut Marked lines will be executed in RGui HHEHH The
9. an jump from one missing entry marked with in the examples below to the other in order to fill in by pressing Ctrl Space For each of the marked items there are two macros One macro submits information to R and goes back to WinEdt at once e g in order to submit several discontinued regions of code whereas the other one is intended to change the focus permanently to R after submission Copy and paste a selected region of code Copy and paste the current line Save and source the whole file Save the R history in file Rhistory and open it in R WinEdt Insert function template function Insert loop template for Insert if template if e Insert ifelse template if else 3 2 Highlighting Setting up highlighting schemes is easy in WinEdt and corresponding rules are highly configurable cf Figure 3 The very complete R WinEdt highlighting scheme distinguishes between the following main groups of highlighting classes given in descending order DSC 2003 Working Papers 7 Comments and all stuff thereafter e Assignment operators lt lt lt gt and e Control structure keywords if else ifelse while for break repeat next e Logical operators lt gt lt gt amp amp amp Il e function library require e Special values NULL NA NaN Inf F T FALSE TRUE and the
10. ave full support of Sweave Leisch 2002 which provides convenient state of the art literate statistical analysis with R 2 Why WinEdt The recommended editor for writing R code is the Emacs Stallmann 1999 with its ESS interface Emacs Speaks Statistics Rossini et al 2001 In the R manuals there is a remark on ESS in Venables et al 2003 and an entire Section devoted to R and Emacs can be found in Hornik 2003 In my experience many Windows users feel uncomfortablet with the Emacs This was indeed the initial occasion for writing R WinEdt WinEdt is a very powerful and flexible editor focused on IATRX and it is widely known among IATRX users under Windows see Figure 1 for a screenshot It is easy to define Task Bars Menus and quite sophisticated highlighting schemes in WinEdt The editor also provides an extended Macro language that includes e g capabilities for interaction with the operating system There are convenient ways to automate tasks in WinEdt using this macro language the Linux user typically 4 At the time of writing this article John Fox is working on some Windows like features for ESS For details see http www socsci mcmaster ca jfox Books Companion ESS DSC 2003 Working Papers 3 R wink dt D uwe R Mibrary devel scatterplot3d R scatterplot3d R File Edit Format Search Insert Tools Options Window Help i s RO R history update Alt H Del 6 o n RE Re Re MA Arbistoy updat
11. ccess to its sources So it is necessary to convince WinEdt s author Aleksander Simonic in order to get desirable new features into the editor 3 Status Quo The most easiest way to get to know the current state of R WinEdt is to try it out and play around Nevertheless in this Section R WinEdt s status quo and some corresponding technicalities will be described See Figure 2 for a screenshot of R WinEdt in action The recent version 1 4 1 at the time of writing of R WinEdt works with WinEdt 5 2 and later on any 32 bit version of Windows and requires R 1 2 0 or later Of course any version numbers are subject to change For installation instructions examples and known bugs see R WinEdt s edited ReadMe txt file in the Appendix 5alex winedt com DSC 2003 Working Papers 3 1 Interface Interface is a Section title which implies more than what has been implemented On the one hand unfortunately WinEdt does not support DCOM but uses DDE instead I was not able to convince WinEdt s author to implement DCOM support in WinEdt On the other hand there is a DCOM server Neuwirth and Baier 2001 for R available but no DDE interface What I did instead is making use of some features of WinEdt s macro language in the following manner When any information has to be send to R it is constructed by the macro language Then it is copied to the Windows clipboard and pasted into the R Console window of RGui using t
12. dt therefore I would like to improve it and discuss some possible solutions Further on it will be discussed SFB475 Fachbereich Statistik Universitat Dortmund Germany ligges statistik uni dortmund de lhttp CRAN R Project org contrib extra winedt 2http www WinEdt com 3 Windows is a trademark of the Microsoft Corporation DSC 2003 Working Papers 2 WinEdt D uwe T agungen DSC 2003 Paper RwinE dt tex File Edit Search Project Insert Tools Macros Accessories Options Window Help l x a0ESH eo YVA ADEE B mM 2 Shs Ba R HAT R TEX boy BK J we y literate statistical analysis with R section Why WinEdt label sec why The recommended editor for writing R code is the Emacs citep ste with its ESS interface citep emph Emacs Speaks Statistics irc In the R manuals there is a remark on ESS in cite r introi70 and an entire Section devoted to R and Emacs can be found in cit In my experience many textsf Windows users feel uncomfortable witk This was indeed the initial occasion for writing RU At the time of writing this article John Fox is working on some Windows like features for ESS for details see url http www socsci mcemaster ca jfox Books Compar vv Oe a ee mansi ia J m malian en fm annam almen hom Tm 4 RI sat me Wep Indent INS UNE Spel T M034 Figure 1 WinEdt in its regular BTEX mode whether it is desirable to h
13. e PASTE Feline and go AlteL scatterplot3d R erp Rhistory Reline Ctrl Alt L yz f lt scale y abs if angle lt 1 angle iRe Aigaste and ac lee yx f lt scale y if angle lt 2 1 angle Re Apa Ciril if angle gt 2 switch y and x axis to Re aE AlteS temp lt xyz x xyzSx lt xyzSy xyzSy lt i ChrledlteS temp lt xlab xlab lt ylab ylab lt R R script temp lt xlim xlim lt ylim ylim lt gt function Ctrl Alt F gt for CtrlAlt O angle 1 lt ifelse 2 gt angle amp amp angle gt 1 gt if CtrlsAlt angle 2 lt ifelse 1 gt angle angle gt 3 iese ChrleAlteK dat lt chind as data frame xyz c x ee Ctrl xlim ylim zlim select the points i Set R mdi mode default if is null xlim Set P e mode xlim lt range xlim Set S Plus mode bugs dat lt dat xlim 1 lt datSx amp dat x lt if is null ylim ylim lt range ylim dat lt dat ylim 1 lt datSy amp datSy lt ylim 2 drop FALSE MI gt 4 Ril iE wrap Indent INS LINE Spel R Mo 3Mr2 200 7 Figure 2 WinEdt running with the R WinEdt plug in uses a Makefile instead For details I refer to the WinEdt manuals Because of all these features it was easy to implement the simple plug in in its current version Unfortunately WinEdt is a commercial affordable shareware editor hence I have no a
14. he following macro which implements the awkward main part of the interface SetFocus RGui PostMessage RGui Wait 150 PostMessage RGui PostMessage RGui PostMessage RGui Wait 150 PostMessage RGui PostMessage RGui PostMessage RGui PostMessage RGui 0104 0105 0102 0102 0104 0105 0102 0102 12 20000001 12 20000001 87 1 49 1 12 20000001 12 20000001 69 1 80 1 set focus to R press ALT RGui needs some time release ALT Char W gt Win Menu Char 1 gt Window1 R Console RGui needs some time press ALT release ALT Char E gt Edit Menu Char P gt Paste So this main part can be described as follows After the focus of programs is switched from WinEdt to R and both applications have been started of course key presses are simulated in a manner like one would use the menu without any mouse 1 Press Alt 2 RGui and Windows needs some time to open the menu time depends of the operating system it takes most time on Windows XP 3 Release Alt 4 Press W opens the menu called Windows 5 Press 1 selects window 1 which is identical to the R Console now we are sure to have focussed the R Console instead of e g an R Graphics window 6 Again some time is needed to switch to the R Console window 7 Press and release Alt to open
15. procedure of R WinEdt which indeed is uncommon in a way because there is just a simple file install bat that has to be invoked in the exactly correct directory Handling this installation procedure seems to be too complicated for some users Therefore I would like to improve it and discuss possible solutions obvious ways are e The R way Installation as by an R package e The WinEdt way A redesigned plug in might be installed by WinEdt macros Sweave combines typesetting with IATRX and statistical data analysis with R into integrated statistical documents DSC 2003 Working Papers 9 e The Windows way A Setup Wizard like Inno Setup which is also used for the binary version of R e Any combination of the above mentioned strategies My current preference is a combination of the first two ways The plug in would be shipped in form of an R package A customizable installation procedure maybe using some simple R integrated GuI elements like a setup wizard would have the power to e locate the WinEdt installation e adjust the R environment e g Rprofile e create shortcuts on the desktop and in the start menu e add or modify some settings of the Windows registry and e start WinEdt to execute installation macros probably modified in the first step by R for the plug in s integration into WinEdt Duncan Temple Lang s SWinRegistry package of The Omega Project for Statis tical Compu
16. ting 1 will be helpful to perform required tasks related to the Windows registry 5 Conclusion The recent version of R WinEdt provides the Windows way of editing R code convenient flexible and powerful but it is not quite as powerful as ESS for the Emacs I think it desirable to improve the plug in in two main topics It should be redesigned in order to implement Sweave support and to allow a convenient installation procedure whereas the implementation of a better interface is of less priority I would like to invite the reader to submit contributions and other suggestions to any of these topics Appendix Readme txt Using WinEdt as an editor for R R WinEdt 1 4 1 12 01 2003 Overview Using WinEdt as an editor for R only Rgui under Windows l0nttp www jrsoftware org http www Omegahat org DSC 2003 Working Papers 10 Features Syntax Highlighting and highlighted printing function index of all recommended packages including base boot class cluster ctest eda foreign grid KernSmooth lattice lqs MASS methods mgcv modreg mva nlme nls nnet rpart spatial splines stepfun survival tcltk tools ts last update 13 09 2002 R 1 6 0 beta Many R functions at the same time in the same editor Buttons Shortcuts for simple access one click to Save document and source into R Submit script to R WinEdt as scripting window Paste selected code from WinEdt directly to
17. tions For me the current interface works stable enough so I will not make much effort Benefits of possible improvements have to be compared to all the work that is required to implement these improvements Nevertheless contributions will be highly appreciated 4 2 Sweave Since WinEdt is focused on ATEX it seems to be natural to combine this ATEX func tionality with the capabilities of the R WinEdt plug in Literate statistical analysis for a discussion related to ESS see Rossini 2001 with R would benefit from com bining those capabilities More specifically full support of Sweave by Leisch 2002 is desirable for convenient state of the art literate statistical analysis with R R WinEdt was initially written on a Pentium I machine 133MHz 64MB RAM Windows NT 4 0 where speed and memory efficiency was still an issue Unfor tunately it was not possible to combine both R and IATRX functionality without getting a big penalty in WinEdt s starting times and memory consumption Today that is no longer a problem to worry about so a redesigned plug in could easily provide a combined interface The only issue to think about is the configuration of an adequate highlighting scheme for combined documents such as Sweave files Thus highlighting must be sensitive to code chunks in a way And of course an installation should not corrupt users adaptions 4 3 Installation I received quite a lot questions related to the installation

Download Pdf Manuals

image

Related Search

R roblox restaurants near me reddit ralphs ringcentral rate my professor revolve rakuten resume rumble royal caribbean international rufus roblox download rockauto restart computer restart realtor robinhood remove programs roku royal caribbean roblox studio real clear politics roblox login relias learning login

Related Contents

Elta 2309 User's Manual  CM/CS SERIES - Sound Services  2N® SmartGate - Diawest.net.ua  do Manual    E-Touch Integrated user manual - E  Creda 48444 User's Manual  Samsung ME83DST Hướng dẫn sử dụng  InLine TAE-F 0.5m  

Copyright © All rights reserved.
Failed to retrieve file