R lang : handy table functions

[ad_1]

All begins with the info.

Learn CSV file

mydata = learn.csv("~/Downloads/gross sales.csv")

And if will output it, very most likely it’ll seem like an enormous mess
Screenshot 2020-03-24 at 12.59.24.png

Making desk fairly

There are few solution to make desk fairly

  1. Use dplyr library
set up.packages("dplyr")
library(dplyr)
  1. Convert dataframe to fairly dplyr dataframe
mydata = as_tibble(mydata)

Now mydata will look extra structured, like this
Screenshot 2020-03-24 at 13.21.37.png

BUT we will see solely first N rows. Which isn’t comfy

OUTPUT all rows

print(tbl_df(mydata), n=500)
#n - variety of rows

However nonetheless we won’t see all fields. SO we will make one other factor

DT bundle

It is a cool library which make comfy desk view

set up.packages("DT")
library(DT)

datatable(mydata)

Now it’ll look fairly cool. So you’ll be able to see all fields and paginate.
Screenshot 2020-03-24 at 13.32.54.png

[ad_2]

Source link

Write a comment