Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MUST BE DONE IN R LANGUAGE! Fill blanks in the function my.fun() so that for a given list, the function returns all locations of each

MUST BE DONE IN R LANGUAGE!

Fill blanks in the function my.fun() so that for a given list, the function returns all locations of each element and sort the frequency of the elements in increasing order. Then apply my.fun() to a set of gender: F F M M M M I I F I F M I F M I I M I I F

Where F, M and I represent Female, Male and Infant respectively.

my.fun <- function(f){ y <- unlist(f) x <- ___________ for (i in 1:____){ g1 <- y[i]

x[[______]] <- c(x[[____]],i) } freq <- _________(x, length) z <- sort(________, decreasing = ____) lst <- list(x, z) ___________(lst) } gender <- list( F, ________________________________, F) __________(gender) #

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

Semantics Of A Networked World Semantics For Grid Databases First International Ifip Conference Icsnw 2004 Paris France June 2004 Revised Selected Papers Lncs 3226

Authors: Mokrane Bouzeghoub ,Carole Goble ,Vipul Kashyap ,Stefano Spaccapietra

2004 Edition

3540236090, 978-3540236092

More Books

Students also viewed these Databases questions

Question

Define the term Working Capital Gap.

Answered: 1 week ago