Fill This Form To Receive Instant Help
Homework answers / question archive / FIN4230 Assignment 1 Q1(20 points): In our Topic 1_Functions
FIN4230
Assignment 1
Q1(20 points):
In our Topic 1_Functions.R file (Example 1), I have mentioned that their code is incorrect from finance perspective. For example, under their original code, their function actually compute like:
100
However, the correct way should be
100
Please answer following two questions:
Q2 (10 points)
In RStudio, please copy the following concatenate strings
mydata = c("This is me",
"That my house",
"Hello, world!")
Please use “regular expression” code to print out only last line (e.g. "Hello, world!")) [hint: use str_detect and $ or ^]
Q3 (Bonus 5 points):
In RStudio, please copy the follow concatenate strings
mydata = c('Nancy Smith',
'is there any solution?',
".[{(^$|?*+",
"coreyms.com",
"321-555-4321",
"123.555.1234",
"123*555*1234")
Please use “regular expression” code to print out only phone numbers (e.g. last three items) [hint: use str_extract and \\d or .]
Already member? Sign In