Frame around R code and output in knitr and Latex [closed] - r

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am using knitr and Latex to write an intro into and overview of R. How can I get a box around R code chunks and R output in Latex? I can get them when using R Markdown and knitr to generate HTML. The Sweave way to frame chunks with a box does not work with knitr.
Thanks and regards,
Andreas

Related

Execute contents of editable text area [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
For a tutorial I am giving, I would like to show some R code in a Rmarkup document producing a plot, and then edit that code live and see the updated plot (for example changing points in the plot to lines).
Ik know I could use RShiny elements to do this, but I would really like to show the R code producing the plot. How can I do this?
The new versions of R Studio act like a notebook, in which the code chunks are evaluated and results displayed right below the chunk. Open a new R Markdown document, insert an R chunk, and Run Current Chunk.
```{r}
1+1
```

Using knitr with GIS data [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I'm attempting to create a presentation about loading/using shapefiles in R using the knitr package. The issue I'm encountering is that when I include standard # notation in my .Rnw file, as in ND#data, R reads that as the end of the code chunk meaning a bunch of my code doesn't get read in properly.
Here is a fuller example of my .Rnw file (data available from the North Dakota GIS portal http://www.nd.gov/gis/apps/HubExplorer/).
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{graphicx}
\begin{document}
<<Loading Datasets>>=
install.packages("rgdal")
library(rgdal)
ND <-readOGR(dsn="C:/Users/.../NDGISHubData",
layer="NDHUB_STATE_polygon")
head(ND#data)
ND#proj4string
plot(ND)
#
\end{document}
Is there a way to have R correctly recognize the # symbol in my code chunk as part of the code and not as the end of the R code chunk?

Creating a Latex table from custom R objects [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have a quick question on the conversion from R to Latex. I did a lot of calculations in R to produce various tables. These are not standard, but rather custom objects. Next I'd like to convert the results to my Latex document which is generally created by Texstudio.
Some of the R-packages I have checked here: Tools for making latex tables in R
allow for standard objects to be converted into Latex tables.
I think the question is interesting to a lot of people: What is the usual package you would use for this purpose? There are a few packages out there which could be used, but I am asking for experience and recommendations in the described context. Some of my tables are quite big, others rather small. Also someone recommended me Knitr/Sweave, but it doesn't seem to produce tables in Latex style that I can copy into my Latex document; instead it produces directly pdf-tables. Am I missing something here? But that was only a sidenote, I am just looking for the best method to accomplish conversion from non-standard R-tables into Latex.

rCharts Parallel Coordinates Plot with shiny [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need parallel coordinates plot with interactivity in shiny. This is the plot that I want and this is a solution of producing rCharts in shiny.
If you need interactivity, have a look at either ggvis or D3.js. ggvis is an R based solution, and D3.js uses Javascript. The first is still quite experimental, D3 is already very mature and can produce very nice interactive graphs (rendered client-side). This would whoever mean you need to learn JavaScript.

R: is there something like iPython notebook (jupyter) for R? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
As mentioned in question is there something like iPython's notebook (jupyter) for R-CRAN?
Have a look at Ramnath's R notebook:
http://www.youtube.com/embed/3niqZhc_Nbo
And here's the GitHub: https://github.com/ramnathv/rNotebook
EDIT (1/6/15)
I think the new editR package is what you're after
https://github.com/swarm-lab/editR
Not sure it would be an exact equivalent of iPython's notebooks, but you can use knitr to make literacy programming in R, by inserting code chunks inside a document. If you use a format like RMarkdown, you can export the document and the result of the code chunks to HTML. You can then publish the HTML file somewhere, or use sites like Rpubs. This process is quite straightforward if you use the RStudio IDE.
Another way, if you are an Emacs user, is to use org-mode and its extension org-babel.
Finally, you should be able to create more dynamic things with a framework like shiny. See for example the following knitr demo from the shiny library :
R> library(shiny)
R> demo("notebook", package = "knitr")
Would this be what you are looking for? http://www.rstudio.com/ide/

Resources