Question

CODE USING R.

CODE USING R.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
findMin <- function(x) {
  minX <- x[1] ## set target to first element of `x`
  for (i in (seq_along(x[-1]) + 1)) { ## i take values 2, 3, ..., length(x)
    if(x[i] < minX) ## do comparison with current target
      minX <- x[i]  ## if element i is smaller than target, update target
  }
  minX
}
Add a comment
Know the answer?
Add Answer to:
CODE USING R.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Solve using R and show R code Instruction: Please submit your R code along with a...

    Solve using R and show R code Instruction: Please submit your R code along with a brief write-up of the solutions. Some of the questions below can be answered with very little or no programming. However, write code that outputs the final answer and dos not ryuira uper calceulatioms. Q.N. 1) The mammals data set in the MASS package records brain size and body size of 62 different mammals a) Fit a regresion model to describe the relation between brain...

  • Need help with this in R please! Using your set code as in quiz 2.3, in...

    Need help with this in R please! Using your set code as in quiz 2.3, in R create data using the commands to create the vector "x": set code = 328 set.seed(set code) x=rnorm(50,3,1.5) Then find sample mean sample median sample 57th percentile (using weighted average approach) create histogram of your data

  • Data is being encoded using a certain line code with r=2 and a data rate of...

    Data is being encoded using a certain line code with r=2 and a data rate of 17Mbps. Assume the channel bandwidth is to be scaled by a factor of (1/4) and a different line code is to be used where the new r=3. What is the new data rate in Mbps? (Assume c=1/2)

  • Consider a message D 110100111011001110111. Calculate the CRC code R for that message using a generator-polynomial...

    Consider a message D 110100111011001110111. Calculate the CRC code R for that message using a generator-polynomial x4+x+1 (CRC-4-ITU) . Represent in binary code the message to be sent (D and R). Generate 2-bit burst error (erasure error) and show the checking procedure.

  • Using R code only 4. The Fibonacci numbers are the sequence of numbers defined by the...

    Using R code only 4. The Fibonacci numbers are the sequence of numbers defined by the linear recurrence equation Fn F-1 F-2 where F F2 1 and by convention Fo 0. For example, the first 8 Fibonacci numbers are 1, 1, 2, 3, 5, 8, 13, 21. (a) For a given n, compute the nth Fibonnaci number using a for loop (b) For a given n, compute the nth Fibonnaci number using a while loop Print the 15th Fibonacci number...

  • In R studio, state.name includes all states in US as pre-defineed variables. Using R code, remove...

    In R studio, state.name includes all states in US as pre-defineed variables. Using R code, remove space inside state names (i.e. South Carolina becomes SouthCarolina). After removing spaces, for the states with the largest numbers of letters, flip the state name and output the result.

  • ***This problem must be done using R so please provide the R code used to find...

    ***This problem must be done using R so please provide the R code used to find the solution. I have provided the data in fitbit.txt below the question. I will also give "thumbs-up for correct R code" Thanks in advance.*** Here is the rest of the data needed to solve the problem. Please solve using R. Thank you! charge3= c(5.66,4.67,5.99,4.54,4.51,5.26,4.59, 5.1,5.46,4.57,4.41,5.58,5.39,5,5.22, 4.5,4.69,5.38,4.6,4.93) charge4= c(6.05,5.67,7.71,6.46,5.4,5.12,5.76, 4.96,6.22,5.45,4.76,4.45,7.03,5.88, 6.71,6.04,6.32,6.43,5.66,5.94) Fitbit, the maker of popular wearable activity trackers, has recently come out with the...

  • ANSWER ALL OF THE QUESTIONS WITH R CODE (SHOW ALL THE STEPS FOR THE R CODE!)...

    ANSWER ALL OF THE QUESTIONS WITH R CODE (SHOW ALL THE STEPS FOR THE R CODE!) THANK YOU!! R problems For questions 1 and 2, load in and attach the Getting to Know You Survey for Spring 2018 using the following code: NoU <-read. csr(file = "http://users, stat . umn .edu/~kinne 174/Getting2NoUS 18 .csv", header = TRUE) attach(NoU) Assume that this survey is a random sample drawn from the population of interest which is all University of Minnesota students. 1....

  • ***Please solve the problem below using R, and provide the R code you used in order...

    ***Please solve the problem below using R, and provide the R code you used in order to do so*** The mean undergraduate cost for tuition, fees, room, and board for four-year institutions was $26,489 for the 2004-2005 academic year. Suppose that the standard deviation of the distribution was $3204 and that 36 four-year institutions are randomly selected. Find the probability that the sample mean cost for these 36 schools is a. Less than $25,000 b. Greater than $26,000 c. Between...

  • Using matlab wnite a MMATLAR CODE unction myq ra coain to generate R bit as gray...

    Using matlab wnite a MMATLAR CODE unction myq ra coain to generate R bit as gray cocding matrx

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT