What is a namespace in R?
MACHINE LEARNING RECIPES DATA CLEANING PYTHON DATA MUNGING PANDAS CHEATSHEET     ALL TAGS

What is a namespace in R?

What is a namespace in R?

This recipe explains what is a namespace in R

Recipe Objective

What is the namespace in R? When there are, two functions of some name available in two different libraries, identifying which function to use is difficult. Namespace functions are used for overcoming this problem where it provides additional information to differentiate between the same function names present in different libraries in R. In R, the namespace file works with 2 operators— - double colon (::) - triple colon (:::) The colon operators help to specify which package to use for defining a function. **Package:: function ()** This recipe demonstrates an example using namespace in R.

Step 1 - Load neceesary library

library() # lists all the packages available library(tidyverse)

Step 2 - Define a data frame

df <- data.frame(x=c(1,2,3,4), y= c("a","b","c","d")) x = c(1,2,3,4,5) y = c("a","b","c","d","e")

Step 3 - Use Hmisc and dplyr package

a <- Hmisc::summarize(x,y,sum) # using Hmisc print(a)
 "Output of code :" 
  y x
1 a 1
2 b 2
3 c 3
4 d 4
5 e 5
a <- dplyr::summarize(df,sum_value = sum(x)) # using dplyr print(a)
 "Output of code :" 
  sum_value
1        10

Relevant Projects

Predict Macro Economic Trends using Kaggle Financial Dataset
In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.

Predict Credit Default | Give Me Some Credit Kaggle
In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

Digit Recognition using CNN for MNIST Dataset in Python
In this deep learning project, you will build a convolutional neural network using MNIST dataset for handwritten digit recognition.

Inventory Demand Forecasting using Machine Learning in R
In this machine learning project, you will develop a machine learning model to accurately forecast inventory demand based on historical sales data.

Data Science Project - Instacart Market Basket Analysis
Data Science Project - Build a recommendation engine which will predict the products to be purchased by an Instacart consumer again.

Build an Image Classifier for Plant Species Identification
In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

Predict Churn for a Telecom company using Logistic Regression
Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

Build OCR from Scratch Python using YOLO and Tesseract
In this deep learning project, you will learn how to build your custom OCR (optical character recognition) from scratch by using Google Tesseract and YOLO to read the text from any images.

Time Series Python Project using Greykite and Neural Prophet
In this time series project, you will forecast Walmart sales over time using the powerful, fast, and flexible time series forecasting library Greykite that helps automate time series problems.

NLP and Deep Learning For Fake News Classification in Python
In this project you will use Python to implement various machine learning methods( RNN, LSTM, GRU) for fake news classification.