Google RLint: Reformatting R Code to Follow the Google St Manuel d'utilisateur

Naviguer en ligne ou télécharger Manuel d'utilisateur pour Logiciel Google RLint: Reformatting R Code to Follow the Google St. Google RLint: Reformatting R Code to Follow the Google Style Guide User Manual [en] Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 19
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 0
RLint: Reformatting R
Code to Follow the
Google Style Guide
Alex Blocker, Andy Chen ([email protected]),
Andy Chu, Tim Hesterberg, Jeffrey D. Oldham, Caitlin
Sadowski, Tom Zhang
2014-07-02
Vue de la page 0
1 2 3 4 5 6 ... 18 19

Résumé du contenu

Page 1 - Google Style Guide

RLint: Reformatting R Code to Follow the Google Style GuideAlex Blocker, Andy Chen ([email protected]), Andy Chu, Tim Hesterberg, Jeffrey D. Oldham, C

Page 2

Google Confidential and ProprietaryEx: IndentationCodeif (x == 5)while (x > 1) # R-bleed bug? ;) x <- x - 1 print(x)Corrected codeif (x =

Page 3

Google Confidential and ProprietaryEx: Ease checking program correctnessCodex <- -5:-1x[x <-2]Is anything wrong?

Page 4 - Googler

Google Confidential and ProprietaryEx: Ease checking program correctnessCodex <- -5:-1x[x <-2] # Hmm ...WarningMust have whitespace around &

Page 5

Google Confidential and ProprietaryEx: Ease checking program correctnessCodeif (format(Sys.time(), "%Y") == "2014") { print(paste

Page 6

Google Confidential and ProprietaryEx: Ease checking program correctnessCodeif (format(Sys.time(), "%Y") == "2014") { print(paste

Page 7

Google Confidential and ProprietaryRLint implementation uses PythonUse Python string functions and regular expressions.Algorithm:Stub out comments, st

Page 8 - Ex: Spacing

Google Confidential and ProprietaryApplication: Improve R community's style consistencyProposal: Adopt R style guide + RLint.● Run experiments to

Page 9

Google Confidential and ProprietarySummaryRLint checks and reformats R code to follow R style guide.RLint used within Google● Eases checking correctne

Page 10 - Ex: Indentation

RLint: Reformatting R Code to Follow the Google Style GuideAlex Blocker, Andy Chen ([email protected]), Andy Chu, Tim Hesterberg, Jeffrey D. Oldham, C

Page 11 - Is anything wrong?

Google Confidential and ProprietaryCoding conventions and checkersCoding conventions have existed for decades.● 1918: The Elements of Style by Strunk

Page 12

Google Confidential and ProprietarySummaryRLint checks and reformats R code to follow R style guide.RLint used within Google.● Eases checking correctn

Page 13

Google Confidential and ProprietaryStyle guides improve correctness and productivityQ: How do we produce correct R code when● correctness is hard to c

Page 14

Google Confidential and ProprietaryMany R files modified by multiple users~50% directories contain code written by >1 Googler.~40% files modified b

Page 15 - Algorithm:

Google Confidential and ProprietaryStyle guides improve correctness and productivityQ: How do we produce correct R code when● correctness is hard to c

Page 16

Google Confidential and ProprietaryStyle guides specify program structureGoogle R style guide specifies● identifier naming: variable.name, FunctionNam

Page 17

Google Confidential and ProprietaryRLint: Automate style checking and correctionGoal: Minimize overhead of following style guide.RLint: Program warnin

Page 18

Google Confidential and ProprietaryEx: SpacingCode: foo <-function(x){ return (list ( a = sum(x[,1]), b = 1/3+1e-7*(x[1,1])) …Warni

Page 19 - (70% adoption in 2013)

Google Confidential and ProprietaryEx: IndentationCodeif (x == 5)while (x > 1) x <- x - 1 print(x)Is anything wrong?

Commentaires sur ces manuels

Pas de commentaire