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
Satandard deviation of natural numbers, prove standard deviation of natural...
prove standard deviation of natural natural numbers
Stat, solve problems
solve problems
Evaluate expressions, I need help
I need help
Calculate the standard deviation, Zinc is a trace element and it is importa...
Zinc is a trace element and it is important in wound healing, building up the immune system and DNA synthesis. The data in Table 1 represents the zinc intake (in milligrams) for a
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
Cluster sampling, Cluster Sampling This method is also known as multi s...
Cluster Sampling This method is also known as multi stage sampling .Under this method random selection is made of the ultimate or final units from a given stratum. The sampling
Determine the subset of variables, Agency revenues. An economic consultant ...
Agency revenues. An economic consultant was retained by a large employment agency in a metropolitan area to develop a regression model for predicting monthly agency revenues ( y ).
Types of sampling, Given a certain population there are various ways in whi...
Given a certain population there are various ways in which a sample may be drawn from it. The chart below illustrates this point: Figure 1 In Judgem
Postneonatal mortality rate, Mid year population 440000 Late fatal death...
Mid year population 440000 Late fatal death 29 No. of live birth 5200 No. of infant death 423 No. of maternal death 89 No. of infant deaths i
Sampling, ghjkg
ghjkg
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