README.md 5.7 KB
Newer Older
Gael  MILLOT's avatar
Gael MILLOT committed
1
2
#### DESCRIPTION

Gael  MILLOT's avatar
Gael MILLOT committed
3
Cute Little R Functions contains 21 functions for R/RStudio that facilitate basic procedures in 1) object analysis, 2) object modification, 3) graphic handling and 4) log file management.
Gael  MILLOT's avatar
Gael MILLOT committed
4

Gael  MILLOT's avatar
Gael MILLOT committed
5
The function names are:
Gael  MILLOT's avatar
Gael MILLOT committed
6

Gael  MILLOT's avatar
Gael MILLOT committed
7
8
9
10
fun_param_check()	Check the class, type, mode and length, prop, neg values, na.contains, etc., of an object
fun_object_info()	provide a full description of the object
fun_1D_comp()	compare two 1D datasets (vector of factor or 1D table) of the same class or not
fun_2D_comp()	compare two 2D datasets of the same class or not
Gael  MILLOT's avatar
Gael MILLOT committed
11
12
fun_2D_head()	display the left/right head of 2D objects
fun_2D_tail()	display the left/right tail of 2D objects
Gael  MILLOT's avatar
Gael MILLOT committed
13
14
15
16
17
18
fun_list_comp()	compare two lists
fun_dataframe_remodeling()	remodel data frames
fun_refactorization()	refactorize a factor or the factor columns of a data frame, such as only the class present are in the levels (no empty levels). The class order in levels is kept
fun_rounding()	round a vector of values, if decimal, with the desired number of decimal digits after the decimal leading zeros
fun_90clock_matrix_rot()	90° clockwise matrix rotation
fun_hexa_hsv_color_matrix()	convert a matrix made of numbers into a hexadecimal matrix for rgb colorization
Gael  MILLOT's avatar
Gael MILLOT committed
19
fun_by_case_matrix_op()	assemble several matrices of same dimensions by performing by case operation
Gael  MILLOT's avatar
Gael MILLOT committed
20
fun_mat_inv()	return the inverse of a square matrix when solve() cannot
Gael  MILLOT's avatar
Gael MILLOT committed
21
22
23
24
25
26
27
fun_window_width_resizing()	rescale the width of a window to open depending on the number of classes to plot
fun_open_window()	open a pdf or screen (GUI) graphic window
fun_graph_param_prior_plot()	very convenient to erase the axes for post plot axis redrawing using fun_feature_post_plot()
fun_feature_post_plot()	redesign axis and provide convenients coordinates for adding elements on the drawn graph
fun_close_specif_window()	close only specific graphic windows (devices)
fun_var_trim_display()	trim and display values from a numeric vector or matrix
fun_export_data()	log file function: print a character string or a data object into a same output file
Gael  MILLOT's avatar
Gael MILLOT committed
28
29


Gael  MILLOT's avatar
Gael MILLOT committed
30
31
32
33
34
35
36
37
38
39
40
41
#### LICENCE

This package of scripts can be redistributed and/or modified under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details at https://www.gnu.org/licenses.


#### CREDITS

Gael A. Millot, Hub-C3BI, Institut Pasteur, USR 3756 IP CNRS, Paris, France


Gael  MILLOT's avatar
Gael MILLOT committed
42
43
#### HOW TO USE IT

Gael  MILLOT's avatar
Gael MILLOT committed
44
45
Download the desired Tagged version, never the current master.

Gael  MILLOT's avatar
Gael MILLOT committed
46
Source the cute_little_R_functions.R into R/RStudio to have the functions available in the working environment.
Gael  MILLOT's avatar
Gael MILLOT committed
47

Gael  MILLOT's avatar
Gael MILLOT committed
48
Description of the functions is at the beginning of the function body. To obtain it:
Gael  MILLOT's avatar
Gael MILLOT committed
49

Gael  MILLOT's avatar
Gael MILLOT committed
50
	Either read the cute_little_functions.docx (or open the cute_little_R_functions.R file).
Gael  MILLOT's avatar
Gael MILLOT committed
51
	
Gael  MILLOT's avatar
Gael MILLOT committed
52
	Or in the R/RStudio console, type the name of the function without brackets. Example : fun_object_info.
Gael  MILLOT's avatar
Gael MILLOT committed
53
54


Gael  MILLOT's avatar
Gael MILLOT committed
55
#### FILE DESCRIPTIONS
Gael  MILLOT's avatar
Gael MILLOT committed
56

