Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/pages/features/r-statistical-software.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Layout } from "antd";67import { Icon } from "@cocalc/frontend/components/icon";8import Code from "components/landing/code";9import Collaboration from "components/landing/collaboration";10import Contact from "components/landing/contact";11import Content from "components/landing/content";12import Footer from "components/landing/footer";13import Head from "components/landing/head";14import Header from "components/landing/header";15import Info from "components/landing/info";16import LaTeX from "components/landing/latex";17import Pitch from "components/landing/pitch";18import Publishing from "components/landing/publishing";19import SignIn from "components/landing/sign-in";20import Snapshots from "components/landing/snapshots";21import { Paragraph, Title } from "components/misc";22import A from "components/misc/A";23import { Customize } from "lib/customize";24import withCustomize from "lib/with-customize";25import rEnvironment from "public/features/cocalc-r-environment.png";26import jupyterCollab from "public/features/cocalc-r-jupyter-collaborate.png";27import rJupyter from "public/features/cocalc-r-jupyter.png";28import rLatex from "public/features/cocalc-r-latex.png";29import sidechat from "public/features/cocalc-r-side-chat.png";30import rcode from "public/features/cocalc-rcode.png";31import rmdDemo from "public/features/cocalc-rmd-demo-R-python3-plotting.png";32import logo from "public/features/r-logo.svg";3334const component = "R";35const title = `Run ${component} Online`;3637export default function R({ customize }) {38return (39<Customize value={customize}>40<Head title={"R Statistical Software"} />41<Layout>42<Header43page="features"44subPage="r-statistical-software"45runnableTag="R"46/>47<Layout.Content>48<Content49landing50startup={component}51body={logo}52title={title}53subtitle={54<>55Run <A href="https://www.r-project.org/">R code</A>,{" "}56<A href="#a-jupyternotebook">R in Jupyter notebooks</A>,57RMarkdown, or even{" "}58<A href="#a-latex">59Knitr/Rnw <LaTeX />60</A>{" "}61in a full, remote online R environment.62</>63}64subtitleBelow={true}65image={rJupyter}66alt={"Use of R in Jupyter"}67/>6869<Pitch70col1={71<>72<Title level={3}>73<Icon name="pencil-alt" style={{ marginRight: "10px" }} />74CoCalc makes working with R easy75</Title>76<Paragraph>77CoCalc handles all the tedious details for you, regardless of78whether you want to work on the{" "}79<A href="/features/terminal">command line</A>, run{" "}80<A href="#a-jupyternotebook">Jupyter Notebooks</A>, create81RMarkdown files, or use{" "}82<A href="#a-latex">83Knitr in <LaTeX /> documents84</A>85.86</Paragraph>87<Paragraph>88This page is about ways to use R in the{" "}89<A href="../">CoCalc platform</A>.90</Paragraph>91</>92}93col2={94<>95<Title level={3}>96<Icon name="lightbulb" style={{ marginRight: "10px" }} /> Zero97setup98</Title>99<Paragraph>100<ul>101<li>102No need for you to download and install{" "}103<A href="https://www.r-project.org/">R</A>.104</li>105<li>106CoCalc already{" "}107<A href="/software/r">provides many packages</A> for you.108</li>109<li>110The <A href="/features/latex-editor">LaTeX editor</A> is111already integrated with R.112</li>113<li>114You no longer have to maintain everything on your own.115</li>116</ul>117</Paragraph>118<Paragraph>119Start working by creating or{" "}120<A href="https://doc.cocalc.com/howto/upload.html">121uploading R files122</A>123, RMarkdown documents, or{" "}124<A href="/features/jupyter-notebook">Jupyter notebooks</A>.125</Paragraph>126</>127}128/>129130<SignIn startup={component} />131132<Info.Heading133description={134<>There are many ways to use {component} online via CoCalc.</>135}136>137Feature Overview138</Info.Heading>139140<Info141title="R in Jupyter Notebooks"142icon="ipynb"143image={rJupyter}144anchor="a-jupyternotebook"145alt={"Using R via the Jupyter notebook"}146>147<Paragraph>148CoCalc offers a{" "}149<strong>150<A href="/features/jupyter-notebook">complete rewrite</A>151</strong>{" "}152of the classical{" "}153<A href="http://jupyter.org/">Jupyter notebook</A> interface. It154is{" "}155<A href="http://doc.cocalc.com/jupyter.html">156tightly integrated into CoCalc157</A>{" "}158and adds real-time collaboration, TimeTravel history and more.159</Paragraph>160<Paragraph>161There is also support in CoCalc for easily using R with the{" "}162<A href="https://doc.cocalc.com/jupyter.html#classical-versus-cocalc">163classical Jupyter notebook and JupyterLab.164</A>165</Paragraph>166</Info>167168<Collaboration image={jupyterCollab} />169170<Info171title={172<>173Extensive <LaTeX /> support for R174</>175}176icon="tex"177image={rLatex}178anchor="a-latex"179alt="Using Knitr in CoCalc to create an R-enhanced LaTeX document."180below={181<>182<Paragraph>183This means you can move{" "}184<strong>your entire workflow online to CoCalc</strong>:185</Paragraph>186<Paragraph>187<ol>188<li>189<A href="https://doc.cocalc.com/howto/upload.html">190Upload191</A>{" "}192or fetch your datasets,193</li>194<li>195Use <A href="#a-jupyternotebook">Jupyter Notebooks</A> to196explore the data and test your hypothesis,197</li>198<li>199<A href="#a-chat">Discuss</A> and{" "}200<A href="#a-collaboration">collaborate</A> with your201research team,202</li>203<li>204Write your research paper in an <Code>.Rtex</Code> or{" "}205<Code>.Rnw</Code> document,206</li>207<li>208<A href="#a-publishing">Publish</A> your datasets, your209research code, and the PDF of your paper online, all210hosted on CoCalc.{" "}211</li>212</ol>213</Paragraph>214</>215}216>217<Paragraph>218The fully integrated{" "}219<A href="/features/latex-editor">220CoCalc <LaTeX /> editor221</A>{" "}222covers all your basic needs for working with <Code>.tex</Code>,{" "}223<Code>.Rnw</Code> and <Code>.Rtex</Code> files. The document is224synchronized with your collaborators in realtime and everyone sees225the same compiled PDF. In particular, this <LaTeX /> editor226</Paragraph>227<Paragraph>228<ul>229<li>Manages the entire compilation pipeline for you,</li>230<li>231Automatically processes{" "}232<strong>233<Code>.Rnw</Code> and <Code>.Rtex</Code> files234</strong>{" "}235using{" "}236<strong>237<A href="https://yihui.name/knitr/">Knitr</A>238</strong>239,240</li>241<li>242Supports{" "}243<strong>244<A href="https://doc.cocalc.com/latex-features.html#forward-inverse-search">245forward and inverse search246</A>247</strong>{" "}248to help you navigating in your document,249</li>250<li>251Captures and shows you{" "}252<strong>253where each <LaTeX /> or R error happened254</strong>255,256</li>257<li>258and you can use259<A href="https://doc.cocalc.com/time-travel.html">260TimeTravel261</A>262to go back in time to see your latest edits and{" "}263<strong>easily recover from a recent mistake</strong>.264</li>265</ul>266</Paragraph>267</Info>268269<Info270title="RMarkdown support"271icon="markdown"272image={rmdDemo}273anchor="a-rmarkdown"274alt="An Rmarkdown document with a plot"275>276<Paragraph>277<strong>278You can edit{" "}279<A href="https://rmarkdown.rstudio.com/">RMarkdown files</A> in280CoCalc's code editor, as{" "}281<A href="https://doc.cocalc.com/frame-editor.html#edit-rmd">282explained here283</A>284.285</strong>286</Paragraph>287<Paragraph>288The source file is processed according to the YAML-frontmatter289configuration and the view of the generated file is automatically290updated in an HTML or PDF panel.291</Paragraph>292<Paragraph>293<strong>Syntax highlighting</strong> for markdown and embedded294programming code—according to their language—makes it easy to295visually understand the source file.296</Paragraph>297<Paragraph>298<A href="https://doc.cocalc.com/project-library.html">299CoCalc's library300</A>{" "}301features selected example files to get started quickly: e.g. HTML302reports, article templates and a beamer presentation.303</Paragraph>304</Info>305306<Info307title="Code formatting"308icon="network-wired"309video={[310"features/cocalc-jupyter-r-format-cell.webm",311"features/cocalc-jupyter-r-format-cell.mp4",312]}313anchor="a-codeformatting"314alt="Video showing formatting of R in a Jupyter notebook"315>316<Paragraph>317<strong>CoCalc is able to format your R code.</strong>318</Paragraph>319<Paragraph>320By simply clicking one button,{" "}321<strong>322your R source code is formatted in a clean and consistent way323</strong>{" "}324using the{" "}325<A href="https://github.com/yihui/formatR#readme">326formatR package327</A>328.329</Paragraph>330<Paragraph>331This reduces cognitive load reading source code, brings everyone332in the team on the same page, and reduces misunderstandings.333</Paragraph>334<Paragraph>335R code formatting works with{" "}336<strong>337pure <code>.r</code> files338</strong>{" "}339and{" "}340<strong>341<A href="#a-jupyternotebook">Jupyter Notebooks</A> running an R342kernel343</strong>344.{" "}345</Paragraph>346</Info>347348<Info349title={"Command line support"}350icon="terminal"351image={rcode}352anchor="a-commandline"353alt="Using R from a command line terminal"354>355<Paragraph>356All your existing R scripts run on the command line right in357CoCalc.{" "}358<A href="https://doc.cocalc.com/terminal.html">Open a Terminal</A>{" "}359and you find yourself in a familiar Linux shell with a local360filesystem for your data files, access to{" "}361<A href="https://www.git-scm.com">Git</A> and{" "}362<A href="/software/executables">a large number of commands...</A>{" "}363<strong>Feel at home and run your analysis as usual!</strong>364</Paragraph>365<Paragraph>366Terminals can be used <em>by multiple users at once</em>. This367means you can work with your collaborators in the same session at368the same time. Everyone sees the same output, and via{" "}369<A href="https://doc.cocalc.com/chat.html">side chat</A> next to370the terminal, the whole team can coordinate.371</Paragraph>372<Paragraph>373Beyond that, you can simultaneously work with several terminal374sessions. This gives you the ability to run your code375concurrently.376</Paragraph>377<Paragraph>378For long-running programs, you can even close your browser and379check on the result later.380</Paragraph>381</Info>382383<Info384title="Chatrooms and side chat"385icon="comment"386image={sidechat}387anchor="a-chat"388alt="Chatting about an R Jupyter notebook"389>390<Paragraph>391Collaboration is a first class citizen on CoCalc. A{" "}392<A href="https://doc.cocalc.com/chat.html">side-by-side chat</A>{" "}393next to your R code, <LaTeX /> files and notebooks makes it easy394to discuss content with your colleagues or students. You can also395create dedicated chatrooms.396</Paragraph>397<Paragraph>398Avatars show who is currently working on a file.399</Paragraph>400<Paragraph>401Collaborators who are not online will be notified about new402messages the next time they sign in.403</Paragraph>404<Paragraph>405<A href="https://doc.cocalc.com/chat.html">Chat</A> also supports406markdown formatting and <LaTeX /> formulas.407</Paragraph>408</Info>409410<Info411title="Managed R Environment"412icon="server"413image={rEnvironment}414anchor="a-environment"415alt="Exploring the stack of installed R packages in a Jupyter notebook"416>417<Paragraph>418CoCalc makes sure that the computational environment for R is419regularly updated and ready to work with. Our goal is enabling you420to get started with your analysis without any overhead.421</Paragraph>422<Paragraph>423Look at our <A href="/software/r">list of available packages</A>{" "}424in more detail. If something is missing, please tell us about it (425<Contact lower />) so we can install that package globally.426</Paragraph>427</Info>428429<Publishing />430431<Snapshots />432433<Info434title="TimeTravel"435icon="history"436video={[437"features/cocalc-timetravel-r-jupyter-3x.webm",438"features/cocalc-timetravel-r-jupyter-3x.mp4",439]}440anchor="a-timetravel"441alt="Video showing the time travel slider in an R Jupyter notebook"442>443<Paragraph>444The{" "}445<strong>446<A href="https://doc.cocalc.com/time-travel.html">447TimeTravel feature448</A>449</strong>{" "}450is specific to the CoCalc platform. It records all your changes in451editable files like R source code, Jupyter notebook and <LaTeX />452documents in fine detail. You can go back and forth in time across453thousands of changes to recover your previous edits.454</Paragraph>455<Paragraph>456This allows you to easily recover any part of any version of your457file by copying and pasting. You can also see exactly what changed458from one version to the next.459</Paragraph>460<Paragraph>461You can visualize the entire process of creating a Jupyter462notebook from the start. This lets you discover how you arrived at463a particular solution and see what you (or your student) attempted464before the final solution.465</Paragraph>466</Info>467<SignIn startup={component} />468</Layout.Content>469<Footer />470</Layout>471</Customize>472);473}474475export async function getServerSideProps(context) {476return await withCustomize({ context });477}478479480