Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

The following is a style for an R cell, inspired by this answerthis answer. You can add this to your stylesheet (change the styles to your liking):

Cell[StyleData["R"],
    CellMargins->{{66, 10}, {5, 10}},
    Evaluatable->True,
    Background->RGBColor[1,1,0.85],
    AutoQuoteCharacters->{},
    CellEvaluationFunction -> (REvaluate["{"<>ToString@#<>"}"]&),
    CellFrameLabels -> {{None,"R"},{None,None}},
    LanguageCategory->"R",
    FormatType->InputForm,
    FontFamily -> "Inconsolata-dz",
    MenuCommandKey->"8"
]

You can now create a new R cell by pressing Cmd8, but you'll have to manually remove the MenuCommandKey setting from the "Code" style before it'll work. Alternately, you can simply press Cmd0 and choose R from the list.

You then use it just like any other input/code cell. Paste your R code into the cell and hit ShiftReturn and it'll evaluate it (assuming RLink has already been called, etc.)

enter image description here

The following is a style for an R cell, inspired by this answer. You can add this to your stylesheet (change the styles to your liking):

Cell[StyleData["R"],
    CellMargins->{{66, 10}, {5, 10}},
    Evaluatable->True,
    Background->RGBColor[1,1,0.85],
    AutoQuoteCharacters->{},
    CellEvaluationFunction -> (REvaluate["{"<>ToString@#<>"}"]&),
    CellFrameLabels -> {{None,"R"},{None,None}},
    LanguageCategory->"R",
    FormatType->InputForm,
    FontFamily -> "Inconsolata-dz",
    MenuCommandKey->"8"
]

You can now create a new R cell by pressing Cmd8, but you'll have to manually remove the MenuCommandKey setting from the "Code" style before it'll work. Alternately, you can simply press Cmd0 and choose R from the list.

You then use it just like any other input/code cell. Paste your R code into the cell and hit ShiftReturn and it'll evaluate it (assuming RLink has already been called, etc.)

enter image description here

The following is a style for an R cell, inspired by this answer. You can add this to your stylesheet (change the styles to your liking):

Cell[StyleData["R"],
    CellMargins->{{66, 10}, {5, 10}},
    Evaluatable->True,
    Background->RGBColor[1,1,0.85],
    AutoQuoteCharacters->{},
    CellEvaluationFunction -> (REvaluate["{"<>ToString@#<>"}"]&),
    CellFrameLabels -> {{None,"R"},{None,None}},
    LanguageCategory->"R",
    FormatType->InputForm,
    FontFamily -> "Inconsolata-dz",
    MenuCommandKey->"8"
]

You can now create a new R cell by pressing Cmd8, but you'll have to manually remove the MenuCommandKey setting from the "Code" style before it'll work. Alternately, you can simply press Cmd0 and choose R from the list.

You then use it just like any other input/code cell. Paste your R code into the cell and hit ShiftReturn and it'll evaluate it (assuming RLink has already been called, etc.)

enter image description here

added 34 characters in body
Source Link
Mike Honeychurch
  • 37.8k
  • 3
  • 87
  • 161

The following is a style for an R cell, inspired by this answer. You can add this to your stylesheet (change the styles to your liking):

Cell[StyleData["R"],
    CellMargins->{{66, 10}, {5, 10}},
    Evaluatable->True,
    Background->RGBColor[1,1,0.85],
    AutoQuoteCharacters->{},
    CellEvaluationFunction -> (REvaluate["{"<>ToString@#<>"}"]&),
    CellFrameLabels -> {{None,"R"},{None,None}},
    LanguageCategory->"R",
    FormatType->InputForm,
    FontFamily -> "Inconsolata-dz",
    MenuCommandKey->"8"
]

You can now create a new R cell by pressing Cmd8, but you'll have to manually remove the MenuCommandKey setting from the "Code" style before it'll work. Alternately, you can simply press Cmd0 and choose R from the list.

You then use it just like any other input/code cell. Paste your R code into the cell and hit ShiftReturn and it'll evaluate it (assuming RLink has already been called, etc.)

enter image description here

The following is a style for an R cell, inspired by this answer. You can add this to your stylesheet (change the styles to your liking):

Cell[StyleData["R"],
    CellMargins->{{66, 10}, {5, 10}},
    Evaluatable->True,
    Background->RGBColor[1,1,0.85],
    CellEvaluationFunction -> (REvaluate["{"<>ToString@#<>"}"]&),
    CellFrameLabels -> {{None,"R"},{None,None}},
    LanguageCategory->"R",
    FormatType->InputForm,
    FontFamily -> "Inconsolata-dz",
    MenuCommandKey->"8"
]

You can now create a new R cell by pressing Cmd8, but you'll have to manually remove the MenuCommandKey setting from the "Code" style before it'll work. Alternately, you can simply press Cmd0 and choose R from the list.

You then use it just like any other input/code cell. Paste your R code into the cell and hit ShiftReturn and it'll evaluate it (assuming RLink has already been called, etc.)

enter image description here

The following is a style for an R cell, inspired by this answer. You can add this to your stylesheet (change the styles to your liking):

Cell[StyleData["R"],
    CellMargins->{{66, 10}, {5, 10}},
    Evaluatable->True,
    Background->RGBColor[1,1,0.85],
    AutoQuoteCharacters->{},
    CellEvaluationFunction -> (REvaluate["{"<>ToString@#<>"}"]&),
    CellFrameLabels -> {{None,"R"},{None,None}},
    LanguageCategory->"R",
    FormatType->InputForm,
    FontFamily -> "Inconsolata-dz",
    MenuCommandKey->"8"
]

You can now create a new R cell by pressing Cmd8, but you'll have to manually remove the MenuCommandKey setting from the "Code" style before it'll work. Alternately, you can simply press Cmd0 and choose R from the list.

You then use it just like any other input/code cell. Paste your R code into the cell and hit ShiftReturn and it'll evaluate it (assuming RLink has already been called, etc.)

enter image description here

added 80 characters in body
Source Link
rm -rf
  • 89.3k
  • 21
  • 297
  • 480

The following is a style for an R cell, inspired by this answerthis answer. You can add this to your stylesheet (change the styles to your liking):

Cell[StyleData["R"],
    CellMargins->{{66, 10}, {5, 10}},
    Evaluatable->True,
    Background->RGBColor[1,1,0.85],
    CellEvaluationFunction -> (REvaluate["{"<>ToString@#<>"}"]&),
    CellFrameLabels -> {{None,"R"},{None,None}},
    LanguageCategory->"R",
    FormatType->InputForm,
    FontFamily -> "Inconsolata-dz",
    MenuCommandKey->"8"
]

You can now create a new R cell by pressing Cmd8, but you'll have to manually remove itthe MenuCommandKey setting from the "Code" style before it'll work. Alternately, you can simply press Cmd0 and choose R from the list.

You then use it just like any other input/code cell. Paste your R code into the cell and hit ShiftReturn and it'll evaluate it (assuming RLink has already been called, etc.)

enter image description hereenter image description here

The following is a style for an R cell, inspired by this answer. You can add this to your stylesheet:

Cell[StyleData["R"],
    CellMargins->{{66, 10}, {5, 10}},
    Evaluatable->True,
    Background->RGBColor[1,1,0.85],
    CellEvaluationFunction -> (REvaluate["{"<>ToString@#<>"}"]&),
    CellFrameLabels -> {{None,"R"},{None,None}},
    LanguageCategory->"R",
    FormatType->InputForm,
    MenuCommandKey->"8"
]

You can create a new R cell by pressing Cmd8, but you'll have to manually remove it from the "Code" style before it'll work. Alternately, you can simply press Cmd0 and choose R from the list.

You then use it just like any other input/code cell. Paste your R code into the cell and hit ShiftReturn and it'll evaluate it (assuming RLink has already been called, etc.)

enter image description here

The following is a style for an R cell, inspired by this answer. You can add this to your stylesheet (change the styles to your liking):

Cell[StyleData["R"],
    CellMargins->{{66, 10}, {5, 10}},
    Evaluatable->True,
    Background->RGBColor[1,1,0.85],
    CellEvaluationFunction -> (REvaluate["{"<>ToString@#<>"}"]&),
    CellFrameLabels -> {{None,"R"},{None,None}},
    LanguageCategory->"R",
    FormatType->InputForm,
    FontFamily -> "Inconsolata-dz",
    MenuCommandKey->"8"
]

You can now create a new R cell by pressing Cmd8, but you'll have to manually remove the MenuCommandKey setting from the "Code" style before it'll work. Alternately, you can simply press Cmd0 and choose R from the list.

You then use it just like any other input/code cell. Paste your R code into the cell and hit ShiftReturn and it'll evaluate it (assuming RLink has already been called, etc.)

enter image description here

Source Link
rm -rf
  • 89.3k
  • 21
  • 297
  • 480
Loading