2 views

Uploaded by planetpb

Basic 35 Points in R to start working with data. These does not necessarily explain the command but explains the theme behind it.

save

- Some Elementary Algebraic Considerations Inspired by Smarandache Type Functions (II)
- C Lab Programs
- Some Stationary Sequences
- algebra-i-curriculum-map
- M138A6
- 01 notes
- MATH2061 PRACTICE SESSION 1
- Om Session 09
- S. Gill Williamson- Lattice Multiverse Models
- SSC CGL Test Paper
- 2 Simple Operations and Properties of Sequence
- inoi2016-qpaper
- control system labs all
- Trends Relationships - Done on 19 Oct 2017
- Nagarro 1.txt
- jlhhValue Based Questions Class-12
- Outline
- Print Able
- USAMTSProblems_20_4
- 4 1 Arrays
- vibration
- NLHeatTransfer
- m40_s12_lecture3
- Theorem Sheet
- Matlab Data Book
- 2-D Codes With & Without the Chip-Sync
- 173 Funtions of Excel
- 10.1.1.28.1963
- Tutorial 1 - Arithmetic and Geometric Sequences
- Lect-12-R.pptx
- Test to Identify Outliers in Data Series
- Paper on forecasting using ARCH
- Data Download From Bhavcopy in R
- Beat Market
- WONDERS OF THIRUPATHI
- List of Bad Loan Accounts
- Brahma Sutra
- In Woods of God Realization 3 - 1913 Edn
- In Woods of God ion - Swami Rama Tirtha Volume 2
- In Woods of God Realization - Swami Rama Tirtha - Volume 1
- ADF
- Research on CDS and Equity
- Thirukkural With Meaning

You are on page 1of 2

denote integer 2 3) Inf is infinity 4) NAN is undefined value (0/0) 5) General functions are called attributes () which allows to set or modify attributes for R objects 6) We can use print(x) or just type x to get the values printed 7) <- assignment operator 8) # comments 9) : denotes sequence for eg: x <- 1:20 implies x is a sequence of 1 to 20 10) C fn is like concatenation used to create vector objects for eg: x<- c(0.5,0.6), <- c(T,F), <- c(“a”, “b”, “c”) etc 11) Vector function should have same objects as class for eg x<- vector (“numeric”, length =10) will print 10 0’z; 12) We can convert using ‘as’ function for eg: x <- 0:6; >class(x) will print integer; > as.numeric(x); as.logical(x) will convert to T, F; as.character(x) will print this as character; as.complex(x) will print as 0+0i, 1+0i etc 13) Matrix can be created by 3 ways a) m<- matrix (1:6, nrow =2, ncol =3) or <- matrix (1:6, 2,3) or m<- 1:6, dim(m) <- c(2,5) where dim indicates dimension function 14) Cbind, rbind binds rows & col of diff matrix 15) List is similar to vector but can have objects of different class for eg: > x<- list (1, “a”, T, 1+4i) now >x will print [[1]] [1] 1, [[2]] [1] a, [[3]] [1] T etc 16) We can also name a list objects like x <- list (a=2, b=3, c=4) will result in printing x as $a 2, $b 3, $c 4 17) Factors: Special type of lists (used to indicate with names and used for sorting counting, grouping etc) 18) Ctrl+l for clearing screen 19) For eg: x<- factor(c(“Y”, “N”, “Y”, “N”, “Y”)) then X will print as Y, N, Y, N, Y and will Indicate Levels: N, Y 20) Table(x) will give frequency N: 2, Y: 3 21) Unclass(x) will indicate how R takes for eg: 2,1,2,1,2 where 1 rep N, 2 rep Y 22) Levels are labeled on alphabetical order so if we want exclusive order then we must declare say x<- factor(c(“Y”, “N”, “Y”, “N”, “Y”), levels = c(“Y”, “N”)) 23) Missing Values: is.na() & is.NaN() returns logic however is.Na can be int NA, Char NA etc 24) Data Frames: Unlike a matrix can have any class, gen to store tabular data, have special attributes row.names, Can be created by read.table() or read.csv(); Can be converted to matrix by data.matrix() 25) Names: R Objects can have names for reference, as said x<- list( a=1, b=2, c=3) or x<- 1:3, name(x) <-c(“a”, “b”, “c”); 26) Naming row & colomn of matrix: m<- matrix (1:4, 2,2); dimnames(m) <- list(c(“a”, “b”), c(“c”, “d”)) will return m as a, b row names & c, d as colomn names with 1,2,3,4 as elements

