menu

Data Types and Variables in R

Data Types and Variables in R - Important Points


16. Which of the following functions is used to convert a character variable to a numeric variable in R?

A. as.numeric()

B. as.character()

C. as.logical()

D. as.factor()

Discuss Work Space

Answer: option a

Explanation:

The as.numeric() function is used to convert a character variable to a numeric variable in R.

17. Which of the following functions is used to convert a numeric variable to a character variable in R?

A. as.numeric()

B. as.character()

C. as.logical()

D. as.factor()

Discuss Work Space

Answer: option b

Explanation:

The as.character() function is used to convert a numeric variable to a character variable in R.

18. Which of the following functions is used to sort a vector in ascending order in R?

A. sort()

B. order()

C. rank()

D. aggregate()

Discuss Work Space

Answer: option a

Explanation:

The sort() function is used to sort a vector in ascending order in R.

19. Which of the following functions is used to remove missing values from a vector in R?

A. na.omit()

B. complete.cases()

C. is.na()

D. drop_na()

Discuss Work Space

Answer: option a

Explanation:

The na.omit() function is used to remove missing values from a vector in R.

20. Which of the following functions is used to merge two data frames in R based on a common column?

A. merge()

B. cbind()

C. rbind()

D. bind_rows()

Discuss Work Space

Answer: option a

Explanation:

The merge() function is used to merge two data frames in R based on a common column.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now