{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "42260e2c", "metadata": { "collapsed": true }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\n", "
A data.frame: 3 × 3
korengmath
<dbl><dbl><dbl>
홍길동807050
이순신908040
임꺽정305020
\n" ], "text/latex": [ "A data.frame: 3 × 3\n", "\\begin{tabular}{r|lll}\n", " & kor & eng & math\\\\\n", " & & & \\\\\n", "\\hline\n", "\t홍길동 & 80 & 70 & 50\\\\\n", "\t이순신 & 90 & 80 & 40\\\\\n", "\t임꺽정 & 30 & 50 & 20\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A data.frame: 3 × 3\n", "\n", "| | kor <dbl> | eng <dbl> | math <dbl> |\n", "|---|---|---|---|\n", "| 홍길동 | 80 | 70 | 50 |\n", "| 이순신 | 90 | 80 | 40 |\n", "| 임꺽정 | 30 | 50 | 20 |\n", "\n" ], "text/plain": [ " kor eng math\n", "홍길동 80 70 50 \n", "이순신 90 80 40 \n", "임꺽정 30 50 20 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "v1 = c('홍길동','이순신', '임꺽정')\n", "v2 = c(80,90, 30)\n", "v3 = c(70,80, 50)\n", "v4 = c(50,40, 20)\n", "df = data.frame( v2,v3,v4, row.names = v1)\n", "colnames(df) = c('kor','eng','math')\n", "df" ] }, { "cell_type": "code", "execution_count": 4, "id": "b28f241f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "200" ], "text/latex": [ "200" ], "text/markdown": [ "200" ], "text/plain": [ "[1] 200" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sum( df$kor )" ] }, { "cell_type": "code", "execution_count": 5, "id": "42af9e78", "metadata": {}, "outputs": [ { "data": { "text/html": [ "510" ], "text/latex": [ "510" ], "text/markdown": [ "510" ], "text/plain": [ "[1] 510" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sum( df )" ] }, { "cell_type": "code", "execution_count": 8, "id": "19dcd8bb", "metadata": { "collapsed": true }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\n", "
A data.frame: 3 × 1
kor
<dbl>
홍길동80
이순신90
임꺽정30
\n" ], "text/latex": [ "A data.frame: 3 × 1\n", "\\begin{tabular}{r|l}\n", " & kor\\\\\n", " & \\\\\n", "\\hline\n", "\t홍길동 & 80\\\\\n", "\t이순신 & 90\\\\\n", "\t임꺽정 & 30\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A data.frame: 3 × 1\n", "\n", "| | kor <dbl> |\n", "|---|---|\n", "| 홍길동 | 80 |\n", "| 이순신 | 90 |\n", "| 임꺽정 | 30 |\n", "\n" ], "text/plain": [ " kor\n", "홍길동 80 \n", "이순신 90 \n", "임꺽정 30 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df['kor']" ] }, { "cell_type": "code", "execution_count": 7, "id": "0d9a0606", "metadata": {}, "outputs": [ { "data": { "text/html": [ "200" ], "text/latex": [ "200" ], "text/markdown": [ "200" ], "text/plain": [ "[1] 200" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sum( df['kor'] )" ] }, { "cell_type": "code", "execution_count": 9, "id": "756cc4ca", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
홍길동
200
이순신
210
임꺽정
100
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[홍길동] 200\n", "\\item[이순신] 210\n", "\\item[임꺽정] 100\n", "\\end{description*}\n" ], "text/markdown": [ "홍길동\n", ": 200이순신\n", ": 210임꺽정\n", ": 100\n", "\n" ], "text/plain": [ "홍길동 이순신 임꺽정 \n", " 200 210 100 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "rowSums( df )" ] }, { "cell_type": "code", "execution_count": 10, "id": "148f4162", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
kor
200
eng
200
math
110
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[kor] 200\n", "\\item[eng] 200\n", "\\item[math] 110\n", "\\end{description*}\n" ], "text/markdown": [ "kor\n", ": 200eng\n", ": 200math\n", ": 110\n", "\n" ], "text/plain": [ " kor eng math \n", " 200 200 110 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "colSums(df)" ] }, { "cell_type": "code", "execution_count": 13, "id": "91fa115e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "kor: 200" ], "text/latex": [ "\\textbf{kor:} 200" ], "text/markdown": [ "**kor:** 200" ], "text/plain": [ "kor \n", "200 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "colSums(df)['kor']" ] }, { "cell_type": "code", "execution_count": 18, "id": "6db19b9a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
  1. 10
  2. 20
  3. 30
\n" ], "text/latex": [ "\\begin{enumerate*}\n", "\\item 10\n", "\\item 20\n", "\\item 30\n", "\\end{enumerate*}\n" ], "text/markdown": [ "1. 10\n", "2. 20\n", "3. 30\n", "\n", "\n" ], "text/plain": [ "[1] 10 20 30" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "10" ], "text/latex": [ "10" ], "text/markdown": [ "10" ], "text/plain": [ "[1] 10" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "v = c(10,20,30)\n", "v\n", "v[1]" ] }, { "cell_type": "code", "execution_count": 20, "id": "592fa2d9", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
aa
10
bb
20
cc
30
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[aa] 10\n", "\\item[bb] 20\n", "\\item[cc] 30\n", "\\end{description*}\n" ], "text/markdown": [ "aa\n", ": 10bb\n", ": 20cc\n", ": 30\n", "\n" ], "text/plain": [ "aa bb cc \n", "10 20 30 " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "aa: 10" ], "text/latex": [ "\\textbf{aa:} 10" ], "text/markdown": [ "**aa:** 10" ], "text/plain": [ "aa \n", "10 " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "aa: 10" ], "text/latex": [ "\\textbf{aa:} 10" ], "text/markdown": [ "**aa:** 10" ], "text/plain": [ "aa \n", "10 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "my1 = c(aa=10,bb=20,cc=30)\n", "my1\n", "my1['aa']\n", "my1[1]" ] }, { "cell_type": "code", "execution_count": 21, "id": "7b69e3ce", "metadata": {}, "outputs": [], "source": [ "?apply" ] }, { "cell_type": "code", "execution_count": 24, "id": "8cd7c0f0", "metadata": {}, "outputs": [], "source": [ "fn = function(v)\n", "{\n", " cat(v,fill=T)\n", " cat('===========',fill=T)\n", " return( sum(v) )\n", "}" ] }, { "cell_type": "code", "execution_count": 23, "id": "60fd12ba", "metadata": { "collapsed": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "80 70 50\n", "===========\n", "90 80 40\n", "===========\n", "30 50 20\n", "===========\n" ] }, { "data": { "text/html": [ "
홍길동
200
이순신
210
임꺽정
100
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[홍길동] 200\n", "\\item[이순신] 210\n", "\\item[임꺽정] 100\n", "\\end{description*}\n" ], "text/markdown": [ "홍길동\n", ": 200이순신\n", ": 210임꺽정\n", ": 100\n", "\n" ], "text/plain": [ "홍길동 이순신 임꺽정 \n", " 200 210 100 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "apply( df, 1, fn)" ] }, { "cell_type": "code", "execution_count": 25, "id": "acf47d2d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
홍길동
200
이순신
210
임꺽정
100
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[홍길동] 200\n", "\\item[이순신] 210\n", "\\item[임꺽정] 100\n", "\\end{description*}\n" ], "text/markdown": [ "홍길동\n", ": 200이순신\n", ": 210임꺽정\n", ": 100\n", "\n" ], "text/plain": [ "홍길동 이순신 임꺽정 \n", " 200 210 100 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "apply( df, 1, function(v) sum(v) ) #행별" ] }, { "cell_type": "code", "execution_count": 26, "id": "9a66581c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
kor
200
eng
200
math
110
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[kor] 200\n", "\\item[eng] 200\n", "\\item[math] 110\n", "\\end{description*}\n" ], "text/markdown": [ "kor\n", ": 200eng\n", ": 200math\n", ": 110\n", "\n" ], "text/plain": [ " kor eng math \n", " 200 200 110 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "apply( df, 2, function(v) sum(v) ) #컬럼별" ] }, { "cell_type": "code", "execution_count": 27, "id": "d1e04aec", "metadata": {}, "outputs": [ { "data": { "text/html": [ "510" ], "text/latex": [ "510" ], "text/markdown": [ "510" ], "text/plain": [ "[1] 510" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sum( df )" ] }, { "cell_type": "code", "execution_count": 29, "id": "6fc0150d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "56.6666666666667" ], "text/latex": [ "56.6666666666667" ], "text/markdown": [ "56.6666666666667" ], "text/plain": [ "[1] 56.66667" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#mean( df )\n", "mean( as.matrix(df) )" ] }, { "cell_type": "code", "execution_count": 30, "id": "ad08bb1c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
kor
66.6666666666667
eng
66.6666666666667
math
36.6666666666667
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[kor] 66.6666666666667\n", "\\item[eng] 66.6666666666667\n", "\\item[math] 36.6666666666667\n", "\\end{description*}\n" ], "text/markdown": [ "kor\n", ": 66.6666666666667eng\n", ": 66.6666666666667math\n", ": 36.6666666666667\n", "\n" ], "text/plain": [ " kor eng math \n", "66.66667 66.66667 36.66667 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "colMeans( df )" ] }, { "cell_type": "code", "execution_count": 31, "id": "44c5e570", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
홍길동
66.6666666666667
이순신
70
임꺽정
33.3333333333333
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[홍길동] 66.6666666666667\n", "\\item[이순신] 70\n", "\\item[임꺽정] 33.3333333333333\n", "\\end{description*}\n" ], "text/markdown": [ "홍길동\n", ": 66.6666666666667이순신\n", ": 70임꺽정\n", ": 33.3333333333333\n", "\n" ], "text/plain": [ " 홍길동 이순신 임꺽정 \n", "66.66667 70.00000 33.33333 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "rowMeans(df)" ] }, { "cell_type": "code", "execution_count": 32, "id": "9446f4d9", "metadata": {}, "outputs": [ { "data": { "text/html": [ "90" ], "text/latex": [ "90" ], "text/markdown": [ "90" ], "text/plain": [ "[1] 90" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "max(df)" ] }, { "cell_type": "code", "execution_count": 34, "id": "d90ca054", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
홍길동
80
이순신
90
임꺽정
50
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[홍길동] 80\n", "\\item[이순신] 90\n", "\\item[임꺽정] 50\n", "\\end{description*}\n" ], "text/markdown": [ "홍길동\n", ": 80이순신\n", ": 90임꺽정\n", ": 50\n", "\n" ], "text/plain": [ "홍길동 이순신 임꺽정 \n", " 80 90 50 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# apply( df, 1, function(v) max(v) )\n", "apply( df,1, max )" ] }, { "cell_type": "code", "execution_count": 35, "id": "2bf67112", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
kor
90
eng
80
math
50
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[kor] 90\n", "\\item[eng] 80\n", "\\item[math] 50\n", "\\end{description*}\n" ], "text/markdown": [ "kor\n", ": 90eng\n", ": 80math\n", ": 50\n", "\n" ], "text/plain": [ " kor eng math \n", " 90 80 50 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "apply( df,2, max )" ] }, { "cell_type": "code", "execution_count": 37, "id": "24a35c3e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "50" ], "text/latex": [ "50" ], "text/markdown": [ "50" ], "text/plain": [ "[1] 50" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "median( as.matrix(df) )" ] }, { "cell_type": "code", "execution_count": 38, "id": "b4414bce", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
홍길동
70
이순신
80
임꺽정
30
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[홍길동] 70\n", "\\item[이순신] 80\n", "\\item[임꺽정] 30\n", "\\end{description*}\n" ], "text/markdown": [ "홍길동\n", ": 70이순신\n", ": 80임꺽정\n", ": 30\n", "\n" ], "text/plain": [ "홍길동 이순신 임꺽정 \n", " 70 80 30 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "apply( df, 1, median)" ] }, { "cell_type": "code", "execution_count": 39, "id": "c1c10cf3", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
25%
40
50%
50
75%
80
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[25\\textbackslash{}\\%] 40\n", "\\item[50\\textbackslash{}\\%] 50\n", "\\item[75\\textbackslash{}\\%] 80\n", "\\end{description*}\n" ], "text/markdown": [ "25%\n", ": 4050%\n", ": 5075%\n", ": 80\n", "\n" ], "text/plain": [ "25% 50% 75% \n", " 40 50 80 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "quantile( as.matrix(df), c(0.25,0.5,0.75))" ] }, { "cell_type": "code", "execution_count": 41, "id": "e8b30a73", "metadata": {}, "outputs": [ { "data": { "text/html": [ "24.4948974278318" ], "text/latex": [ "24.4948974278318" ], "text/markdown": [ "24.4948974278318" ], "text/plain": [ "[1] 24.4949" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sd( as.matrix(df) )" ] }, { "cell_type": "code", "execution_count": 43, "id": "ed630317", "metadata": {}, "outputs": [], "source": [ "?apply" ] }, { "cell_type": "code", "execution_count": 42, "id": "8a5e7b9b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
kor
32.1455025366432
eng
15.2752523165195
math
15.2752523165195
\n" ], "text/latex": [ "\\begin{description*}\n", "\\item[kor] 32.1455025366432\n", "\\item[eng] 15.2752523165195\n", "\\item[math] 15.2752523165195\n", "\\end{description*}\n" ], "text/markdown": [ "kor\n", ": 32.1455025366432eng\n", ": 15.2752523165195math\n", ": 15.2752523165195\n", "\n" ], "text/plain": [ " kor eng math \n", "32.14550 15.27525 15.27525 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "apply( df , 2, sd )" ] }, { "cell_type": "code", "execution_count": 44, "id": "e540ceb0", "metadata": { "collapsed": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\n", "Attaching package: 'dplyr'\n", "\n", "\n", "The following objects are masked from 'package:stats':\n", "\n", " filter, lag\n", "\n", "\n", "The following objects are masked from 'package:base':\n", "\n", " intersect, setdiff, setequal, union\n", "\n", "\n" ] } ], "source": [ "# install.packages('dplyr')\n", "library(dplyr)" ] }, { "cell_type": "code", "execution_count": 45, "id": "367b9307", "metadata": { "collapsed": true }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\n", "
A data.frame: 2 × 3
korengmath
<dbl><dbl><dbl>
홍길동807050
이순신908040
\n" ], "text/latex": [ "A data.frame: 2 × 3\n", "\\begin{tabular}{r|lll}\n", " & kor & eng & math\\\\\n", " & & & \\\\\n", "\\hline\n", "\t홍길동 & 80 & 70 & 50\\\\\n", "\t이순신 & 90 & 80 & 40\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A data.frame: 2 × 3\n", "\n", "| | kor <dbl> | eng <dbl> | math <dbl> |\n", "|---|---|---|---|\n", "| 홍길동 | 80 | 70 | 50 |\n", "| 이순신 | 90 | 80 | 40 |\n", "\n" ], "text/plain": [ " kor eng math\n", "홍길동 80 70 50 \n", "이순신 90 80 40 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "top_n( df, 2, wt=eng)" ] }, { "cell_type": "code", "execution_count": 46, "id": "2a04129f", "metadata": { "collapsed": true }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\n", "
A data.frame: 2 × 3
korengmath
<dbl><dbl><dbl>
홍길동807050
임꺽정305020
\n" ], "text/latex": [ "A data.frame: 2 × 3\n", "\\begin{tabular}{r|lll}\n", " & kor & eng & math\\\\\n", " & & & \\\\\n", "\\hline\n", "\t홍길동 & 80 & 70 & 50\\\\\n", "\t임꺽정 & 30 & 50 & 20\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A data.frame: 2 × 3\n", "\n", "| | kor <dbl> | eng <dbl> | math <dbl> |\n", "|---|---|---|---|\n", "| 홍길동 | 80 | 70 | 50 |\n", "| 임꺽정 | 30 | 50 | 20 |\n", "\n" ], "text/plain": [ " kor eng math\n", "홍길동 80 70 50 \n", "임꺽정 30 50 20 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "top_n( df, -2, wt=eng)" ] }, { "cell_type": "code", "execution_count": 48, "id": "4ef22112", "metadata": { "collapsed": true }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\n", "
A data.frame: 2 × 3
korengmath
<dbl><dbl><dbl>
홍길동807050
이순신908040
\n" ], "text/latex": [ "A data.frame: 2 × 3\n", "\\begin{tabular}{r|lll}\n", " & kor & eng & math\\\\\n", " & & & \\\\\n", "\\hline\n", "\t홍길동 & 80 & 70 & 50\\\\\n", "\t이순신 & 90 & 80 & 40\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A data.frame: 2 × 3\n", "\n", "| | kor <dbl> | eng <dbl> | math <dbl> |\n", "|---|---|---|---|\n", "| 홍길동 | 80 | 70 | 50 |\n", "| 이순신 | 90 | 80 | 40 |\n", "\n" ], "text/plain": [ " kor eng math\n", "홍길동 80 70 50 \n", "이순신 90 80 40 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "head(df,2)" ] }, { "cell_type": "code", "execution_count": 49, "id": "ddcbcdd5", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\n", "
A data.frame: 2 × 3
korengmath
<dbl><dbl><dbl>
이순신908040
임꺽정305020
\n" ], "text/latex": [ "A data.frame: 2 × 3\n", "\\begin{tabular}{r|lll}\n", " & kor & eng & math\\\\\n", " & & & \\\\\n", "\\hline\n", "\t이순신 & 90 & 80 & 40\\\\\n", "\t임꺽정 & 30 & 50 & 20\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A data.frame: 2 × 3\n", "\n", "| | kor <dbl> | eng <dbl> | math <dbl> |\n", "|---|---|---|---|\n", "| 이순신 | 90 | 80 | 40 |\n", "| 임꺽정 | 30 | 50 | 20 |\n", "\n" ], "text/plain": [ " kor eng math\n", "이순신 90 80 40 \n", "임꺽정 30 50 20 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "tail(df,2)" ] }, { "cell_type": "code", "execution_count": 2, "id": "14260726", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\n", "
A data.frame: 3 × 3
korengmath
<dbl><dbl><dbl>
홍길동807050
이순신908040
임꺽정305020
\n" ], "text/latex": [ "A data.frame: 3 × 3\n", "\\begin{tabular}{r|lll}\n", " & kor & eng & math\\\\\n", " & & & \\\\\n", "\\hline\n", "\t홍길동 & 80 & 70 & 50\\\\\n", "\t이순신 & 90 & 80 & 40\\\\\n", "\t임꺽정 & 30 & 50 & 20\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A data.frame: 3 × 3\n", "\n", "| | kor <dbl> | eng <dbl> | math <dbl> |\n", "|---|---|---|---|\n", "| 홍길동 | 80 | 70 | 50 |\n", "| 이순신 | 90 | 80 | 40 |\n", "| 임꺽정 | 30 | 50 | 20 |\n", "\n" ], "text/plain": [ " kor eng math\n", "홍길동 80 70 50 \n", "이순신 90 80 40 \n", "임꺽정 30 50 20 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df" ] } ], "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": "4.4.1" } }, "nbformat": 4, "nbformat_minor": 5 }