I have a list of ggplot objects that I am using the print()
function to display. When I do this in r markdown it adds ## $`item name`
where "item name" is the name of the object in the list. It adds this before every ggplot object. How do I get rid of this?
Asked
Active
Viewed 77 times
0

Dante
- 21
- 3
-
Please see [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [How to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). To get good and helpful answers, it is best to provide a minimal reproducible example. You can make use of `dput` to provide data. – AndrewGB Jun 24 '22 at 04:20
1 Answers
1
you can use unname
function to make the list printed as usual
a <- list(`one` = 2 , `two` = 3 , `three` = 4)
print(unname(a))
#> [[1]]
#> [1] 2
#>
#> [[2]]
#> [1] 3
#>
#> [[3]]
#> [1] 4

Mohamed Desouky
- 4,340
- 2
- 4
- 19