From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: Bug in org-table-convert-region? Date: Tue, 28 May 2013 09:17:10 +0200 Message-ID: <8638t7she1.fsf@somewhere.org> References: <87vc64vxjy.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Thorsten, Thorsten Jolitz wrote: > using 'M-: (org-table-convert-region beg end 2) on this output (with > beg/end being the points before and after the tabular data) > > ,------------------------------------------------------------------- > | =3D=3D=3D Error on training data =3D=3D=3D > | > | Correctly Classified Instances 147 98 % > | Incorrectly Classified Instances 3 2 % > | Kappa statistic 0.97 > | Mean absolute error 0.0233 > | Root mean squared error 0.108 > | Relative absolute error 5.2482 % > | Root relative squared error 22.9089 % > | Total Number of Instances 150 > `------------------------------------------------------------------- > > I get what I want: > > | Correctly Classified Instances | 144 | 96 | % | > | Incorrectly Classified Instances | 6 | 4 | % | > | Kappa statistic | 0.94 | | | > | Mean absolute error | 0.035 | | | > | Root mean squared error | 0.1586 | | | > | Relative absolute error | 7.8705 % | | | > | Root relative squared error | 33.6353 % | | | > | Total Number of Instances | 150 | | | I doubt this table is the conversion of the above: figures are different=C2= =A0;-) (nitpicking) > However, using 'C-u 2 M-x org-table-convert-region' on the marked region > yields this: > > | Correctly | Classified | Instances | 144 | 96 | % | > | Incorrectly | Classified | Instances | 6 | 4 | % | > | Kappa | statistic | 0.94 | | | | > | Mean | absolute | error | 0.035 | | | > | Root | mean | squared | error | 0.1586 | | > | Relative | absolute | error | 7.8705 | % | | > | Root | relative | squared | error | 33.6353 | % | > | Total | Number | of | Instances | 150 | | > > From the comment-string: > > ,----------------------------------------------------------------------- > | (org-table-convert-region BEG0 END0 &optional SEPARATOR) > | > | Convert region to a table.[...] > | SEPARATOR specifies the field separator in the lines. It can have the > | following values: > | > | '(4) Use the comma as a field separator > | '(16) Use a TAB as field separator > | integer When a number, use that many spaces as field separator > | nil When nil, the command tries to be smart and figure out the > `----------------------------------------------------------------------- > > and from the elisp manual: > > ,----------------------------------------------------------------------- > | Here are the results of calling display-prefix with various raw prefix > | arguments: > | > | C-u M-x display-prefix -| (4) > | > | C-u C-u M-x display-prefix -| (16) > | > | C-u 3 M-x display-prefix -| 3 > `----------------------------------------------------------------------- > > Looks like a bug in the argument handling? I don't have an answer, but one extra question (which popped up when reading your analysis): how does Emacs see the difference between `C-u' and `C-u 4'? That is, how to differentiate "Use the comma as a field separator" from "Use 4=C2=A0spaces as field separator"? Best regards, Seb --=20 Sebastien Vauban