[R--gR] deal: genlatex fails

Claus Dethlefsen / Aalborg Sygehus aas.claus.dethlefsen at nja.dk
Sat Mar 25 14:23:42 CET 2006


Dear Sam
 
genlatex needs an object of class "networklist" as input, which will then be arranged nicely in a table in latex code, where the networks are stored in pictex format. You are inputting a single network, which is not handled by genlatex.
 
The search (heuristic/auto) also returns a table of strings representing all the networks that have been "visited" in the search. The function 'makenw' can take this table and re-create the networks as a networklist, which can then be sorted (according to score) and used as input to genlatex/genpicfile.
 
You probably want to do something along the lines:
 
library(deal)
data(ksl)
ksl.nw  <- network(ksl)
ksl.prior <- jointprior(ksl.nw,64)
mybanlist <- matrix(c(5,5,6,6,7,7,9,
                    8,9,8,9,8,9,8),ncol=2)
banlist(ksl.nw) <- mybanlist                  
ksl.nw <- getnetwork(learn(ksl.nw,ksl,ksl.prior))
ksl.search <- autosearch(ksl.nw,ksl,ksl.prior,
                      trace=TRUE)
ksl.searchlist <- makenw(ksl.search$table,ksl.search$nw)
ksl.searchlist <- nwfsort(ksl.searchlist)
genpicfile(ksl.searchlist)
genlatex(ksl.searchlist)

 
- There is no way to 'glue' arrows into the network (opposite of 'ban').
 
- To print networks, consider using the R devices pdf() or postscript() which will created files with the networks displayed in the graphics window. The files can then be printed.
 
Best,
Claus
 
________________________________
Claus Dethlefsen, Msc, PhD
Statistiker ved Kardiovaskulært Forskningscenter

 
Forskningens Hus
Aalborg Sygehus 
Sdr. Skovvej 15
9000 Aalborg

Tlf:   9932 6863
email: aas.claus.dethlefsen at nja.dk <mailto:aas.claus.dethlefsen at nja.dk> 

________________________________

Fra: r-sig-gr-bounces at stat.math.ethz.ch på vegne af Sam Steingold
Sendt: ti 21-03-2006 20:13
Til: r-sig-gr at stat.math.ethz.ch
Emne: [R--gR] deal: genlatex fails



I get this:

> genlatex(search)
Error in if (x == 1) return("\\footnotesize{$1$}") :
        argument is of length zero


search is returned by autosearch.
the same error with the return value of heuristic.

pic/scoretable.tex:
----------------------------------------------------------------
%% generated automatically Tue Mar 21 14:05:50 2006 - Don't edit by hand
%% A master file:
%% documentclass{article}
%% usepackage{array,pictex}
%% egin{document}
%% input{scoretable}
%% end{document}
\begin{tabular}{|m{2.4cm}|m{2.4cm}|m{2.4cm}|m{2.4cm}|m{2.4cm}|}\hline
\vspace{-0.9cm}\begin{minipage}[t]{2.4cm}
\input{pic1.tex}
\vspace{-1.8cm}\footnotesize{$ 380.0  $}\\
\footnotesize{$1$}
\end{minipage}
&
----------------------------------------------------------------

note "^H" instead of "b" above.

other questions:

--- is there a way to _prescribe_ arrows (the inverse of banlist)?
    I do not want to use the gui (drawnetwork), I want something more
    command-line oriented.

--- how do I print a network to the printer?
    all I can see now is plot() + print screen.

Thanks!

--
Sam Steingold (http://www.podval.org/~sds) on Fedora Core release 4 (Stentz)
http://www.honestreporting.com http://www.openvotingconsortium.org
http://truepeace.org http://www.camera.org http://www.jihadwatch.org
Daddy, what does "format disk c: complete" mean?

_______________________________________________
R-sig-gR mailing list
R-sig-gR at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-gr




More information about the R-sig-gR mailing list