Quantcast

Trouble installing packages when history mechanism is modified by user profile

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Trouble installing packages when history mechanism is modified by user profile

Hugo Raguet-2
I tried installing the 'ks' package from my interactive R session, it
failed with the following

Erreur dans .External2(C_loadhistory, file) :
  aucun mécanisme d'historique des commandes disponible
Calls: <Anonymous>
Exécution arrêtée

second line is french for "no command history mechanism available", fouth
is "execution stopped".
This does not happen when I comment out the following line from my
.Rprofile:
utils::loadhistory(file = "~/.Rhistory")

On Stack Overflow, someone else has similar trouble with another package,
which seems to be also related to command history:
http://stackoverflow.com/questions/18240863/installing-packages-on-r-fails-when-loading-rprofile#18256224

Is this a bug in R, or in the concerned packages?

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble installing packages when history mechanism is modified by user profile

Henrik Bengtsson-5
Using

if (interactive()) utils::loadhistory(file = "~/.Rhistory")

should solve your problem.  The reason is that install.packages() in
turn launches a non-interactive child R process that installs the
package.  When that process loads your startup file, it fails, because
that function can only be used in interactive mode.  Here's an
example:

$ Rscript -e "utils::loadhistory()"
Error in .External2(C_loadhistory, file) : no history mechanism available

/Henrik

On Fri, Mar 3, 2017 at 5:51 AM, Hugo Raguet <[hidden email]> wrote:

> I tried installing the 'ks' package from my interactive R session, it
> failed with the following
>
> Erreur dans .External2(C_loadhistory, file) :
>   aucun mécanisme d'historique des commandes disponible
> Calls: <Anonymous>
> Exécution arrêtée
>
> second line is french for "no command history mechanism available", fouth
> is "execution stopped".
> This does not happen when I comment out the following line from my
> .Rprofile:
> utils::loadhistory(file = "~/.Rhistory")
>
> On Stack Overflow, someone else has similar trouble with another package,
> which seems to be also related to command history:
> http://stackoverflow.com/questions/18240863/installing-packages-on-r-fails-when-loading-rprofile#18256224
>
> Is this a bug in R, or in the concerned packages?
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Loading...