[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: [Org-Babel] and R... non-numeric cells
From: |
Sébastien Vauban |
Subject: |
[Orgmode] Re: [Org-Babel] and R... non-numeric cells |
Date: |
Wed, 18 Aug 2010 09:15:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Hi Dan,
Dan Davison wrote:
> Sébastien Vauban <address@hidden>
> writes:
>>
>> #+TBLNAME: investissement-2010-2013
>> #+ATTR_LaTeX: align=lSSSS
>> | | \s{Année 2010} | \s{Année 2011} | \s{Année 2012}
>> | \s{Année 2013} |
>> |------------------------+----------------+----------------+----------------+----------------|
>> | RFO | 2596376.30 | 1500000.00 | 500000.00
>> | 500000.00 |
>> | RFO réseau structurant | 3804467.00 | 6534066.00 | 3804467.00
>> | 0.00 |
>> | Équipements | 1000000.00 | 150000.00 | 50000.00
>> | 50000.00 |
>> |------------------------+----------------+----------------+----------------+----------------|
>> | Total (HTVA) | 7400843.30 | 8184066.00 | 4354467.00
>> | 550000.00 |
>> #+TBLFM:
>> @5$2=vsum(@address@hidden);%.2f::@5$3=vsum(@address@hidden);%.2f::@5$4=vsum(@address@hidden);%.2f::@5$5=vsum(@address@hidden);%.2f
>>
>> whose graphical representation is:
>>
>> #+srcname: barplot-investment(ptable = investissement-2010-2013)
>> #+begin_src R :file 1-01-investissement-2010-2013.png :exports none :session
>> source("mcplot.R", local=TRUE)
>> ## select the last row only, exclude first column, scale: unit = 1M
>> alldata <- as.matrix(ptable[2:4, -1]) / 1000000
>> axisLabels <- c("Année", "Montant HTVA (M€)")
>> mcStackedBarplot(alldata, "Investissements", c(2010:2013),
>> ptable[-nrow(ptable),1], legend.location="topright")
>> #+end_src
>>
>> That works perfectly for him (on Ubuntu 9.04, R 2.7.1, Emacs 22.2.1, Org
>> 6.35)
>>
>> Not for me... on Ubuntu 10.04, R 2.10.1, Emacs 23.1.1, Org 7.01, ESS 5.10: I
>> get the message
>>
>> *Error in as.matrix(ptable[2:4, -1])/1e+06 :
>> non-numeric argument to binary operator*
Thanks a lot for your detailed explanation. It helped a lot.
Best regards,
Seb
--
Sébastien Vauban