Gael  MILLOT's avatar
Gael MILLOT committed
57
58
cute_little_R_functions.R	file that has to be sourced
cute_little_R_functions.docx	just for easier code reading
Gael  MILLOT's avatar
Gael MILLOT committed
59
examples_alone.txt	compile all the examples of each of the 17 functions into a single file
Gael  MILLOT's avatar
Gael MILLOT committed
60
61
62
63


#### WEB LOCATION

Gael  MILLOT's avatar
Gael MILLOT committed
64
Check for updated versions (most recent tags) at https://gitlab.pasteur.fr/gmillot/cute_little_functions/tags
Gael  MILLOT's avatar
Gael MILLOT committed
65
66


Gael  MILLOT's avatar
Gael MILLOT committed
67
#### WHAT'S NEW IN
Gael  MILLOT's avatar
Gael MILLOT committed
68

Gael  MILLOT's avatar
Gael MILLOT committed
69
70
71
72
73
74
75
## v5.0.0

1) fun_2D_head() function added
2) fun_2D_tail() function added
3) argument "noquote" added in fun_export_data()


Gael  MILLOT's avatar
Gael MILLOT committed
76
77
78
79
80
## v4.9.0

1) fun_mat_inv() function added


Gael  MILLOT's avatar
Gael MILLOT committed
81
82
83
84
85
## v4.8.0

1) magnific argument removed in fun_feature_post_plot() because no need anymore


Gael  MILLOT's avatar
Gael MILLOT committed
86
87
88
89
90
## v4.7.0

1) check of numeric arguments: class = "numeric" -> mode = "numeric" to allow for integers values in these arguments


Gael  MILLOT's avatar
Gael MILLOT committed
91
92
93
94
95
## v4.6.0

1) fun_by_case_matrix_op() added


Gael  MILLOT's avatar
Gael MILLOT committed
96
97
98
99
100
101
102
## v4.5.0

1) fun_open_window() improved to deal with Linux systems

2) fun_graph_param_prior_plot() improved to deal with Linux systems


Gael  MILLOT's avatar
Gael MILLOT committed
103
104
105
106
107
## v4.4.0

1) fun_dataframe_remodeling() now add a ini_rowname column in the output data frame when it is coherent and when initial row names are available (not NULL)


Gael  MILLOT's avatar
Gael MILLOT committed
108
109
110
111
112
## v4.3.0

1) fun_object_info() now manages object class "ordered" "factor"


Gael  MILLOT's avatar
Gael MILLOT committed
113
114
115
116
117
## v4.2.0

1) bug in the fun_2D_comp() function fixed


Gael  MILLOT's avatar
Gael MILLOT committed
118
119
120
121
122
## v4.1.0

1) text.corner replaced by corner.text everywhere


Gael  MILLOT's avatar
Gael MILLOT committed
123
124
125
126
127
128
129
130
131
132
133
## v4.0.0

1) fun_var_trim_display() function added

2) fun_feature_post_plot() function now provides additional coordinates when there are margins between the figure region and the device region

3) fun_2D_comp() function now provide the common row and column names, and a bug fixed in the detection of identical row or column content

4) error messages now mention the function that generates this message 


Gael  MILLOT's avatar
Gael MILLOT committed
134
135
136
137
138
139
140
## v3.1.0

1) fun_export_data() function modified: argument data cannot be NULL

2) the debugging line containing r_debugging_tools-v1.2.R updated for the new position of this script


Gael  MILLOT's avatar
Gael MILLOT committed
141
142
## v3.0.0

Gael  MILLOT's avatar
Gael MILLOT committed
143
1) cute_little_functions.R renamed cute_little_R_functions.R
Gael  MILLOT's avatar
Gael MILLOT committed
144

Gael  MILLOT's avatar
Gael MILLOT committed
145
146
2) function fun_dataframe_flipping() has been renamed fun_dataframe_remodeling()

Gael  MILLOT's avatar
Gael MILLOT committed
147
3) more examples added, also draws added in the .docx file for fun_dataframe_remodeling()
Gael  MILLOT's avatar
Gael MILLOT committed
148
149


Gael  MILLOT's avatar
Gael MILLOT committed
150
151
152
153
154
## v2.0.1

1) functions that use other functions from this toolset now check if these required functions are indeed present in the R environment


Gael  MILLOT's avatar
Gael MILLOT committed
155
156
157
158
159
160
161
162
163
164
165
166
## v2.0.0

1) fun_feature_post_plot() function improved: Now independent magnification for x axis/labels and y axis/labels. BEWARE: argument names have been modified

2) Bug corrected in fun_graph_param_prior_plot() function

3) Bug corrected in fun_refactorization() function


## v1.3

1) fun_1D_comp() function improved: provide the common elements, common names and common levels if exist.
Gael  MILLOT's avatar
Gael MILLOT committed
167
168