Once you have the the responses collected, the next process is coding the response. In this step, you replace the text strings to numeric numbers so that data analysis software can process it.

Select the column to restrict the Find and Replace function

When you use the replace feature, ensure that you select the column by clicking on the column heading. It ensures that changes will be restricted to that particular column. You can also select multiple columns.

Start with compound words and move to simple words

If you want to code Male as 0 and Female as 1, replace Female first. If you try to replace Male with 0 first, all occurrences of Male will be replaced with…


Sourse: https://campus.datacamp.com/

Checking the dimensions of your data

The function dim() can be used to know how many cases and variables there are in the data set.

Example

#Use the dim() function on mtcarsdim(mtcars)

The first value returned by dim() is the number of cases (rows) and the second value is the number of variables (columns).

Data Structure


Source: https://campus.datacamp.com/

Selection by comparison

Select values in numeric_vector that are larger than 10. Assign the result to the variable larger_than_ten

# A numeric vector containing 3 elementsnumeric_vector <- c(1, 10, 49)larger_than_ten <- numeric_vector > 10print(larger_than_ten)

Print the selected elements

numeric_vector <- c(1, 10, 49)larger_than_ten <- numeric_vector > 10numeric_vector[larger_than_ten]

Matrices

In R, a matrix is a collection of elements of the same data type (numeric, character, or logical) arranged into a fixed number of rows and columns.

You can construct a matrix in R with the matrix() function. …


Here is a list of some of the most useful Chrome extensions.

1. Link to Text Fragment

Highlight text on a web page and share it.

This extension allows for easily creating a special link to the currently selected text on a page via the context menu. When opening such a special link, a compatible browser will scroll the selected text into view and highlight it.

Link: https://chrome.google.com/webstore/detail/link-to-text-fragment/pbcodcjpfjdpcineamnnmbkkmkdpajjg

2. INSSIST | Web Client for Instagram

Use Instagram on computers.

Upload images and videos

Post photos, videos, stories to Instagram from Web. Download posts and followers plus scheduling, insights and analytics IG tools.

Social media

Link: https://chrome.google.com/webstore/detail/inssist-web-client-for-in/bcocdbombenodlegijagbhdjbifpiijp

3. Fready

Make web page more readable

Remove…


// Remove jQuery
function vpsb_remove_jquery() {
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', false);
}
}
add_action('init', 'vpsb_remove_jquery');
//Remove JQuery migrate
function remove_jquery_migrate($scripts)
{
if (!is_admin() && isset($scripts->registered['jquery'])) {
$script = $scripts->registered['jquery'];

if ($script->deps) { // Check whether the script has any dependencies
$script->deps = array_diff($script->deps, array(
'jquery-migrate'
));
}
}
}
add_action('wp_default_scripts', 'remove_jquery_migrate');// add async and defer attributes to enqueued scripts function ciencia_script_loader_tag($tag, $handle, $src) { if ($handle === 'my-plugin-javascript-handle') { if (false === stripos($tag, 'defer')) { $tag = str_replace('<script ', '<script defer ', $tag); } } return $tag; } add_filter('script_loader_tag', 'ciencia_script_loader_tag', 10, 3)…

1. Trim Words

wp_trim_words() allows to display only a particular number of words from the content.

Example

wp_trim_words(get_the_content(), 20);

This functions is helpful to display the first 18 words of main content in WordPress loop.


Simple scroll animation with GSAP and Scroll Trigger

Part 1

CDN Links

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/ScrollTrigger.min.js"></script>

Add simple GSAP animation to the element first

gsap.to(".square", {
x: 700,
duration: 3
})

Add scroll trigger for animation

First register ScrollTrigger plugin at the top of the gsap animation code.

gsap.registerPlugin(ScrollTrigger);

Then modify the gsap animation code

gsap.to(".square", {
x: 700,
duration: 3,
scrollTrigger: ".square",
// the animation will be triggered when .square element comes to the viewport
// any element can be used as scroll trigger for animating an element})

Part 2: Start and end

By default, the scroll trigger happen when the trigger element enters to the viewport. …


Different ways to implement smooth scrolling effect on a web page.

Smooth scrolling with CSS only

html {
scroll-behavior: smooth;
}

The above css rule will create a smooth scrolling effect when navigating to different section using anchor tag and ID attribute.

Smooth scrolling with Javascript (Vanilla JS)

// Scroll to specific values 
// scrollTo is the same
window.scroll({
top: 2500,
left: 0,
behavior: 'smooth'
});

// Scroll certain amounts from current position
window.scrollBy({
top: 100, // could be negative value
left: 0,
behavior: 'smooth'
});
// Scroll to a certain element document.querySelector('.hello').scrollIntoView({
behavior: 'smooth'
});

Smooth scrolling with Locomotive and Locomotive

GSAP is a popular animation library used to add cool animation effect on web pages.

GSAP Core and Scroll Trigger CDN


Goals of Social Media Marketing

Goal 1 — Increase Brand Awareness

The average person spends nearly 6 hours on social media every day, and therefore social media is one of the best places to grab consumers’ attention.

Goal 2 — Boost Brand Engagement

Goal 3 — Generate New Leads

For businesses with a long sales process, social media can be a great tool for getting people to the top of your funnel.

Lead is a person who has provided your company with some form of information about themselves such as their name, email address, and similar.

Goal 4 — Listen to your brand community

Goal 5 — Provide Social Customer Service

People turn to social media for customer support. So, there is a huge opportunity for businesses to differentiate themselves from their…


How to customize the default query on the archive page for a event custom post?

Change the order of custom posts on the event archive page

Add the following code snippet on the functions.php file

function adjust_queries($query) {
if (!is_admin() AND is_post_type_archive('event') AND $query->is_main_query()) {
$query->set('meta_key', 'event_date');
$query->set('orderby', 'meta_value_num');
$query->set('order', 'ASC');
$query->set('meta_query', array(
array(
'key' => 'event_date',
'compare' => '>=',
'value' => new Date('Ymd'),
'type' => 'numeric'
)
))
}
}
add_action('pre_get_posts', 'adjust_queries');

Show only past events

Create a new custom query

$pastEvents = new WP_Query(array( 'post_type' => 'event' 'meta-key'=> 'event_date' 'orderby' => 'meta_value_num', 'order' => 'ASC', 'meta_query => array( array( 'key' => 'event_date', 'compare' => '<', 'value' => new Date('Ymd'), 'type' => numeric )…

Hashim Puthiyakath

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store