in Education by
Which of the following sort a dataframe by the order of the elements in B? (a) x[rev(order(x$B)),] (b) x[ordersort(x$B),] (c) x[order(x$B),] (d) x[rev(x$B),] The question was posed to me in a job interview. Question is from Commands topic in section Commands, Packages, Visualizing Data and Linear Regression of R Programming Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Correct option is (a) x[rev(order(x$B)),] To elaborate: x[rev(order(x$B)),] sort the dataframe in reverse order.

Related questions

0 votes
    In the base graphics system, which function is used to add elements to a plot? (a) Boxplot() (b) Text ... Debugging of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    If two vectors with different lengths perform some operation, the elements of the shorter vector will be used ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    Warnings are generated by the _________ function. (a) warning() (b) error() (c) run() (d) message() ... and Debugging of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    _____ package version is the sequence of atleast two integers separated by either. or -. (a) Java (b) C ... Regression of R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    In a simple linear regression model (One independent variable), If we change the input variable by 1 unit. How ... of R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    Which of the following language supports lexical scoping? (a) Perl (b) Python (c) Common Lisp (d) All ... Debugging of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    Which of the following is primary tool for debugging? (a) debug() (b) trace() (c) browser() (d) ... and Debugging of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Which of the following code create a n item vector of random normal deviates? (a) x1...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    which of the following statement chose those objects meeting a logical criterion? (a) sub(dataset,logical) (b) ... of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Which of the following code will drop the nth column? (a) new...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Which of the following code drop the ith and jth column? (a) new...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Which of the following tests each element of x for membership in y? (a) y%in%x (b) all(x) (c) ... Linear Regression of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Which of the following finds row sums for each level of a grouping variable? (a) as.numeric(x) (b) ... Regression of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Which of the following groups values of a variable into larger bins? (a) cut (b) col.max(x) (c) ... Linear Regression of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Which of the following finds the maximum value in the vector x, exclude missing values? (a) rm(x) (b) ... Regression of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
...