[R] editor argument in edit()
Tito de Morais Luis
Luis.Tito-de-Morais at ird.sn
Wed Nov 5 17:19:07 CET 2003
Hi dear listers,
In R 1.7 under linux, if I try to edit a vector, it can be edit using
any editor:
z<- c(1,2,3,4)
edit(z) #opens vi
edit(z, editor="gnumeric") #opens "z" in gnumeric
edit(z, editor="gedit") #opens "z" in gedit
It is similar in Windows98 (R 1.8) :
edit(z) #opens z in notepad
edit(z, editor="C:\\Program Files\\Microsoft Office\\Office\\Excel.exe")
#opens z in excel
The behaviour is similar, yet in gnumeric the values are in separated
cells whereas in excel all z (in fact c(1,2,3,4)) is in one cell.
But if I want to edit the results of a calculation:
data(USArrests)
prres <- prcomp(USArrests, scale = TRUE)
edit(prres$rotation, editor='gnumeric') #in linux it opens the R-editor,
not gnumeric
the same in windows:
edit(prres$rotation, editor="C:\\Program Files\\Microsoft
Office\\Office\\Excel.exe") #in windows runs the R editor, not excel
My questions are:
a) Is it possible to edit the result of a calculation (like
prres$rotation above) using an external spreadsheet program and not the
R-editor ?
b) If (a) is possible how can the data be edited in excel with one
single value per cell ?
c) If (a) is not possible, can the r-editor window be printed directly ?
Thank you for any help.
L. Tito
PS : I know that I can save results with write.table() and then open the
external file with any program. I just want to know if it is possible to
edit the results directly.
--
L. Tito de Morais
UR RAP
IRD de Dakar
BP 1386
Dakar
Sénégal
Tél.: + 221 849 33 31
Fax: +221 832 16 75
Courriel: tito at ird.sn
More information about the R-help
mailing list