Question
The R code for the question 1-3 (all parts) is given below. Please follow the comments in the code for understanding. install.packages(compositions) library(compositions) # Part
The R code for the question 1-3 (all parts) is given below. Please follow the comments in the code for understanding.
install.packages("compositions") library(compositions) # Part 1) # Changing the given characters to binary equivalent # First characters needs to be converted to ASCII equivalent then to binary binary(utf8ToInt("A"),mb=7) binary(utf8ToInt("t"),mb=7) binary(utf8ToInt("17"),mb=7) binary(utf8ToInt("9"),mb=7) binary(utf8ToInt("&"),mb=7) # Part 2) # Converting the given binary number to decimal using function unbinary() unbinary("00010110") unbinary("00011101") unbinary("01011011") unbinary("01100101") unbinary("00001010") unbinary("01100100") # Part 3) # a) Converting to utf8 utf
Please write your code in R and submit your script and results for each of the following , Note , Use R language.
3:30 AM Please write your code in R and submit your script and results for each of the following. Note that R does not accept 0 as an index for a vector. So every vector starts with 1 . 4. Fill three variables x, y, and z with the results of 3 such that x gets the first 19, y gets the next 22, and z gets the last 23 bits. Initialize an integer vector k of length 128. r) # code goes here s. Find the majority value for sf9) ytI and all Ir) # code goes here 6. Write code for the following: if x steps then shift x to the right by 1 bit. Next assign the appropriate value to x[]. Do the same for y and z. r) # code goes here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started