[go: up one dir, main page]

0% found this document useful (0 votes)
36 views2 pages

FDA Lab-6 1. WAP in R To Print The Given Pattern and Take N From The User

This document contains 4 tasks related to data manipulation and analysis in R: 1. Write a program to print a given numeric pattern and take user input for n. 2. Write a program to calculate the sum of a series using a user-defined factorial function. 3. Convert a data frame to another format by creating age group categories. 4. Perform several operations on sample data frames - sort by age then gender, filter results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

FDA Lab-6 1. WAP in R To Print The Given Pattern and Take N From The User

This document contains 4 tasks related to data manipulation and analysis in R: 1. Write a program to print a given numeric pattern and take user input for n. 2. Write a program to calculate the sum of a series using a user-defined factorial function. 3. Convert a data frame to another format by creating age group categories. 4. Perform several operations on sample data frames - sort by age then gender, filter results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

FDA Lab-6

1. WAP in R to print the given pattern and take n from the user

1
2 * 3
4 * 5 * 6
7 * 8 * 9 * 10

2. WAP in R to find the sum ( ) of the series 1/1! + 2/2! + 3/3! + ..N/N!. Use method user
defined method for factorial ( ). (function calling with in function)

3. Convert the data frame1 to data frame2 as given format


Create groupings or categories for infant, children, young, adults and elderly as given below
0 to 2 = ‘Toddler/Baby’
3 to 17 = ‘Child’
19 to 40 = ‘Young’
41 to 65 = ‘Adult’
66 to 99=’Elderly’

4.Create a Data frame as given below as D1

i) Sort the data frame D1 in the ascending order by using order () based on the variable
age and save as D2.
ii) Create data frame D3 from D2 where age is below 50.
iii) Again sort D3 ascending order by using order () based on the variable Gender and
save as D4.
iv) Display only the female having MA degree from D4.

Index 1 2 3 4 5 6 7
Element 6 7 1 2 5 9 8
Sort-AO 1 2 5 6 7 8 9
Order 3 4 5 1 2 7 6

You might also like