Displaying 20 results from an estimated 6000 matches similar to: "Command-line editing & history"
2013 Feb 07
1
Saving history across sessions
I have an environment variable `$R_HISTFILE` pointing to
`/home/my.username/.RHistory` and the following code in my `.Rprofile` in
my home directory:
.Last <- function() {
if (!any(commandArgs()=='--no-readline') && interactive()){
require(utils)
try(savehistory(Sys.getenv("R_HISTFILE")))
}
}
2002 Oct 21
1
savehistory directories and quitting R (PR#2038)
Thanks-- as Duncan Murdoch also noted, R_HISTFILE can be used to solve my
problem, as below. BTW it's not easy to find out about R_HISTFILE in the
help system or manuals, though, unless you already know it exists-- it only
seems to be described under startup options, not things to do with history.
However, Duncan's reply did hint at an inconsistency, in that savehistory()
defaults to
2002 Sep 19
3
savehistory directories and quitting R (PR#2038)
#
# r-bugs@r-project.org
#
######################################################
Because I work in different directories, but always want to save my
.Rhistory in the same place, I have changed the system function savehistory
to this:
function (file = "D:/R50/.Rhistory")
invisible(.Internal(savehistory(file)))
When I use q() to quit R, and it asks me whether I want to
2006 Aug 10
3
Is there a better way than x[1:length(x)-1] ?
Hi WizaRds,
In MATLAB you can do
x=1:10
and then specify
x(2:end)
to get
2 3 4 5 6 7 8 9 10
or whatever (note that in MATLAB the parenthetic index notation is used, not brackets as in R). The point is that 'end' allows you to refer to the final index point of the array.
Obviously there isn't much gain in syntax when the variable name is x, but when it's something like
2005 Dec 06
3
reading in data with variable length
I have very large csv files (up to 1GB each of ASCII text). I'd like to be able to read them directly in to R. The problem I am having is with the variable length of the data in each record.
Here's a (simplified) example:
$ cat foo.csv
Name,Start Month,Data
Foo,10,-0.5615,2.3065,0.1589,-0.3649,1.5955
2009 Sep 05
1
Is 'history' recorded in Rscript?
Hi,
I run the following command and try to save the commands that have
been run in the script. But it seems that no history is recorded. Is
it because that the history is not recorded in Rscript?
Regards,
Peng
$ Rscript savehistory.R
> f=tempfile()
> f
[1] "/tmp/Rtmp7WBjGG/file327b23c6"
> history()
Error in savehistory(file) : no history available to save
Calls: history ->
2009 Apr 27
2
save history only option under Linux
Hi,
I have a question regarding the R command options under Linux
Is there any options that I can save history only?
The only save option is --save, which saves both data and history.
I don't want to save temporary data, because sometimes the it takes much
time if the temp data is too big.
However I want to restore the history for my next R session..
If there is no such option that meets my
2012 Oct 10
2
history() does not work?
Hi,
> history()
gives Error in savehistory(file) : no history available to save
although I can scroll throu history with C^uparrow an C^downarrow.
How can I make history() work and/or show the current history in a file,
so that I can choose from previous commands?
The web did not throw up anything useful.
TIA --Christian
--
Christian W. Hoffmann,
CH - 8915 Hausen am Albis,
2006 Aug 02
1
MATLAB 6.5 under Wine
Hi,
I'm completely new to Wine (I'm running version 0.9.9 under Ubuntu 6.06).
I have been able to install and run Windows apps and I can see that Wine really rocks! For speed, I'd rather run Wine than VMware, especially when it comes to running MATLAB under linux.
I'm having difficulty with getting MATLAB (6.5.0.180913a (R13)) to run. There are several threads in the Wine
2007 Jan 25
2
Days of the week?
Hi WizaRds,
What is the "standard" way to get the day of the week from a date such
as as.Date("2006-12-01")? It looks like fCalendar has some functions
but this requires a change in the R locale to GMT. Is there another way?
Thanks!
Jack.
---------------------------------
Be a PS3 game guru.
[[alternative HTML version deleted]]
2004 Nov 08
1
can one evaluate an expression in a comment? (or insert resultsinto history?)
But that doesn't put the result into the history buffer, to be written
to a file only later when I savehistory(filename).
Bert Gunter also suggested ?capture.output and ?textConnection,
but I cannot see how to get text into the history buffer as comments,
but with evaluated expressions (values).
I know how to use paste, sink, write, etc. but nothing that I can see
inserts into the history
2009 May 05
1
kghostview and xdg-open. Need to fix problem across whole system
In Centos 5.3, a bad problem has surfaced in user land. We want to use
either Evince or Adobe acroread as the pdf view, but the update of
kdegraphics has somehow screwed up these systems so that the odious,
horrible, awful pdf viewer kghostview is used. It is what you get
when you doubleclick on pdf files, it is what programs get when they
try to use xdg-open framework.
This happens even though
2008 Apr 13
1
.Rprofile, date tagging history, loading packages
Dear R-Helpers,
I'm fiddling with my .Rprofile in Windows XP & R 2.7.0 Beta. I prefer to
manually save my workspace but automatically save my command history via
the .Rprofile. That is working fine once I found that "utils::" was
required before the loadhistory & savehistory functions. What I would
like to do is add a separator line with a date between the histories of
each
2006 Mar 13
3
Incrementing a counter in lapply
Hi All,
I'm looking for some hints on idiomatic R usage using 'lapply' or similar.
What follows is a simple example from which to generalize my question...
# Suppose, in this simple example, I want to plot a number of different lines in different colors;
# I define the colors I wish to use and I plot them in a loop:
d<-
1999 Jun 14
1
readline/history size (PR#211)
Full_Name: Russell Senior
Version: 0.64.0
OS: linux-2.2.x
Submission from: (NULL) (198.107.133.11)
It appears that the GNU readline history size is limited to 50 entries. This
is apparently occurring because R is not bothering to override the readline
default value (from readline-4.0):
./history.c:59:#define DEFAULT_HISTORY_GROW_SIZE 50
It appears that it ought to be possible to override
2001 Feb 02
2
History
Hi,
I upgraded to version 1.2.1 and now the up/down arrows for recalling commands no
longer works. Is there a work around for this?
> version
_
platform sparc-sun-solaris2.7
arch sparc
os solaris2.7
system sparc, solaris2.7
status
major 1
minor 2.1
year
2012 Oct 17
3
history and readline, Mac OSX
Hi,
Obviously history() will only work with readline installed: so far I
have not been able to find working advice for installing and enabling
readline on MacOSX.
> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] C
attached base packages:
[1] tools tcltk stats4 splines parallel datasets compiler
[8] graphics
2006 Apr 11
1
pattern in history
Hi,
Sometimes I need to consult the history of commands that are matching a
regex, so I modified the utils::history function for that purpose. I
found it useful.
I append the code ( I only added the two lines with #**)
Romain.
history2 <-
function (pattern="", max.show = 25, reverse = FALSE, unique =
pattern!="", ...)
{
file1 <- tempfile("Rrawhist")
2003 Jan 20
1
Command History
I have compiled R under Solaris 7 (SunOS 5.7) with the readline-4.0
library linked. Command line editing appears to work, but I cannot
access command history. If I execute several commands in R, then type
"history()", I get the error message "Error in savehistory(file) : no
history available to save". Also, previous command recall (C-p) does
not seem to work. I am invoking
2009 Oct 25
2
Help with history() in Emacs/ESS
Hi Everyone,
I am a beginner running R 2.9.2 under Ubuntu and typically use Emacs w/ESS.
However, I am confused with history() command. When I issue command
history() in Emacs within an R session, this is what get:
> history()
Error in savehistory(file) : no history available to save
Similarly, history(max=10) command gives the same error message.
However, there is this In/Out Menu in the