$ to extract element using name 28) Subsetting a matrix.3. NA”. exact = F++ will return 1. we can use x**“aa”. Now when we assume variable to an object in the list then only use [[ as $ will take the variable name literally for eg: name <.4 & $baz Hello.2.is.2. x*good+ will give 1 2 4 5 & Y[good} will give a b d f 34) For true matrix multiplication we should use a %*% b where a & b are matrix. 3).”f”). 4. > x[1.5). .6) if we use x[1] it will return a list 1. drop = F] 29) Subsetting a List: x<.list( foo = 1:4. “b”.4 then we should use x[[1]] or x$a or x**“a”++ 30) Creating multiple events: x <.list(aardvark =1:5.2. “d”. x[[name]] will return 1 2 3 4 whereas x$name will return NULL & x$foo will return 1. [[. b = 0.5 32) To remove missing values x<.2. if we do not use % then it will do element multiplication . for eg if its vector it returns a vector. x<.3)] will result in $foo 1.3.2.4 31) Partial Matching: x<.5 & x$an will return 3 to 10 whereas x$a & x[[aa]]will return NULL . baz =”hello”).NA.27) Subsets: [.y).] will give 1 3 5( not a matrix format but as vector as object so in order to get in matrix format as 1 row 3 colomn. > x[1.matrix (1:6. $.4. bar =0.2.3.4 but if we need the exact object 1. > bad <.NA. then > good = complete. andy = 3:10) then if we search x$aa will return 1. whereas [[ extracts list or data frame. abby = 2:7.3. NA. 2. if we use [ we return same object as class.c(1.2.cases(x.4.6.3. if it’s a list it returns a list. x[c(1.list (a = 1:4.cases(x) say for eg: x is same as above & y<c(“a”.3. x[bad!] will return 1 2 4 5 33) For multiple entries missing values use complete.foo.na(x).

- Some Elementary Algebraic Considerations Inspired by Smarandache Type Functions (II)Uploaded byMia Amalia
- C Lab ProgramsUploaded byRutvik Sheth
- Some Stationary SequencesUploaded byscience2010
- algebra-i-curriculum-mapUploaded byapi-291483144
- M138A6Uploaded byKEN
- 01 notesUploaded byRudin
- MATH2061 PRACTICE SESSION 1Uploaded byddddddda
- Om Session 09Uploaded bySanyam Jain
- S. Gill Williamson- Lattice Multiverse ModelsUploaded byDex30KM
- SSC CGL Test PaperUploaded byrabi00331278
- 2 Simple Operations and Properties of SequenceUploaded bysivatejamundlamuri
- inoi2016-qpaperUploaded byNavneel singhal
- control system labs allUploaded byM Xubair Yousaf Xai
- Trends Relationships - Done on 19 Oct 2017Uploaded byprasadkvss
- Nagarro 1.txtUploaded byAbhinav Nigam
- jlhhValue Based Questions Class-12Uploaded byjitender8
- OutlineUploaded bydesi_paris
- Print AbleUploaded byCristian Horea
- USAMTSProblems_20_4Uploaded byArsy
- 4 1 ArraysUploaded bygdskumar
- vibrationUploaded byscribactive2010
- NLHeatTransferUploaded bygopalpaul
- m40_s12_lecture3Uploaded byammar_harb
- Theorem SheetUploaded byEdric Lu
- Matlab Data BookUploaded byvasisiva
- 2-D Codes With & Without the Chip-SyncUploaded byYongzhen Chen
- 173 Funtions of ExcelUploaded bycangbeotam
- 10.1.1.28.1963Uploaded byVigneshRamakrishnan
- Tutorial 1 - Arithmetic and Geometric SequencesUploaded bytommy
- Lect-12-R.pptxUploaded byinfiniti786

- Test to Identify Outliers in Data SeriesUploaded byplanetpb
- Paper on forecasting using ARCHUploaded byplanetpb
- Data Download From Bhavcopy in RUploaded byplanetpb
- Beat MarketUploaded byplanetpb
- WONDERS OF THIRUPATHIUploaded byplanetpb
- List of Bad Loan AccountsUploaded byplanetpb
- Brahma SutraUploaded byplanetpb
- In Woods of God Realization 3 - 1913 EdnUploaded byplanetpb
- In Woods of God ion - Swami Rama Tirtha Volume 2Uploaded byplanetpb
- In Woods of God Realization - Swami Rama Tirtha - Volume 1Uploaded byplanetpb
- ADFUploaded byplanetpb
- Research on CDS and EquityUploaded byplanetpb
- Thirukkural With MeaningUploaded byplanetpb