I accidentally found the solution. I'm posting it here in case other people have similar problem.
All you need to do is add padding and specify empty top, bottom, right, left arguments in grid.arrange.
output$euler <- renderPlot(
grid.arrange(p,p,ncol=2,padding=unit(5,"line"),top="",bottom="",right="",left="")
)
