Login

Create Account
+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
Confidence interval, for this proportion, use the +2 rule of thumb to dete...
for this proportion, use the +2 rule of thumb to determine the 95 percent confidence interval. when asked if they are satisfied with their financial situation, .29 said "very sat
Hypothesis, What is a null hypothesis? ..
What is a null hypothesis? ..
Data project, Dr. Jim Mirabella UNIT EIGHT: DATA ANALYSIS PROJECT All Excel...
Dr. Jim Mirabella UNIT EIGHT: DATA ANALYSIS PROJECT All Excel output should be copied into a single Word document where you must enter all of your responses to the questions below.
Confirmatory factor analysis, Confirmatory factor analysis (CFA) seeks to d...
Confirmatory factor analysis (CFA) seeks to determine whether the number of factors and the loadings of measured (indicator) variables on them conform to what is expected on the ba
Time series, Measurement of trend , least square method
Measurement of trend , least square method
LPP, b. A paper mill produces two grades of paper viz., X and Y. Because of...
b. A paper mill produces two grades of paper viz., X and Y. Because of raw material restrictions, it cannot produce more than 400 tons of grade X paper and 300 tons of grade Y
Determine market interest rate, The interest rate on the three year loan is...
The interest rate on the three year loan is 0.087. Whereas the interest rate on the two year loan is 0.085 as given in A. Suppose that the liquidity premium at t=1 is 0.002 and tha
Disadvantages of mode, Disadvantages The value of mode cannot always...
Disadvantages The value of mode cannot always be determined. In some cases we may have a bimodal series. It is not capable of algebraic manipulations. For example, from t
Confidence interval, for this proportion, use the +2 rule of thumb to dete...
for this proportion, use the +2 rule of thumb to determine the 95 percent confidence interval. when asked if they are satisfied with their financial situation, .29 said "very sat
Interaction of enviornment and gene , entropy test to measure interaction b...
entropy test to measure interaction between enviornmental factors and genes
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