0% found this document useful (0 votes)
29 views

Da

The document shows an R session where a user is exploring two CSV datasets. They import the datasets, check dimensions, calculate summary statistics like length, min, max, range, sum, median, variance and standard deviation on variables.

Uploaded by

shiva kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Da

The document shows an R session where a user is exploring two CSV datasets. They import the datasets, check dimensions, calculate summary statistics like length, min, max, range, sum, median, variance and standard deviation on variables.

Uploaded by

shiva kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

R version 4.3.

1 (2023-06-16 ucrt) -- "Beagle Scouts"


Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.


You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.


Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or


'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("psych")
WARNING: Rtools is required to build R packages but is not currently installed.
Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/PC/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.3/psych_2.3.9.zip'
Content type 'application/zip' length 3942427 bytes (3.8 MB)
downloaded 3.8 MB

package ‘psych’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in


C:\Users\PC\AppData\Local\Temp\Rtmp69PtCm\downloaded_packages
> read.csv("C:\\data analytics\\cs2m.csv") => cs2m
Error: '=>' is disabled; set '_R_USE_PIPEBIND_' envvar to a true value to enable it
(<input>:1:42)
> read.csv("C:\\data analytics\\cs2m.csv")
BP Chlstrl Age Prgnt AnxtyLH DrugR
1 100 150 20 0 0 0
2 120 160 16 0 0 0
3 110 150 18 0 0 0
4 100 175 25 0 0 0
5 95 250 36 0 0 0
6 110 200 56 0 1 0
7 120 180 59 0 1 0
8 150 175 45 0 1 0
9 160 185 40 0 1 0
10 125 195 20 1 0 0
11 135 190 18 1 0 0
12 165 200 25 1 0 0
13 145 175 30 1 0 0
14 120 180 28 1 0 0
15 100 180 21 1 0 0
16 100 160 19 1 0 1
17 95 250 18 1 0 1
18 120 200 30 1 0 1
19 125 240 29 1 0 1
20 130 172 30 1 0 1
21 120 130 35 1 1 1
22 120 140 38 1 1 1
23 125 160 32 1 1 1
24 115 185 40 1 1 1
25 150 195 65 0 1 1
26 130 175 72 0 1 1
27 170 200 56 0 1 1
28 145 210 58 0 1 1
29 180 200 81 0 1 1
30 140 190 73 0 1 1
> read.csv("C:\\data analytics\\cs2m.csv") -> cs2m
> dim(cs2m)
[1] 30 6
> read.csv("C:\\data analytics\\grades.csv") -> grades
> dim[grades]
Error in dim[grades] : object of type 'builtin' is not subsettable
> dim(grades)
[1] 105 22
> View(grades)
> length(cs2m$BP)
[1] 30
> length(grades$ethnicity)
[1] 105
> min(cs2m$BP)
[1] 95
> max(cs2m$BP)
[1] 180
> range\
Error: unexpected '\\' in "range\"
> range(cs2m$BP)
[1] 95 180
> sum(cs2m$BP)
[1] 3820
> median(cs2m$BP)
[1] 122.5
> var(cs2m$BP)
[1] 521.954
> sd9(cs2m$BP)
Error in sd9(cs2m$BP) : could not find function "sd9"
> sd(cs2m$BP)
[1] 22.84631

You might also like