Skip to content

Instantly share code, notes, and snippets.

@yutannihilation
Created April 3, 2017 00:37
Show Gist options
  • Select an option

  • Save yutannihilation/0108dbde9e7db99ca8f670586c083aa5 to your computer and use it in GitHub Desktop.

Select an option

Save yutannihilation/0108dbde9e7db99ca8f670586c083aa5 to your computer and use it in GitHub Desktop.
#Sample Dataframe
library(magrittr)
library(dplyr)

## 
## Attaching package: 'dplyr'

## The following objects are masked from 'package:stats':
## 
##     filter, lag

## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union

library(formattable)

sample = data.frame(
  beer_brewerId = c("8481", "8481", "8481"),
  rev_app = c("4","1", "2"),
  beer_name = c("John Harvards Simcoe IPA", "John Harvards Simcoe IPA", "John Harvards American Brown Ale"),
  review_taste =c("6", "7", "6"), stringsAsFactors = FALSE
)

glimpse(sample)

## Observations: 3
## Variables: 4
## $ beer_brewerId <chr> "8481", "8481", "8481"
## $ rev_app       <chr> "4", "1", "2"
## $ beer_name     <chr> "John Harvards Simcoe IPA", "John Harvards Simco...
## $ review_taste  <chr> "6", "7", "6"

formattable(sample, align ="c")
beer\_brewerId rev\_app beer\_name review\_taste
8481 4 John Harvards Simcoe IPA 6
8481 1 John Harvards Simcoe IPA 7
8481 2 John Harvards American Brown Ale 6
---
title: "Untitled"
output: md_document
---
```{r}
#Sample Dataframe
library(magrittr)
library(dplyr)
library(formattable)
sample = data.frame(
beer_brewerId = c("8481", "8481", "8481"),
rev_app = c("4","1", "2"),
beer_name = c("John Harvards Simcoe IPA", "John Harvards Simcoe IPA", "John Harvards American Brown Ale"),
review_taste =c("6", "7", "6"), stringsAsFactors = FALSE
)
glimpse(sample)
formattable(sample, align ="c")
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment