Inserindo logotipo na apresentação beamer usando R Markdown

Estou tentando inserir o logotipo na presenização do beamer usando o Rmarkdown, e parece que os controles de tamanho em\logo{\includegraphics[height=1cm,width=3cm]{logo.png}} não funciona, não importa quais valores eu coloquei lá, a imagem é sempre do mesmo tamanho. Alguma sugestão além de modificar a imagem manualmente?

---
title: "Presentation"
author: "Author"
output:
  beamer_presentation:
    includes:
      in_header: mystyle.tex

---

## R Markdown

This is an R Markdown presentation. Markdown is a simple formatting
syntax for authoring HTML, PDF, and MS Word documents. For more
details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that
includes both content as well as the output of any embedded R code
chunks within the document.

## Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3

## Slide with R Code and Output

```{r}
summary(cars)
```

## Slide with Plot

```{r, echo=FALSE}
plot(cars)
```

Este é o mystyle.tex

\logo{\includegraphics[height=1cm,width=3cm]{logo.png}}
\usetheme{Madrid}
\usefonttheme{serif}
\institute{Institute}
\setbeamertemplate{navigation symbols}{}

ATUALIZAÇÃO: Solução rápida - simplesmente modificar a imagem não funcionará - a imagem é feia e pixelizada. Simplesmente converter para pdf também não funcionou bem, então eu usei o seguinte código R para criar pdf e usá-lo em \ logo {\ includegraphics {logo.pdf}}

library(png)
library(grid)
img <- readPNG('logo.png')
img <- rasterGrob(img, interpolate=TRUE)
pdf(file = 'logo.pdf', width = 1, height = 0.25)
grid.newpage()
grid.raster(img)
dev.off()

questionAnswers(1)

yourAnswerToTheQuestion