GithubHelp home page GithubHelp logo

r-repos-org / ros-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avehtari/ros-examples

0.0 0.0 0.0 216.39 MB

Regression and other stories R examples

Home Page: https://avehtari.github.io/ROS-Examples/

R 92.38% PostScript 7.48% Stan 0.14%

ros-examples's Introduction

Regression and Other Stories - Data and code

Regression and Other Stories by Andrew Gelman, Jennifer Hill, and Aki Vehtari (2020)

Regression and Other Stories book home page

This git repository has data and code for the examples and exercises in the book. If you find any errors in code please make an issue or email [email protected].

Data as rosdata R package

For an easier use of data, there is an R package called rosdata. You can install it with a command

remotes::install_github("avehtari/ROS-Examples",subdir = "rpackage")

Then you can access data, for example, as

library(rosdata)
data(wells)
head(wells)

You can get the list of data sets with

?rosdata

Index and notebooks in html

For easier viewing the index and the notebooks in html are available at avehtari.github.io/ROS-Examples.

Running the notebooks and rprojroot

As there are many examples, to avoid need to switch the working directory the notebooks use rprojroot package to set the project root directory and then accessing the data files in relation to that. This means that the downloaded git repository directory can be placed anywhere you like and you can rename the ROS-Examples directory as you like. When running the code, it is sufficient that the working directory is any directory in the ROS-Examples (or renamed). Running

library("rprojroot")
root<-has_file(".ROS-Examples-root")$make_fix_file()

will find the file .ROS-Examples-root which is in the ROS-Examples directory, and will set the full path according to that. Then, for example,

wells <- read.csv(root("Arsenic/data","wells.csv"))

finds the wells.csv file, no matter where you have placed or renamed the ROS-Examples directory. When you switch to another example, there is no need to switch the working directory.

ros-examples's People

Contributors

avehtari avatar jgabry avatar jvehtari avatar canyon289 avatar wibeasley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.