Login

Create Account
Customer Service Chat
+14156709189
info@expertsmind.com
Submit Homework/Assignment
Get quote & make Payment
Get Solution
Question with R  Bioinformatics, Applied Statistics
Hi There,
I have a question regarding R, and I am wondering if anyone can help me.
Here is a code that I would like to understand:
squareFunc < function(f) {
g < function(x) {
f(x)^2
}
return(g)
}
sin.2 < squareFunc(sin)
sin.2(1)
In the above code, function sin is nested in suquareFunc, which also has a function g inside.
I am having hard time understanding this code.
For example, if I was asked to write this code, mine would look like:
squareFunc < function(f) {
g < f^2
return(g)
}
sin.2 < squareFunc(sin)
sin.2(1)
and this does not work.
I feel that argument ''f'' in in squareFunc(f) should be passed on to the function ''g'', but what g has is (x).
Obviously the first code works if I type it in R, but I would like to understand how it works.
I may not be asking the right question, but if you can see where I am confused at and can help me to understand it, that would be great.
Thank you very much in advance.
Mayumi
Posted Date: 1/20/2013 8:46:28 PM  Location : Canada
Ask an Expert
Related Discussions:
Question with R  Bioinformatics, Assignment Help, Ask Question on Question with R  Bioinformatics, Get Answer, Expert's Help, Question with R  Bioinformatics Discussions
Write discussion on Question with R  Bioinformatics
Your posts are moderated
Write your message here..
Related Questions
Determine the maximum process variability, You are going to purchase a part...
You are going to purchase a part from a specialty vendor. Your company needs a C p of at least 1.67 on a critical dimension of the part. The dimensional specification for this p
Show the hypothesis test, The file Midterm Data.xls has a tab labeled "Inc...
The file Midterm Data.xls has a tab labeled "Income Data 2009". This data is collected income data from a sample of 400 people in 2009. Use a hypothesis test to see whether the av
Muti linear regression model problem, Muti linear regression model problem ...
Muti linear regression model problem An investigator is studying the relationship between weight (in pounds) and height (in inches) using data from a sample of 126 high school
Risk of portfolios, Risk of Portfolios So far, we have seen the applic...
Risk of Portfolios So far, we have seen the application of standard deviation in the context of risk in single investment. But usually most investors hold portfolios of securi
Satandard deviation of natural numbers, prove standard deviation of natural...
prove standard deviation of natural natural numbers
Find probability of remaining paint free  ball duel, In a threecornered p...
In a threecornered paint ball duel, A, B, and C successively take shots at each other until only one of them remains paint free. Once hit, a player is out of the game and gets no
Technical report in buildin a simple linear regression model, how much that...
how much that cost ?
Determine the effects of stopping smoking on weight gain, Determine the Eff...
Determine the Effects of Stopping Smoking On Weight Gain As part of a study to determine the effects of stopping smoking on weight gain, nine females were weighed on the day t
Universe or population, Universe or Population The word universe as use...
Universe or Population The word universe as used in statistics denotes the aggregate from which a sample is to be taken. According to Simpson and Kafka, a universe or populatio
Find the probability customers pay their bill in full, The proportion of Am...
The proportion of American Express creditcard holders who pay their credit card bill in full each month is 23%; the other 77% make only a partial or no payment. (a) In a random
Assignment Help
Accounting Assignment Help
Economics Assignment Help
Finance Assignment Help
Statistics Assignment Help
Physics Assignment Help
Chemistry Assignment Help
Math Assignment Help
Biology Assignment Help
English Assignment Help
Management Assignment Help
Engineering Assignment Help
Programming Assignment Help
Computer Science Assignment Help
IT Courses and Help
ExpertsMind Services
Online Tutoring
Projects Assistance
Exam Preparation
Coursework Help
Programming Courses
Engineering Courses
Why Us ?
~Experienced Tutors
~24x7 hrs Support
~Plagiarism Free
~Quality of Work
~Time on Delivery
~Privacy of Work