-
with within and transform in R I found…
Krosno with, within, and transform in R. I found that they are useful to deal with data set. I don’t quite understand the explanation in the help page and I can’t not guarantee the correctness of my explanation so I provide some examples to show their behavior. Fist of all, they need data frame or list…
-
Reverse search in RStudio Type part of a…
rencontre femme francaise musulmane Reverse search in RStudio Type part of a command and Ctrl-Up arrow will show the previous commands history.
-
Use t using apply to apply a non…
Use t() using apply() to apply a non-aggregate function on a matrix row wise because column wise is the default order of matrix in R. Example. I’d like to reverse the order of elements in each row. > test.m test.m [,1] [,2] [,3] [,4] [,5] [1,] 1 5 9 13 17 [2,] 2 6 10…
-
Remove NA from data in R A
Remove NA from data in R A
-
Difference using names or entries in a column…
Difference using names or entries in a column selecting elements from data frame. Use names to select elements from data frame, if possible. When using the names, the slicing index does not need to the the same length as the data, but if one of the column is used, the index and the data should…
-
Different behaviors between data frame and matrix in…
Different behaviors between data frame and matrix in R > # Generate an artificial matrix > test.m row.names(test.m) col.names(test.m) # Generate a data frame from the matrix > test.df > > # Selecting elements > ## the row names can be used to select elemnts from a data frame or a matrix > test.idx test.df[test.idx,…
-
Using smooth spline in stat scale in ggplot2…
Using smooth.spline in stat_scale in ggplot2 smooth.spline2
-
LOESS Fit a polynomial regression fitting
LOESS: Fit a polynomial regression fitting
-
How to install R packages from the source…
How to install R packages from the source install.packages(file_name_and_path, repos = NULL, type=”source”)
-
Fitting distribution in R Use fitdistr in MASS…
Fitting distribution in R Use fitdistr in MASS package Example; fitdistr(as.vector(res.score.m), densefun = ‘normal’) mean sd -8.0647926561 2.9550064789 ( 0.0005642286) ( 0.0003989698) http://www.statmethods.net/advgraphs/probability.html