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
Correlation, Definition of Correlation According to prof, king correla...
Definition of Correlation According to prof, king correlation means that between two series or group of data there exists some casual connection prof, king has also exp
Index number, give a elementary example for characterstics of index number
give a elementary example for characterstics of index number
Calculate the current ratio and quick ratio, You were recently hired by E&T...
You were recently hired by E&T Boats, Inc. to assist the company with its financial planning and to evaluate the company's performance. E&T Boats, Inc. builds and sells boats to o
Asymmetric proximity matrices, Asymmetric proximity matrices Immediacy...
Asymmetric proximity matrices Immediacy matrices in which the offdiagonal elements which are, in the i th row and j th column and the j th row and i th column, are not essent
Hypothesistesting, Apl.send me nots on hypothesis testing sk question #Mi...
Apl.send me nots on hypothesis testing sk question #Minimum 100 words accepted#
Plot diagnostic quantities, The data in the data frame compensation are fro...
The data in the data frame compensation are from Myers (1990), Classical andModern Regression with Applications (Second Edition)," Duxbury. The response y here is executive compens
Calculate the seasonal indexes , The total number of overtime hours (in 100...
The total number of overtime hours (in 1000s) worked in a large steel mill was recorded for 16 quarters, as shown below. Year Quarter Overtime hour
Association of attributes, In an examination 600 candidates appeared, boys ...
In an examination 600 candidates appeared, boys outnumbered girls by 16% of all candidates. number of passed candidates exceeded the number of failed candidates by 310. Boys failin
Make a decision about the claim, Make a decision about the given claim. Do...
Make a decision about the given claim. Do not use any formal procedures and exact calculation. Use only the rare event rule. Claim: A coin favors head when tossed, and there
Calculation for discrete series or ungrouped data , Calculation for Discre...
Calculation for Discrete Series or Ungrouped Data The formula for computing mean is = where, f = fr
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