Commit b0370084 authored by Clement MOLINA's avatar Clement MOLINA

creation fichier cours

parent 4e196e82
---
title: "Analyse de l'incidence du syndrome grippal"
author: "Clément MOLINA"
date: "2023-08-31"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
data_url = "https://www.sentiweb.fr/datasets/incidence-PAY-3.csv?v=4bf55"
```
```{r}
data = read.csv(data_url, skip = 1)
head(data)
```
```{r}
tail(data)
```
```{r}
lignes_na = apply(data, 1, function (x) any(is.na(x)))
data [lignes_na,]
```
```{r}
class(data$week)
```
```{r}
class(data$inc)
```
```{r}
data = read.csv(data_url, skip = 1,na.strings = "-")
```
```{r}
lignes_na = apply(data, 1, function (x) any(is.na(x)))
data [lignes_na,]
```
```{r}
library(parsedate)
```
```{r}
convert_date = function(date) {
ws = paste(date)
iso = paste0(substring(ws,1,4),"-W",substring(ws,5,6))
iso
parse_iso_8601(iso)
}
```
```{r}
data$date = sapply(data$week, FUN = convert_date)
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment