Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please do the solution only with the R programming language. Solutions in other languages will not be accepted. Use your student id as a seed

Please do the solution only with the R programming language. Solutions in other languages will not be accepted.

image text in transcribed

Use your student id as a seed number. You should write set.seed(your student id) at the beginning of your code. 1. Write a function that finds a prime number(s) given a set of numbers. Your function also provides prime factors of non-prime numbers. The function you will write should return the prime number(s) given in this vector and the non-prime number(s) with their prime factors. For example you have a vector of numbers like (89, 107,597, 931, 1083). Your result will be Prime numbers : 89 107 Non-prime numbers : 597 [3 199] 931 [7 7 19] 1083 [3 19 19] 2. Write a function that finds the letter numbers of all words in a given text and sorts the text according to those numbers from words with few letters to words with many letters. Sort the words containing the same number of letters alphabetically. For having text, you may use Sentences in tidyverse. Select 5 or 6 sentences randomly from Sentences. For example, you have these sentences ## [1] "We find joy in the simplest things. He wrote down a long list of items. The hail pattered on the burnt brown grass. Screen the porch with woven straw mats. The theft of the pearl pin was kept secret. Sweet words work better than fierce." Your function should return the result like this ## [1] "a he in of of on we joy pin the the the the the the was down find hail kept list long mats than with work brown burnt grass items pearl porch straw sweet theft words woven wrote better fierce screen secret things pattered simplest

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago