-
Notifications
You must be signed in to change notification settings - Fork 0
/
R_code.Rmd
56 lines (41 loc) · 984 Bytes
/
R_code.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
title: "read_bed_bim_bed_format_R_code"
author: "Yue Gu"
date: "27/06/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
```{r}
# check the working directory
getwd()
```
```{r}
# the current version of R we are using
R.version
```
```{r}
#install.packages("genio")
```
```{r}
library(genio)
```
```{r}
# To clear the workspace environment
rm(list = ls())
```
[documentation](https://search.r-project.org/CRAN/refmans/genio/html/read_plink.html)
```{r}
bim <- read_bim('C:\\Users\\ygu34\\Desktop\\Research Data Steward\\Temporary_datashare\\Sanchez_Molano_Enrique\\Lop_genotypes')
View(bim)
```
```{r}
fam <- read_fam('C:\\Users\\ygu34\\Desktop\\Research Data Steward\\Temporary_datashare\\Sanchez_Molano_Enrique\\Lop_genotypes.fam')
View(fam)
```
```{r}
bed <- read_plink('C:\\Users\\ygu34\\Desktop\\Research Data Steward\\Temporary_datashare\\Sanchez_Molano_Enrique\\Lop_genotypes.bed')
View(bed)
```