Welcome to this course on Redis tutorial for beginners. Redis is an open source, BSD licensed, advanced in-memory key-value store where keys can contain data structures such as strings,
hashes, lists, sets, and sorted sets. Redis Can be used as Database, a Caching layer or a Message broker.
Following in the footsteps of other NoSQL databases, such as Cassandra, CouchDB, and MongoDB, Redis allows the user to store vast amounts of data without the limits of a relational database.
Redis Tutorial Playlist
00:00:00 1 - Introduction
00:04:15 2 - How To Install Redis On Windows
00:18:56 3 - How To Install Redis On Ubuntu Linux
00:31:35 4 - How To Install Redis On Mac OS X
00:43:09 5 - Redis strings commands
00:51:42 6 - more commands (SETEX, SETNX, INCR, DECR, MSET…)
01:04:13 7 - Redis Hashes
01:18:37 8 - Redis Lists
01:35:24 9 - Redis Sets
01:48:28 10 - Redis Sorted Sets
02:00:58 11 - Redis Publish Subscribe
A famous general is thought to have said, “A good sketch is better than a long speech.” That advice may have come from the battlefield, but it’s applicable in lots of other areas — including data science. “Sketching” out our data by visualizing it using ggplot2 in R is more impactful than simply describing the trends we find.
This is why we visualize data. We visualize data because it’s easier to learn from something that we can see rather than read. And thankfully for data analysts and data scientists who use R, there’s a tidyverse package called ggplot2 that makes data visualization a snap!
In this blog post, we’ll learn how to take some data and produce a visualization using R. To work through it, it’s best if you already have an understanding of R programming syntax, but you don’t need to be an expert or have any prior experience working with ggplot2
#data science tutorials #beginner #ggplot2 #r #r tutorial #r tutorials #rstats #tutorial #tutorials
Our Redis™ customers who have Lua scripts deployed often report this error – “BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE”. In this post, we will explain the Redis transactional property of scripts, what this error is about, and why we must be extra careful about it on Sentinel-managed systems that can failover.
Redis “transactions” aren’t really transactions as understood conventionally – in case of errors, there is no rollback of writes made by the script.
“Atomicity” of Redis scripts is guaranteed in the following manner:
It is highly recommended that the script complete within a time limit. Redis enforces this in a weak manner with the ‘lua-time-limit’ value. This is the maximum allowed time (in ms) that the script is allowed to run. The default value is 5 seconds. This is a really long time for CPU-bound activity (scripts have limited access and can’t run commands that access the disk).
However, the script is not killed when it executes beyond this time. Redis starts accepting client commands again, but responds to them with a BUSY error.
If you must kill the script at this point, there are two options available:
It is usually better to just wait for the script to complete its operation. The complete information on methods to kill the script execution and related behavior are available in the documentation.
#cloud #database #developer #high availability #howto #redis #scalegrid #lua-time-limit #redis diagram #redis master #redis scripts #redis sentinel #redis servers #redis transactions #sentinel-managed #server failures
In this tutorial we’ll learn how to begin programming with R using RStudio. We’ll install R, and RStudio RStudio, an extremely popular development environment for R. We’ll learn the key RStudio features in order to start programming in R on our own.
If you already know how to use RStudio and want to learn some tips, tricks, and shortcuts, check out this Dataquest blog post.
[tidyverse](https://www.dataquest.io/blog/tutorial-getting-started-with-r-and-rstudio/#tve-jump-173bb264c2b)Packages into Memory
#data science tutorials #beginner #r tutorial #r tutorials #rstats #tutorial #tutorials
What exactly is clean data? Clean data is accurate, complete, and in a format that is ready to analyze. Characteristics of clean data include data that are:
Common symptoms of messy data include data that contain:
In this blog post, we will work with five property-sales datasets that are publicly available on the New York City Department of Finance Rolling Sales Data website. We encourage you to download the datasets and follow along! Each file contains one year of real estate sales data for one of New York City’s five boroughs. We will work with the following Microsoft Excel files:
As we work through this blog post, imagine that you are helping a friend launch their home-inspection business in New York City. You offer to help them by analyzing the data to better understand the real-estate market. But you realize that before you can analyze the data in R, you will need to diagnose and clean it first. And before you can diagnose the data, you will need to load it into R!
Benefits of using tidyverse tools are often evident in the data-loading process. In many cases, the tidyverse package
readxl will clean some data for you as Microsoft Excel data is loaded into R. If you are working with CSV data, the tidyverse
readr package function
read_csv() is the function to use (we’ll cover that later).
Let’s look at an example. Here’s how the Excel file for the Brooklyn borough looks:
The Brooklyn Excel file
Now let’s load the Brooklyn dataset into R from an Excel file. We’ll use the
readxlpackage. We specify the function argument
skip = 4 because the row that we want to use as the header (i.e. column names) is actually row 5. We can ignore the first four rows entirely and load the data into R beginning at row 5. Here’s the code:
library(readxl) # Load Excel files brooklyn <- read_excel("rollingsales_brooklyn.xls", skip = 4)
Note we saved this dataset with the variable name
brooklyn for future use.
The tidyverse offers a user-friendly way to view this data with the
glimpse() function that is part of the
tibble package. To use this package, we will need to load it for use in our current session. But rather than loading this package alone, we can load many of the tidyverse packages at one time. If you do not have the tidyverse collection of packages, install it on your machine using the following command in your R or R Studio session:
Once the package is installed, load it to memory:
tidyverse is loaded into memory, take a “glimpse” of the Brooklyn dataset:
glimpse(brooklyn) ## Observations: 20,185 ## Variables: 21 ## $ BOROUGH <chr> "3", "3", "3", "3", "3", "3", "… ## $ NEIGHBORHOOD <chr> "BATH BEACH", "BATH BEACH", "BA… ## $ `BUILDING CLASS CATEGORY` <chr> "01 ONE FAMILY DWELLINGS", "01 … ## $ `TAX CLASS AT PRESENT` <chr> "1", "1", "1", "1", "1", "1", "… ## $ BLOCK <dbl> 6359, 6360, 6364, 6367, 6371, 6… ## $ LOT <dbl> 70, 48, 74, 24, 19, 32, 65, 20,… ## $ `EASE-MENT` <lgl> NA, NA, NA, NA, NA, NA, NA, NA,… ## $ `BUILDING CLASS AT PRESENT` <chr> "S1", "A5", "A5", "A9", "A9", "… ## $ ADDRESS <chr> "8684 15TH AVENUE", "14 BAY 10T… ## $ `APARTMENT NUMBER` <chr> NA, NA, NA, NA, NA, NA, NA, NA,… ## $ `ZIP CODE` <dbl> 11228, 11228, 11214, 11214, 112… ## $ `RESIDENTIAL UNITS` <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1… ## $ `COMMERCIAL UNITS` <dbl> 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0… ## $ `TOTAL UNITS` <dbl> 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1… ## $ `LAND SQUARE FEET` <dbl> 1933, 2513, 2492, 1571, 2320, 3… ## $ `GROSS SQUARE FEET` <dbl> 4080, 1428, 972, 1456, 1566, 22… ## $ `YEAR BUILT` <dbl> 1930, 1930, 1950, 1935, 1930, 1… ## $ `TAX CLASS AT TIME OF SALE` <chr> "1", "1", "1", "1", "1", "1", "… ## $ `BUILDING CLASS AT TIME OF SALE` <chr> "S1", "A5", "A5", "A9", "A9", "… ## $ `SALE PRICE` <dbl> 1300000, 849000, 0, 830000, 0, … ## $ `SALE DATE` <dttm> 2020-04-28, 2020-03-18, 2019-0…
glimpse() function provides a user-friendly way to view the column names and data types for all columns, or variables, in the data frame. With this function, we are also able to view the first few observations in the data frame. This data frame has 20,185 observations, or property sales records. And there are 21 variables, or columns.
#data science tutorials #beginner #r #r tutorial #r tutorials #rstats #tidyverse #tutorial #tutorials
In this blog post, we’ll look at how to use R Markdown. By the end, you’ll have the skills you need to produce a document or presentation using R Mardown, from scratch!
We’ll show you how to convert the default R Markdown document into a useful reference guide of your own. We encourage you to follow along by building out your own R Markdown guide, but if you prefer to just read along, that works, too!
R Markdown is an open-source tool for producing reproducible reports in R. It enables you to keep all of your code, results, plots, and writing in one place. R Markdown is particularly useful when you are producing a document for an audience that is interested in the results from your analysis, but not your code.
R Markdown is powerful because it can be used for data analysis and data science, collaborating with others, and communicating results to decision makers. With R Markdown, you have the option to export your work to numerous formats including PDF, Microsoft Word, a slideshow, or an HTML document for use in a website.
Turn your data analysis into pretty documents with R Markdown.
We’ll use the RStudio integrated development environment (IDE) to produce our R Markdown reference guide. If you’d like to learn more about RStudio, check out our list of 23 awesome RStudio tips and tricks!
Here at Dataquest, we love using R Markdown for coding in R and authoring content. In fact, we wrote this blog post in R Markdown! Also, learners on the Dataquest platform use R Markdown for completing their R projects.
We included fully-reproducible code examples in this blog post. When you’ve mastered the content in this post, check out our other blog post on R Markdown tips, tricks, and shortcuts.
Okay, let’s get started with building our very own R Markdown reference document!
R Markdown is a free, open source tool that is installed like any other R package. Use the following command to install R Markdown:
Now that R Markdown is installed, open a new R Markdown file in RStudio by navigating to
File > New File > R Markdown…. R Markdown files have the file extension “.Rmd”.
When you open a new R Markdown file in RStudio, a pop-up window appears that prompts you to select output format to use for the document.
The default output format is HTML. With HTML, you can easily view it in a web browser.
We recommend selecting the default HTML setting for now — it can save you time! Why? Because compiling an HTML document is generally faster than generating a PDF or other format. When you near a finished product, you change the output to the format of your choosing and then make the final touches.
One final thing to note is that the title you give your document in the pop-up above is not the file name! Navigate to
File > Save As.. to name, and save, the document.
#data science tutorials #beginner #r #r markdown #r tutorial #r tutorials #rstats #rstudio #tutorial #tutorials