mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-11 03:52:56 +00:00
42 lines
804 B
Plaintext
42 lines
804 B
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"library(SparkR)\n",
|
|
"\n",
|
|
"# Spark session & context\n",
|
|
"sc <- sparkR.session(\"local\")\n",
|
|
"\n",
|
|
"# Sum of the first 100 whole numbers\n",
|
|
"sdf <- createDataFrame(list(1:100))\n",
|
|
"dapplyCollect(sdf,\n",
|
|
" function(x) \n",
|
|
" { x <- sum(x)}\n",
|
|
" )\n",
|
|
"# 5050"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "R",
|
|
"language": "R",
|
|
"name": "ir"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": "r",
|
|
"file_extension": ".r",
|
|
"mimetype": "text/x-r-source",
|
|
"name": "R",
|
|
"pygments_lexer": "r",
|
|
"version": "3.6.3"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 4
|
|
}
|