Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
141 views
in Computer by (44.9k points)
closed by

Code examples with R-Studio.

1 Answer

+1 vote
by (45.2k points)
selected by
 
Best answer

Using R Studio, we can also calculate the:

Mean of a data set.

Calculating Mean in R

For calculating mean in R, we use the mean() function.

The syntax for calculating mean in R is:

mean(x, trim = 0, na.rm = FALSE, ...)

Description of the parameters used:

x is the input vector.

trim is used to drop some observations from both end of the sorted vector.

na.rm is used to remove the missing values from the input vector.

Median of a data set.

Calculating Median in R

For calculating median in R, we use the median() function.

The syntax for calculating mean in R is:

median(x, na.rm = FALSE)

Description of the parameters used:

x is the input vector.

na.rm is used to remove the missing values from the input vector.

Mode of a data set.

Calculating Mode in R

A mode is defined as the value with the highest frequency of occurrences in a set of data. The mode can be determined both for numeric and character data.

For calculating the mode, we do not have any inbuilt function in R. Here; we create a user-defined function to get the mode of a data set.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Nov 14, 2023 in Computer by AshaUsapkar (44.9k points)
0 votes
1 answer
asked Nov 14, 2023 in Computer by AshaUsapkar (44.9k points)
0 votes
1 answer
asked Nov 14, 2023 in Computer by AshaUsapkar (44.9k points)

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...