Atomic Vector - Prime Factorization - IT/Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task:

Part 1  Write a function called by_type() that takes an atomic vector as input and an optional argument ‘sort’ with default value FALSE. 
 The function looks at each element in the atomic vector and sees if it can coerce them into integers or floating-point values. The function outputs a list that has separated the values into a list with integers, doubles, and character values. If the optional argument sort is TRUE, then it will sort the results of each vector.  
 
For example, if x is the following vector,  x <- c("house", "6", "2.2", "a", "3.4", "1")  Then the output of by_type(x) will be a list:  $integers  [1] 6 1 1  $doubles  [1] 2.2 3.4  $character  [1] "house" "a"  
 If sort =TRUE then the output will sort each section and return:  by_type(x, sort = TRUE)  $integers  [1] 1 6  $doubles  [1] 2.2 3.4  $character  [1] "a" "house" If the vector contains logical TRUE/FALSE values, those should be put into the character section.

 
Part 2  Write a function named prime_factor(x) that will find the prime factorization of an integer x. The function will output a numeric vector. All of the values in the output vector will be prime. The product of the numeric vector will be the original value x. There should be a check to make sure that the input value is a number greater than 2 with no decimal values with appropriate error messages. 
 
Part 3  Write a function named month_convert(x, from_lang, to_lang) that will convert month names from one language to another. The function will accept three arguments: x, which is a factor with month information; the language from which we are translating from_lang; and the language to which we are translating to_lang.  A file called “month_names.txt” which has the month names in several European languages has attached together. Use month_names <- read.delim("month_names.txt", encoding="UTF-8", row.names=1) to import the file. 
For example:  x <- factor(c("March","March","February","June"))  month_convert(x, "English", "Spanish") will output:  [1] marzo marzo febrero junio  Levels: febrero junio marzo  
 If the input contains a value that is not a real month, then it will be replaced with NA.  x <- factor(c("March","March","February","June","Jaly"))  month_convert(x, "English", "Spanish") [1] marzo marzo febrero junio <NA> Levels: febrero junio marzo. 

This IT/Computer Science Assignment has been solved by our IT/Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

 

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.