"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getServerSideProps = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const antd_1 = require("antd");
const footer_1 = __importDefault(require("components/landing/footer"));
const header_1 = __importDefault(require("components/landing/header"));
const content_1 = __importDefault(require("components/landing/content"));
const with_customize_1 = __importDefault(require("lib/with-customize"));
const customize_1 = require("lib/customize");
const sign_in_1 = __importDefault(require("components/landing/sign-in"));
const info_1 = __importDefault(require("components/landing/info"));
const pitch_1 = __importDefault(require("components/landing/pitch"));
const head_1 = __importDefault(require("components/landing/head"));
const snapshots_1 = __importDefault(require("components/landing/snapshots"));
const publishing_1 = __importDefault(require("components/landing/publishing"));
const A_1 = __importDefault(require("components/misc/A"));
const latex_1 = __importDefault(require("components/landing/latex"));
const icon_1 = require("@cocalc/frontend/components/icon");
const code_1 = __importDefault(require("components/landing/code"));
const contact_1 = __importDefault(require("components/landing/contact"));
const collaboration_1 = __importDefault(require("components/landing/collaboration"));
const r_logo_svg_1 = __importDefault(require("public/features/r-logo.svg"));
const cocalc_r_jupyter_png_1 = __importDefault(require("public/features/cocalc-r-jupyter.png"));
const cocalc_r_latex_png_1 = __importDefault(require("public/features/cocalc-r-latex.png"));
const cocalc_rmd_demo_R_python3_plotting_png_1 = __importDefault(require("public/features/cocalc-rmd-demo-R-python3-plotting.png"));
const cocalc_rcode_png_1 = __importDefault(require("public/features/cocalc-rcode.png"));
const cocalc_r_side_chat_png_1 = __importDefault(require("public/features/cocalc-r-side-chat.png"));
const cocalc_r_environment_png_1 = __importDefault(require("public/features/cocalc-r-environment.png"));
const cocalc_r_jupyter_collaborate_png_1 = __importDefault(require("public/features/cocalc-r-jupyter-collaborate.png"));
const component = "R";
const title = `Run ${component} Online`;
function R({ customize }) {
    return ((0, jsx_runtime_1.jsxs)(customize_1.Customize, { value: customize, children: [(0, jsx_runtime_1.jsx)(head_1.default, { title: "R Statistical Software" }), (0, jsx_runtime_1.jsxs)(antd_1.Layout, { children: [(0, jsx_runtime_1.jsx)(header_1.default, { page: "features", subPage: "r-statistical-software" }), (0, jsx_runtime_1.jsxs)(antd_1.Layout.Content, { children: [(0, jsx_runtime_1.jsx)("div", { style: { backgroundColor: "#c7d9f5" }, children: (0, jsx_runtime_1.jsx)(content_1.default, { startup: component, logo: r_logo_svg_1.default, title: title, subtitle: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Run ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://www.r-project.org/", children: "R code" }), ",", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "#a-jupyternotebook", children: "R in Jupyter notebooks" }), ", RMarkdown, or even", " ", (0, jsx_runtime_1.jsxs)(A_1.default, { href: "#a-latex", children: ["Knitr/Rnw ", (0, jsx_runtime_1.jsx)(latex_1.default, {})] }), " ", "in a full, remote online R environment."] }), subtitleBelow: true, image: cocalc_r_jupyter_png_1.default, alt: "Use of R in Jupyter" }) }), (0, jsx_runtime_1.jsx)(pitch_1.default, { col1: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h3", { children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "cocalc-ring", style: { marginRight: "10px" } }), "CoCalc makes working with R easy"] }), (0, jsx_runtime_1.jsxs)("p", { children: ["CoCalc handles all the tedious details for you, regardless of whether you want to work on the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/features/terminal", children: "command line" }), ", run", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "#a-jupyternotebook", children: "Jupyter Notebooks" }), ", create RMarkdown files, or use", " ", (0, jsx_runtime_1.jsxs)(A_1.default, { href: "#a-latex", children: ["Knitr in ", (0, jsx_runtime_1.jsx)(latex_1.default, {}), " documents"] }), "."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["This page is about ways to use R in the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "../", children: "CoCalc platform" }), "."] })] }), col2: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h3", { children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "lightbulb", style: { marginRight: "10px" } }), " Zero setup"] }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["No need for you to download and install", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://www.r-project.org/", children: "R" }), "."] }), (0, jsx_runtime_1.jsxs)("li", { children: ["CoCalc already", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/software/r", children: "provides many packages" }), " for you."] }), (0, jsx_runtime_1.jsxs)("li", { children: ["The ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/features/latex-editor", children: "LaTeX editor" }), " is already integrated with R."] }), (0, jsx_runtime_1.jsx)("li", { children: "You no longer have to maintain everything on your own." })] }), (0, jsx_runtime_1.jsxs)("div", { children: ["Start working by creating or", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/howto/upload.html", children: "uploading R files" }), ", RMarkdown documents, or", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/features/jupyter-notebook", children: "Jupyter notebooks" }), "."] })] }) }), (0, jsx_runtime_1.jsx)(sign_in_1.default, { startup: component }), (0, jsx_runtime_1.jsx)(info_1.default.Heading, { description: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["There are many ways to use ", component, " online via CoCalc."] }), children: "Feature Overview" }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "R in Jupyter Notebooks", icon: "ipynb", image: cocalc_r_jupyter_png_1.default, anchor: "a-jupyternotebook", alt: "Using R via the Jupyter notebook", children: [(0, jsx_runtime_1.jsxs)("p", { children: ["CoCalc offers a", " ", (0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "/features/jupyter-notebook", children: "complete rewrite" }) }), " ", "of the classical", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "http://jupyter.org/", children: "Jupyter notebook" }), " interface. It is", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "http://doc.cocalc.com/jupyter.html", children: "tightly integrated into CoCalc" }), " ", "and adds real-time collaboration, TimeTravel history and more."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["There is also support in CoCalc for easily using R with the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/jupyter.html#classical-versus-cocalc", children: "classical Jupyter notebook and JupyterLab." })] })] }), (0, jsx_runtime_1.jsx)(collaboration_1.default, { image: cocalc_r_jupyter_collaborate_png_1.default }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Extensive ", (0, jsx_runtime_1.jsx)(latex_1.default, {}), " support for R"] }), icon: "tex", image: cocalc_r_latex_png_1.default, anchor: "a-latex", alt: "Using Knitr in CoCalc to create an R-enhanced LaTeX document.", children: [(0, jsx_runtime_1.jsxs)("p", { children: ["The fully integrated", " ", (0, jsx_runtime_1.jsxs)(A_1.default, { href: "/features/latex-editor", children: ["CoCalc ", (0, jsx_runtime_1.jsx)(latex_1.default, {}), " editor"] }), " ", "covers all your basic needs for working with ", (0, jsx_runtime_1.jsx)(code_1.default, { children: ".tex" }), ",", " ", (0, jsx_runtime_1.jsx)(code_1.default, { children: ".Rnw" }), " and ", (0, jsx_runtime_1.jsx)(code_1.default, { children: ".Rtex" }), " files. The document is synchronized with your collaborators in realtime and everyone sees the same compiled PDF. In particular, this ", (0, jsx_runtime_1.jsx)(latex_1.default, {}), " editor"] }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: "Manages the entire compilation pipeline for you," }), (0, jsx_runtime_1.jsxs)("li", { children: ["Automatically processes", " ", (0, jsx_runtime_1.jsxs)("strong", { children: [(0, jsx_runtime_1.jsx)(code_1.default, { children: ".Rnw" }), " and ", (0, jsx_runtime_1.jsx)(code_1.default, { children: ".Rtex" }), " files"] }), " ", "using", " ", (0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://yihui.name/knitr/", children: "Knitr" }) }), ","] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Supports", " ", (0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/latex-features.html#forward-inverse-search", children: "forward and inverse search" }) }), " ", "to help you navigating in your document,"] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Captures and shows you", " ", (0, jsx_runtime_1.jsxs)("strong", { children: ["where each ", (0, jsx_runtime_1.jsx)(latex_1.default, {}), " or R error happened"] }), ","] }), (0, jsx_runtime_1.jsxs)("li", { children: ["and you can use", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/time-travel.html", children: "TimeTravel" }), "to go back in time to see your latest edits and", " ", (0, jsx_runtime_1.jsx)("strong", { children: "easily recover from a recent mistake" }), "."] })] }), (0, jsx_runtime_1.jsxs)("p", { children: ["This means you can move", " ", (0, jsx_runtime_1.jsx)("strong", { children: "your entire workflow online to CoCalc" }), ":"] }), (0, jsx_runtime_1.jsxs)("ol", { children: [(0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/howto/upload.html", children: "Upload" }), " or fetch your datasets,"] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Use ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "#a-jupyternotebook", children: "Jupyter Notebooks" }), " to explore the data and test your hypothesis,"] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)(A_1.default, { href: "#a-chat", children: "Discuss" }), " and", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "#a-collaboration", children: "collaborate" }), " with your research team,"] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Write your research paper in an ", (0, jsx_runtime_1.jsx)(code_1.default, { children: ".Rtex" }), " or", " ", (0, jsx_runtime_1.jsx)(code_1.default, { children: ".Rnw" }), " document,"] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)(A_1.default, { href: "#a-publishing", children: "Publish" }), " your datasets, your research code, and the PDF of your paper online, all hosted on CoCalc.", " "] })] })] }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "RMarkdown support", icon: "markdown", image: cocalc_rmd_demo_R_python3_plotting_png_1.default, anchor: "a-rmarkdown", alt: "An Rmarkdown document with a plot", children: [(0, jsx_runtime_1.jsx)("p", { children: (0, jsx_runtime_1.jsxs)("strong", { children: ["You can edit", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://rmarkdown.rstudio.com/", children: "RMarkdown files" }), " in CoCalc's code editor."] }) }), (0, jsx_runtime_1.jsx)("p", { children: "The source file is processed according to the YAML-frontmatter configuration and the view of the generated file is automatically updated in an HTML or PDF panel." }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("strong", { children: "Syntax highlighting" }), " for markdown and embedded programming code\u2014according to their language\u2014makes it easy to visually understand the source file."] }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/project-library.html", children: "CoCalc's library" }), " ", "features selected example files to get started quickly: e.g. HTML reports, article templates and a beamer presentation."] })] }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "Code formatting", icon: "network-wired", video: [
                                    "features/cocalc-jupyter-r-format-cell.webm",
                                    "features/cocalc-jupyter-r-format-cell.mp4",
                                ], anchor: "a-codeformatting", alt: "Video showing formatting of R in a Jupyter notebook", children: [(0, jsx_runtime_1.jsx)("p", { children: (0, jsx_runtime_1.jsx)("strong", { children: "CoCalc is able to format your R code." }) }), (0, jsx_runtime_1.jsxs)("p", { children: ["By simply clicking one button,", " ", (0, jsx_runtime_1.jsx)("strong", { children: "your R source code is formatted in a clean and consistent way" }), " ", "using the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://github.com/yihui/formatR#readme", children: "formatR package" }), "."] }), (0, jsx_runtime_1.jsx)("p", { children: "This reduces cognitive load reading source code, brings everyone in the team on the same page, and reduces misunderstandings." }), (0, jsx_runtime_1.jsxs)("p", { children: ["R code formatting works with", " ", (0, jsx_runtime_1.jsxs)("strong", { children: ["pure ", (0, jsx_runtime_1.jsx)("code", { children: ".r" }), " files"] }), " ", "and", " ", (0, jsx_runtime_1.jsxs)("strong", { children: [(0, jsx_runtime_1.jsx)(A_1.default, { href: "#a-jupyternotebook", children: "Jupyter Notebooks" }), " running an R kernel"] }), ".", " "] })] }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "Command line support", icon: "terminal", image: cocalc_rcode_png_1.default, anchor: "a-commandline", alt: "Using R from a command line terminal", children: [(0, jsx_runtime_1.jsxs)("p", { children: ["All your existing R scripts run on the command line right in CoCalc.", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/terminal.html", children: "Open a Terminal" }), " ", "and you find yourself in a familiar Linux shell with a local filesystem for your data files, access to", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://www.git-scm.com", children: "Git" }), " and", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/software/executables", children: "a large number of commands..." }), " ", (0, jsx_runtime_1.jsx)("strong", { children: "Feel at home and run your analysis as usual!" })] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Terminals can be used ", (0, jsx_runtime_1.jsx)("em", { children: "by multiple users at once" }), ". This means you can work with your collaborators in the same session at the same time. Everyone sees the same output, and via", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/chat.html", children: "side chat" }), " next to the terminal, the whole team can coordinate."] }), (0, jsx_runtime_1.jsx)("p", { children: "Beyond that, you can simultaneously work with several terminal sessions. This gives you the ability to run your code concurrently." }), (0, jsx_runtime_1.jsx)("p", { children: "For long-running programs, you can even close your browser and check on the result later." })] }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "Chatrooms and side chat", icon: "comment", image: cocalc_r_side_chat_png_1.default, anchor: "a-chat", alt: "Chatting about an R Jupyter notebook", children: [(0, jsx_runtime_1.jsxs)("p", { children: ["Collaboration is a first class citizen on CoCalc. A", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/chat.html", children: "side-by-side chat" }), " ", "next to your R code, ", (0, jsx_runtime_1.jsx)(latex_1.default, {}), " files and notebooks makes it easy to discuss content with your colleagues or students. You can also create dedicated chatrooms."] }), (0, jsx_runtime_1.jsx)("p", { children: "Avatars show who is currently working on a file." }), (0, jsx_runtime_1.jsx)("p", { children: "Collaborators who are not online will be notified about new messages the next time they sign in." }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/chat.html", children: "Chat" }), " also supports markdown formatting and ", (0, jsx_runtime_1.jsx)(latex_1.default, {}), " formulas."] })] }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "Managed R Environment", icon: "server", image: cocalc_r_environment_png_1.default, anchor: "a-environment", alt: "Exploring the stack of installed R packages in a Jupyter notebook", children: [(0, jsx_runtime_1.jsx)("p", { children: "CoCalc makes sure that the computational environment for R is regularly updated and ready to work with. Our goal is enabling you to get started with your analysis without any overhead." }), (0, jsx_runtime_1.jsxs)("p", { children: ["Look at our ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/software/r", children: "list of available packages" }), " ", "in more detail. If something is missing, please tell us about it (", (0, jsx_runtime_1.jsx)(contact_1.default, { lower: true }), ") so we can install that package globally."] })] }), (0, jsx_runtime_1.jsx)(publishing_1.default, {}), (0, jsx_runtime_1.jsx)(snapshots_1.default, {}), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "TimeTravel", icon: "history", video: [
                                    "features/cocalc-timetravel-r-jupyter-3x.webm",
                                    "features/cocalc-timetravel-r-jupyter-3x.mp4",
                                ], anchor: "a-timetravel", alt: "Video showing the time travel slider in an R Jupyter notebook", children: [(0, jsx_runtime_1.jsxs)("p", { children: ["The", " ", (0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/time-travel.html", children: "TimeTravel feature" }) }), " ", "is specific to the CoCalc platform. It records all your changes in editable files like R source code, Jupyter notebook and ", (0, jsx_runtime_1.jsx)(latex_1.default, {}), "documents in fine detail. You can go back and forth in time across thousands of changes to recover your previous edits."] }), (0, jsx_runtime_1.jsx)("p", { children: "This allows you to easily recover any part of any version of your file by copying and pasting. You can also see exactly what changed from one version to the next." }), (0, jsx_runtime_1.jsx)("p", { children: "You can visualize the entire process of creating a Jupyter notebook from the start. This lets you discover how you arrived at a particular solution and see what you (or your student) attempted before the final solution." })] }), (0, jsx_runtime_1.jsx)(sign_in_1.default, { startup: component })] }), (0, jsx_runtime_1.jsx)(footer_1.default, {})] })] }));
}
exports.default = R;
async function getServerSideProps(context) {
    return await (0, with_customize_1.default)({ context });
}
exports.getServerSideProps = getServerSideProps;
//# sourceMappingURL=r-statistical-software.js.map