0 votes
How to find nth maximum and nth smallest number in vector in r?
Aug 18, 2019 1,080 views

## 1 answer to this question.

0 votes
Hi,

You can use nth() function to find nth max or min element.

syntax nth(data,position)

Ex: nth(c(1:5),3) -> 3.

Or sort the elements in an ascending or descending order and then use sort() or order() to fetch the nth max/min element.
answered Aug 19, 2019 by anonymous
• 33,030 points

0 votes
1 answer

## Finding the nth highest value in a vector or a data-frame column

sort(x,T)[n] Here, 'x' is the data-frame/vector and 'n' ...READ MORE

+1 vote
2 answers

## How can I find number of rows in a dataframe, and how to find the number of rows that dont have null values

Use nrow() to find number of rows ...READ MORE

0 votes
1 answer

## Define a matrix, vector and determinent in rmarkdown html document

Hi Riya, I have given some examples below ...READ MORE

0 votes
1 answer

## Counting the number of elements with the values of x in a vector

You may simply use the table() method: > ...READ MORE

0 votes
1 answer

## By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

0 votes
1 answer

## How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

0 votes
1 answer

## In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

0 votes
1 answer

## How to create a list of Data frames?

Basically all we have to do is ...READ MORE

+1 vote
2 answers

## How to count the number of elements with the values in a vector?

Use dplyr function group_by(). > n = as.data.frame(num) > ...READ MORE

0 votes
1 answer

## What is the difference between list and vector in R?

The difference are - A list holds different ...READ MORE