R Programming
-
R Programming (8) - Continuous random variableR Programming 2020. 3. 28. 04:57
Continuous random variable Some of continuous random variables in R Some of the discrete distributions provided by R, together with the names of their parameter inputs. Distribution R name (dist) Paramter names Uniform unif min=0, max=1 Exponential exp rate=1 chi-square chisq df Gamma gamma shape, rate=1 Normal norm mean=0, sd=1 t t df Weibull weibull shape, scale=1 Uniform distribution If the p..
-
R Programming (7) - Discrete random variableR Programming 2020. 3. 28. 04:55
Discrete random variable Discrete random variable in R R has built-in functions for handling the most commonly encountered probability distributions. Let \(X\) be of type dist with parameters p1, p2, …, then ddist(x, p1, p2, ...) equals \(P(X=x)\) for \(X\) discrete, or the density of \(X\) at \(x\) for \(X\) continuous. pdist(q, p1, p2, ...) equals \(P(X \leq q)\) qdist(p, p1, p2, ...) equals t..
-
R Programming (6) - Numerical integrationR Programming 2020. 3. 28. 04:37
Numerical integration Numerical integration It is frequently necessary to compute If we know the antiderivative F, then However for many function f, we don’t know the closed form of antiderivative. We approximate the integral on the divided subinterval: Rectagular method Review the rectangular method rect
-
R Programming (5) - Sophisticated data structuresR Programming 2020. 3. 28. 04:35
Sophisticated data structures Sophisticated data structures R provides sophisticated structure for the storage and manipulation of data. simplify data representation, manipulation and analysis. dataframe is like a matrix, but extended to allow for different object models in different columns list is a general data structure that can house many kinds of R object. factor special variable that repr..
-
R Programming (4) - FunctionR Programming 2020. 3. 28. 04:31
Programming with functions Functions Functions are a fundamental building block of R. In R, the operations that do all the work are functions. A function is an object in R that takes some input objects (called arguments) and returns an ouput object. A function has a form: function_name
-
R Programming (3) - IOR Programming 2020. 3. 28. 02:52
Input and Output Text A string of characters is said to be of mode character. Character strings are denoted by either double quotes " " or single quotes ‘’. Strings can be arranged into vectors and matrices just like numbers. We can paste string using paste(..., sep). x
-
R Programming (2) - R basicR Programming 2020. 3. 28. 02:47
R Basic Programming Branching with if if ( logical_expression ) { expression_1 } if (logical_expression) { expression_1 } else { expression_2 } If logical_expression is TRUE then the first group of expression is executed and the second group of expression is not executed. Conversely if logical_expression is FALSE then only the second group expression is executed. If you type: if (logical_express..