[R-SIG-Finance] as.journal returns subscript out of bounds

Enrico Schumann e@ @end|ng |rom enr|co@chum@nn@net
Fri Apr 11 20:36:03 CEST 2025


On Fri, 11 Apr 2025, Arnaud Gaboury writes:

> On Fri, 2025-04-11 at 19:33 +0200, Enrico Schumann wrote:
>
> I was just writing the same observation: it is when I run view().
>
> gabx using magnolia [R] short_j <- journal(
> ...   timestamp = short$value,
> ...   amount = short$executed_qty,
> ...   price = short$price,
> ...   instrument = short$symbol
> ... )
> gabx using magnolia [R] View(short_j)
> Error in names[[i]] : subscript out of bounds
>
> As you can see, I can build the short_j journal with no error, but it
> is when I want to view it.
> I use Rstudio on Archlinux.
> When running 
> R > utils::View(btc_journal)
>
> a pop up window open with the journal in a correct view.
>
> So there is something wrong with Rstudio ? Or any package of my linux
> distro?

I'd go with "It happens with RStudio".  I am not sure View
is supposed to support journals or other non-base datatypes.
But ?utils::View (i.e. the 'real' View) says that
utils::View coerces to data.frame, and since there is an
as.data.frame method for journals, it just works.


[...]


-- 
Enrico Schumann
Lucerne, Switzerland
https://enricoschumann.net



More information about the R-SIG-Finance mailing list