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
HLT 362, What is an interaction? Describe an example and identify the varia...
What is an interaction? Describe an example and identify the variables within your population (work, social, academic, etc.) for which you might expect interactions?
What are the hypotheses, Assume that a simple random sample has been select...
Assume that a simple random sample has been selected from a normally distribute population and test the given claim. Identify the null and alternative hypotheses, test statistic,
Box plot of income, The box plot displays the diversity of data for the inc...
The box plot displays the diversity of data for the income; the data ranges from 20 being the minimum value and 1110 being the maximum value. The box plot is positively skewed at 4
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
Ghrapical representation, rules for constructing the diagrames
rules for constructing the diagrames
Philosophy, what is the aim of statistics?
what is the aim of statistics?
Collaboration policy, Each question, by default, should be solved INDIVID...
Each question, by default, should be solved INDIVIDUALLY, unless marked as \collaborative". Questions marked as \collaborative" implies that for those questions you are encourage
Questionnaire, Framing of Questionnaire: Questionnaire is a schedule of...
Framing of Questionnaire: Questionnaire is a schedule of questions which is sent to the respondents for filling in by them in their own handwriting together the information rel
Chi square test for more than two rows, Using Chi Square Test when more tha...
Using Chi Square Test when more than two Rows are Present To understand this, let us consider the contingency table shown below. It gives us the information about the stage
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
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
ExpertsMind Services
Online Tutoring
Projects Assistance
Exam Preparation
Coursework Help
Programming Help
IT Services
Why Us ?
~Experienced Tutors
~24x7 hrs Support
~Plagiarism Free
~Quality of Work
~Time on Delivery
~Privacy of Work