Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Could you advise how do we solve this issue in R as i just started some practices but still confused?

$
0
0

a) Import the file Exercise_4.txt into "Tables_4" object. (Exercise_4.txt contains the following information:

"Random"&"Variable"&"Constant"
0.342344236375671&1&1
0.561116151677482&2&1
0.611846552990396&1&1
1.96565280734929&2&1
0.50686932807528&1&1
0.547330747322365&2&1
1.06352275871037&1&1
1.83456004587665&2&1
0.400159654960318&1&1
0.443577592788297&2&1

b) Give the table the attribute "My_name" informing about your name. Display all table attributes.

c) Convert above table to "List_4" list.

d) Create a function that converts any numerical input vector into a subtitle vector according to the following rule: if the value is less than or equal to 1.5 - enter "less than 1.5", otherwise "more than 1.5". The function cannot use any loops, only "vectorized" operations.

e) Apply the created function on the "List_4" list items from point c).

My attempts as following:

##a) (table should contain 3 columns but in my case not, I used code below)


table_4 <-read.table("C://Users/CSA/Desktop/Kali_excercise.txt", header=F, sep="",fill = T)

table_4

##b

attr(Kali_excercise, which = "My_name") <- "Takrin"
attributes (table_4)

##c

list_4 <- as.list (table_4)
list_4

##d & e
# No attempts yet

Viewing all articles
Browse latest Browse all 201894

Trending Articles