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
Initial centroids data set, Find unlabeled data set test.txt and initial ...
Find unlabeled data set test.txt and initial centroids data set centroids.txt in the archive, both files have the following format: [attribute1_value attribute2_value ...
Time series analysis., how is a free hand graph secular trend method plotte...
how is a free hand graph secular trend method plotted
Spatial ability test, What would be the cutoff score to indicate a score th...
What would be the cutoff score to indicate a score that is in the top 15% of the scores on a test with a mean of 100 and a standard deviation of 15? This question has multiple p
Bivariate distribution, f(x,y)=c(6xy) ,o find P(X+Y
f(x,y)=c(6xy) ,o find P(X+Y
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
Xbar charts when the mean and standard deviation not known , Charts when t...
Charts when the Mean and the Standard Deviation are not known We consider the data corresponding to the example of Piston India Limited. Since we do not know population mean a
PERCENTAGES, CALCULATE THE PERCENTAGE OF REFUNDS EXPECTED TO EXCEED $1000 U...
CALCULATE THE PERCENTAGE OF REFUNDS EXPECTED TO EXCEED $1000 UNDER THE CURRENT WITHHOLDING GUIDELINES
Express the null hypothesis, Examine the given statement, then express the ...
Examine the given statement, then express the null hypothesis H0 and the alternative hypothesis H1 in symbolic form. The mean weight of women who won a beauty pageant is equal t
PERCENTAGES, CALCULATE THE PERCENTAGE OF REFUNDS EXPECTED TO EXCEED $1000 U...
CALCULATE THE PERCENTAGE OF REFUNDS EXPECTED TO EXCEED $1000 UNDER THE CURRENT WITHHOLDING GUIDELINES
Simple regression, Simple Regression: The Teacher Preparation Researc...
Simple Regression: The Teacher Preparation Research Team conducted a study of college students who took the Praxis IIa teacher certification examination. Some variables from
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