Question

In: Computer Science

In R-Syntax, create a vector of 100 employees ("Employee 1", "Employee 2", ... "Employee 100") [Hint:...

In R-Syntax, create a vector of 100 employees ("Employee 1", "Employee 2", ... "Employee 100")

[Hint: use the `paste()` function and vector recycling to add a number to the word "Employee"] then create a vector of 100 random salaries for the year 2017

[Use the `runif()` function to pick random numbers between 40000 and 50000] and finally create a vector of 100 salary adjustments between -5000 and 10000 [use runif() to pick 100 random #'s in that range]

Solutions

Expert Solution

Employees=paste(c("Employee"),seq(1,100))


salaries=runif(100,4000,5000)


salaryAdjsustment=runif(100,-5000,10000)


Related Solutions

R Programming: create a vector for 1 to 31 and count the number of even and...
R Programming: create a vector for 1 to 31 and count the number of even and odds using ifelse()
Use R code Create a vector V with 8 elements (7,2,1,0,3,-1,-3,4): Transform that vector into a...
Use R code Create a vector V with 8 elements (7,2,1,0,3,-1,-3,4): Transform that vector into a rectangular matrix A of dimensions 4X2 (4- rows, 2-columns); Create a matrix transpose to the above matrix A. Call that matrix AT; Calculate matrix products: A*AT and AT*A. Present the results. What are the dimensions of those two product matrices; Square matrixes sometimes have an inverse matrix. Try calculating inverse matrices (or matrixes, if you prefer) of above matrices (matrixes) A*AT and AT*A; Extend...
In R syntax, I have created a vector called: “ all_numbers <- c(10:21, seq(21:30)) “ but...
In R syntax, I have created a vector called: “ all_numbers <- c(10:21, seq(21:30)) “ but how do i create a variable “eleventh” that contains 11th element in ‘all_numbers' and also create a vector ‘some_numbers’ that contains 2nd through the 5th elements of ‘all_numbers’ ?
Use R code to do the following!!!! 1. Create a vector v1 that will contain integers...
Use R code to do the following!!!! 1. Create a vector v1 that will contain integers from -30 to 60. 2. Copy v1 into a vector v2 and add names 'odd' or 'even' based on the value. 3. Copy v1 into a vector v3 and if the number can be divided by 3, replace it by 'NA'. 4. Assign the mean of v3 to v4 ignoring the 'NA'.
can a vector with dimensions R^N and a vector with dimensions R^N+1 be a matrix? and...
can a vector with dimensions R^N and a vector with dimensions R^N+1 be a matrix? and if so what would it dimension size be?
Create a vector of 100 integers PRG from 1 to 500. Find the max and min...
Create a vector of 100 integers PRG from 1 to 500. Find the max and min and print those out. Please use c++.
Java Coding Part A Create a class Employee. Employees have a name.   Also give Employee a...
Java Coding Part A Create a class Employee. Employees have a name.   Also give Employee a method paycheck() which returns a double. For basic employees, paycheck is always 0 (they just get health insurance). Give the class a parameterized constructor that takes the name; Add a method reportDeposit. This method prints a report for the employee with the original amount of the paycheck, the amount taken out for taxes (we will do a flat 17%), and the final amount (for...
R Studio Coding Exercise Problem-Set Questions 1-6 # 1) Create the following vector in 1 line...
R Studio Coding Exercise Problem-Set Questions 1-6 # 1) Create the following vector in 1 line of code without using the c() function: # [i] 4 12 20 4 12 20 4 12 # 2) Create a vector of 25 random heights between 54 and 78 inches. Cycle through the vector using a For loop and create a new vector that places each height into a category. People less than 5 feet should be categorized as short, those taller than...
This is R language Create a vector that contains the message part of each log entry...
This is R language Create a vector that contains the message part of each log entry in logsin uppercase letters. In your solution, you might want to use the function toupper(). Simply print this vector to the console. # Return vector with uppercase version of message elements in log entries # Apply extract_caps function on logs
R programming language A) Create a function that accepts two arguments, an integer and a vector...
R programming language A) Create a function that accepts two arguments, an integer and a vector of integers. It returns the count of the number of occurrences of the integer in the input vector. 1]Input: num_count <-function ??? 2]Input: num_count(2,c(1,1,2,2,3,3)) 2] Output: 2 3] Input: num_count(1,c(1,1,2,2,3,1,4,5,5,2,2,1,3)) 3] Output : 4 B) Create a function that accepts 3 integer values and returns their sum. However, if an integer value is evenly divisible by 3, then it does not count towards the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT