From f00b045471e6eb079fb7c7681687cd09a4cb8ab8 Mon Sep 17 00:00:00 2001 From: 364204affd8dd7e07e30248eb3c751a8 <364204affd8dd7e07e30248eb3c751a8@app-learninglab.inria.fr> Date: Wed, 25 Oct 2023 14:08:08 +0000 Subject: [PATCH] setup Jupyter for Python but with R analysis --- module2/exo4/Untitled.ipynb | 6 ++++ module2/exo4/Untitled1.ipynb | 6 ++++ module2/exo4/Untitled2.ipynb | 6 ++++ module2/exo4/exercice.ipynb | 61 ++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 module2/exo4/Untitled.ipynb create mode 100644 module2/exo4/Untitled1.ipynb create mode 100644 module2/exo4/Untitled2.ipynb diff --git a/module2/exo4/Untitled.ipynb b/module2/exo4/Untitled.ipynb new file mode 100644 index 0000000..7fec515 --- /dev/null +++ b/module2/exo4/Untitled.ipynb @@ -0,0 +1,6 @@ +{ + "cells": [], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/module2/exo4/Untitled1.ipynb b/module2/exo4/Untitled1.ipynb new file mode 100644 index 0000000..7fec515 --- /dev/null +++ b/module2/exo4/Untitled1.ipynb @@ -0,0 +1,6 @@ +{ + "cells": [], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/module2/exo4/Untitled2.ipynb b/module2/exo4/Untitled2.ipynb new file mode 100644 index 0000000..7fec515 --- /dev/null +++ b/module2/exo4/Untitled2.ipynb @@ -0,0 +1,6 @@ +{ + "cells": [], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/module2/exo4/exercice.ipynb b/module2/exo4/exercice.ipynb index fab4a73..30585a9 100644 --- a/module2/exo4/exercice.ipynb +++ b/module2/exo4/exercice.ipynb @@ -9,6 +9,67 @@ "I've tracked my sleep for a few days, about its quality and length, to have statistics and analyze this data." ] }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "%load_ext rpy2.ipython" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + " Date BeginningTime Length AwakeningReason\n", + " 2023-10-18:2 1:00:00 :1 1:42:00 :1 AlarmClock :3 \n", + " 2023-10-19:2 1:10:00 :1 17:10:00:1 AlarmMissed:1 \n", + " 2023-10-20:1 1:28:00 :1 5:02:00 :1 Natural :1 \n", + " 16:15:00:1 6:20:00 :1 \n", + " 18:45:00:1 8:00:00 :1 \n", + " Feeling \n", + " NotVeryRested:1 \n", + " QuiteRested :1 \n", + " Rested :3 \n", + " \n", + " \n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "%%R\n", + "data = read.csv('data.csv') # Read data\n", + "summary(data)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1] NA\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "%%R\n", + "mean(data$Length)" + ] + }, { "cell_type": "code", "execution_count": null, -- 2.18.1