Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

RStudio question O .O . Go to file/function . Addins - Environ Glol Homework01.Rmd makeWordFigures.Rx recover SampleInfo.R * >> - H ARQ Knit - -

RStudio question

image text in transcribedimage text in transcribed

O .O . Go to file/function . Addins - Environ Glol Homework01.Rmd makeWordFigures.Rx recover SampleInfo.R * >> - H ARQ Knit - - Insert B - Run. 37 - # Problem 1: Byte the decimal 38 39>write a function that will convert a vector of booleans to a (decimal) numeric. 40 > 41 >The first bit will be true if the number is positive and false otherwise. The next eight bits (1 byte) will correspond to the binary representation of the number. The final eight bits will represent the 10's expodential. For example c(TRUE, rep(FALSE, times=7), TRUE, rep (FALSE, times=8)) would correspond to +1E0 or 1. Note that this is how all real numbers in a computer are actually represented (only your computer generally uses 16-bits not 8-bit). Files Ney O> 42 43 >The function must be named "byte_to_decimal and accept a vector of logical values of length 17 as an argument. It should throw a warning if a vector of 1 and o are passed to it, it should error out if nonvalid arguments are passed to the function. Problem 1: Byte the decimal : R Markdown 000000 44:179 Console - OR H B O Go to file/function 16 - Addins - Homework 1.Rmd @makeWordFigures.Rx recoverSampleInfo.R* >> ABCQ Knit - in C Insert - Run- 44 >*Do not use built in functions, I'm looking for the underlaying arithmatic. You may find useful: stop, ifelse, multiplication, expodentials, sum and other arithmatic functions." 45 46 47 *'{r problemlCode, echo=FALSE, comment=''} > cat(readLines ('R/byte_to_decimal.R'), sep = ' ') > 48 49 50 - {r probleml, results='hold'} 51 resultstr > - H ARQ Knit - - Insert B - Run. 37 - # Problem 1: Byte the decimal 38 39>write a function that will convert a vector of booleans to a (decimal) numeric. 40 > 41 >The first bit will be true if the number is positive and false otherwise. The next eight bits (1 byte) will correspond to the binary representation of the number. The final eight bits will represent the 10's expodential. For example c(TRUE, rep(FALSE, times=7), TRUE, rep (FALSE, times=8)) would correspond to +1E0 or 1. Note that this is how all real numbers in a computer are actually represented (only your computer generally uses 16-bits not 8-bit). Files Ney O> 42 43 >The function must be named "byte_to_decimal and accept a vector of logical values of length 17 as an argument. It should throw a warning if a vector of 1 and o are passed to it, it should error out if nonvalid arguments are passed to the function. Problem 1: Byte the decimal : R Markdown 000000 44:179 Console - OR H B O Go to file/function 16 - Addins - Homework 1.Rmd @makeWordFigures.Rx recoverSampleInfo.R* >> ABCQ Knit - in C Insert - Run- 44 >*Do not use built in functions, I'm looking for the underlaying arithmatic. You may find useful: stop, ifelse, multiplication, expodentials, sum and other arithmatic functions." 45 46 47 *'{r problemlCode, echo=FALSE, comment=''} > cat(readLines ('R/byte_to_decimal.R'), sep = ' ') > 48 49 50 - {r probleml, results='hold'} 51 resultstr

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions