background preloader

R

Facebook Twitter

Gestion des fichiers et répertoires sous R. Relu par Claire Chabanet, le 15 octobre, 2013 Résumé Lorsque l'on travaille sous R, on a généralement besoin d'accéder à des informations contenues dans des fichiers.

Gestion des fichiers et répertoires sous R

C'est même souvent la première étape d'une analyse. Savoir naviguer dans l'arborescence des dossiers, indiquer correctement la localisation des fichiers pour ensuite pouvoir les lire ou les écrire est essentiel. R dispose donc de plusieurs fonctions qui vont permettre, sans quitter la session en cours, la gestion des chemins, des dossiers et des fichiers. Sommaire IntérêtVersions testéesGestion des cheminsGestion des répertoiresGestion des fichiers Intérêt Lorsque l'on travaille sous R, on a généralement besoin d'accéder à des informations.

Version utilisée R version 3.0.1 (2013-05-16) -- "Good Sport". La gestion des chemins L'utilisation d'un fichier ou d'un dossier passe par une étape de localisation indiquant où trouver le fichier ou le dossier.

Graphics

R Study Group. Hpc_parallel. A brief introduction to “apply” in R. At any R Q&A site, you’ll frequently see an exchange like this one: Q: How can I use a loop to [...insert task here...] ?

A brief introduction to “apply” in R

A: Don’t. Use one of the apply functions. So, what are these wondrous apply functions and how do they work? I think the best way to figure out anything in R is to learn by experimentation, using embarrassingly trivial data and functions. Let’s examine each of those. 1. applyDescription: “Returns a vector or array or list of values obtained by applying a function to margins of an array or matrix.” OK – we know about vectors/arrays and functions, but what are these “margins”? That last example was rather trivial; you could just as easily do “m[, 1:2]/2″ – but you get the idea. 2. by Updated 27/2/14: note that the original example in this section no longer works; use colMeans now instead of mean.Description: “Function ‘by’ is an object-oriented wrapper for ‘tapply’ applied to data frames.” The by function is a little more complex than that. Permutation Test. Data Description Hypertension Dataset (adopted from Statistical methods in genetic epidemiology) Systolic blood pressure was measured in 250 progeny from a backcross between two mouse strains.

For simplicity, we focus on 50 (randomly chosen) mice genotyped at the D4Mit214 marker (although more markers were genotyped). We want to detect association between the D4Mit214 marker genotype and blood pressure. The values on the left show the systolic blood pressure (in mm of Hg) by the marker genotype, BA (heterozygous) or BB (homozygous) arranged in increasing order. Permutation. Bootstrap Resampling. R Tutorial with Bayesian Statistics Using OpenBUGS. This text provides R tutorials on statistics including hypothesis testing, ANOVA and linear regressions.

R Tutorial with Bayesian Statistics Using OpenBUGS

It fulfills popular demands by users of r-tutor.com for exercise solutions and offline access. Part III of the text is about Bayesian statistics. It begins with closed analytic solutions and basic BUGS models for simple examples. Then it covers OpenBUGS for Bayesian ANOVA and regression analysis. Finally, it shows how to build more complex Bayesian models and demonstrates CODA for Markov Chain Monte Carlo (MCMC) convergence. The last part of this text discusses advanced GPU computing in R using the RPUDPLUS package. This eBook is published in Amazon Kindle format. R-tutorial-v2c-src-20140321.zip Order your copy at Amazon today! A brief introduction to “apply” in R.

Package_dev

Fitting & Interpreting Linear Models in R. R makes it easy to fit a linear model to your data.

Fitting & Interpreting Linear Models in R

The hard part is knowing whether the model you've built is worth keeping and, if so, figuring out what to do next. This is a post about linear models in R, how to interpret lm results, and common rules of thumb to help side-step the most common mistakes. Building a linear model in R R makes building linear models really easy. Things like dummy variables, categorical features, interactions, and multiple regression all come very naturally.

Lm comes with base R, so you don't have to install any packages or import anything special. Introduction to lm For our example linear model, I'm going to use data from the original, or at least one of the earliest, linear regression models. Fit the model to the data by creating a formula and passing it to the lm function. We then set the data being used to galton so lm knows what data frame to associate "child" and "parent" to. NOTE: Formulas in R take the form (y ~ x). Calling summary. Romain Francois, Professional R Enthusiast.