diff tracyWidom/error_tracyWidom.c /home/eric/perso/LEA/src/tracyWidom/error_tracyWidom.c
17a18
> #include <R.h>
29c30
<         printf("\n");
---
>         Rprintf("\n");
33c34
<                 printf("ERROR: no value for %s.\n\n", file);
---
>                 Rprintf("ERROR: no value for %s.\n\n", file);
36c37
<                 printf("ERROR: the following option is mandatory: %s.\n\n",
---
>                 Rprintf("ERROR: the following option is mandatory: %s.\n\n",
40c41
<                 printf
---
>                 Rprintf
44c45
<                 printf("ERROR: the command is not written correctly.\n\n");
---
>                 Rprintf("ERROR: the command is not written correctly.\n\n");
47c48
<                 printf("ERROR: %s.\n\n", file);
---
>                 Rprintf("ERROR: %s.\n\n", file);
50c51
<                 printf("ERROR: Internal error.\n");
---
>                 Rprintf("ERROR: Internal error.\n");
53,54c54,55
<         printf("\n");
<         exit(1);
---
>         Rprintf("\n");
>         error(NULL);
diff tracyWidom/print_tracyWidom.c /home/eric/perso/LEA/src/tracyWidom/print_tracyWidom.c
17a18
> #include <R.h>
27c28
<         printf("\nHELP: ./tracyWidom options \n\n"
---
>         Rprintf("\nHELP: ./tracyWidom options \n\n"
39c40
<         printf("summary of the options:\n\n"
---
>         Rprintf("summary of the options:\n\n"
diff tracyWidom/register_tracyWidom.c /home/eric/perso/LEA/src/tracyWidom/register_tracyWidom.c
17a18
> #include <R.h>
42c43
<                                 exit(1);
---
>                                 error(NULL);
80c81
<         free(tmp_file);
---
>         Free(tmp_file);
diff tracyWidom/tracyWidom.c /home/eric/perso/LEA/src/tracyWidom/tracyWidom.c
17a18
> #include <R.h>
45c46
<                 printf("Tracy-Widom: Error %s has more than one column\n",
---
>                 Rprintf("Tracy-Widom: Error %s has more than one column\n",
52c53
<         values = (double *)malloc(N * sizeof(double));
---
>         values = (double *)Calloc(N *  sizeof(double), double);
61,64c62,65
<         pvalues = (double *)malloc(N * sizeof(double));
<         twstat = (double *)malloc(N * sizeof(double));
<         effectn = (double *)malloc(N * sizeof(double));
<         percentage = (double *)malloc(N * sizeof(double));
---
>         pvalues = (double *)Calloc(N *  sizeof(double), double);
>         twstat = (double *)Calloc(N *  sizeof(double), double);
>         effectn = (double *)Calloc(N *  sizeof(double), double);
>         percentage = (double *)Calloc(N *  sizeof(double), double);
80,84c81,85
<         free(values);
<         free(pvalues);
<         free(twstat);
<         free(effectn);
<         free(percentage);
---
>         Free(values);
>         Free(pvalues);
>         Free(twstat);
>         Free(effectn);
>         Free(percentage);
207c208
<                 new = (double *)malloc(*M * sizeof(double));
---
>                 new = (double *)Calloc(*M *  sizeof(double), double);
212c213
<                 free(tmp);
---
>                 Free(tmp);
