Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Please consider the following MWE which I compile into a .tex document via knitr

\documentclass{article}


\begin{document}

<<echo=FALSE, message=FALSE, warning=FALSE>>=
library(igraph)
library(GGally)
library(network)
library(sna)

# Set up data
set.seed(123)
g <- barabasi.game(1000)

# Plot data
ggnet(g, weight.method = "indegree")

@


\end{document}

which inserts

\begin{verbatim}
## 1000 nodes, weighted by indegree 
## 
##    id indegree outdegree freeman
## 4   4       47         1      48
## 12 12       37         1      38
## 3   3       34         1      35
## 13 13       32         1      33
## 1   1       23         0      23
## 11 11       19         1      20
\end{verbatim}

in my .tex.

How could I control it?

share|improve this question
1  
looks like a duplicate of stackoverflow.com/questions/24949113/… –  Yihui Jul 25 at 22:41
    
@Yihui, yes but it seems I can't ask to close it as duplicate since are on a different sites... –  Francesco Jul 27 at 0:12
    
No worries. Let's leave it to people who can do it. I cannot do it, either. –  Yihui Jul 27 at 1:32

1 Answer 1

up vote 5 down vote accepted

Add results="hide" to the chunk options. See the documentation.

\documentclass{article}

\begin{document}

<<echo=FALSE, message=FALSE, warning=FALSE, results="hide">>=
library(igraph)
library(GGally)
library(network)
library(sna)

# Set up data
set.seed(123)
g <- barabasi.game(1000)

# Plot data
ggnet(g, weight.method = "indegree")

@

\end{document}

Result picture

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.