length(x) will give how many elements are there in a vector. nchar(x) will give how many letters in each element of x. Examples:

## Posts Tagged ‘R Programming’

## Installation of r package dplyr

dplyr is R package for data manipulation using the Split Apply Combine Methodology, the next iteration of the very popular plyr package. As per R documentation dplyr is “A Grammar of Data Manipulation”. It’s the next iteration of plyr, focused on tools for working with data frames > install.packages(“dplyr”) Installing package into ‘C:/Users/pinnapav/Documents/R/win-library/3.3’

## How to get first and last rows of Data Frame in R

We can get first n rows of Data Frame using head() function and can get last n rows of Data Frame using tail() function. Syntax of head() and tail() functions: head(data.frame,number_of_first_rows) tail(data.frame,number_of_last_rows)

## How to get list of User defined Variables in R

Variables are containers to for storing data in any programming language. We get the list of variables defined in R Programming Language using ls(), objects() functions. R Variables starting with dot(.) are hidden, they can be listed using ls(all:names=TRUE). Examples:

## R Installation on Windows

1. Goto cran(Comprehensive R Archive Network) website. R Software Link