Difference between revisions of "Test variable B"

From Testiwiki
Jump to: navigation, search
m (Formula)
m
Line 1: Line 1:
'''Brief guidance about the contents.''' This box of text can removed.
 
 
    <nowiki>{{variable}}</nowiki> template:
 
        Put your own username in moderator=Username unless someone else takes care of the page content.
 
        When the page is quite developed, change stub=No
 
    Question (previously Scope) Specifies a clear research question.
 
        This includes a question and a verbal definition of the spatial, temporal, and other limits
 
        (system boundaries) of the variable. The question is defined according to the use
 
        purpose of the assessment(s) that the variable belongs to.
 
    Answer (previously Result) Answer to the research question.
 
        Contains anything that a reader needs to understand the answer. If possible, a numerical expression or distribution.
 
        If there is more than a single answer, i.e. the answer is actually a list of answers, a [[data table]] should be used.
 
        Contains also the unit(s) in which the answer is expressed.
 
    Rationale (previously Definition) Description about how the answer is derived.
 
        Rationale contains anything that is needed to convince a critical rational reader.
 
        Description of the data used for obtaining the value of the variable
 
        (e.g. measurement data; mathematical method and its parameters).
 
        Please include references (preferably using the ''<nowiki><ref> </ref></nowiki>'' tags)
 
        and links to original data, as appropriate.
 
        May contain subheadings Dependencies and Formula.
 
        Subheadings no longer used: Data as most of Rationale is this anyway; Unit as it is already mentioned in Answer.
 
            Dependencies: Links to all variables whose answers affect the answer of this variable.
 
            Formula (or R code): computer code or mathematical formula for calculating the answer.
 
    See also: Links to relevant information that does not belong to ''Rationale''.
 
    Keywords: Any words that help users to find this page with search tools.
 
    References will appear automatically, if cited above using the ''<nowiki><ref> </ref></nowiki>'' tags.
 
        Additional references can also be listed here.
 
    ''Related files'' automatically shows files from [[Opasnet File]] if they have been linked to this page.
 
    <nowiki>{{publication}}</nowiki> can be used if the page is good enough to be a publication by itself. Otherwise, delete.
 
 
 
{{variable|moderator=Erkki Kuusisto|stub=Yes}}
 
{{variable|moderator=Erkki Kuusisto|stub=Yes}}
  
 
== Question ==
 
== Question ==
  
 +
A simple test variable that fetches the '''data''' defined in "Test variable A", as well as a '''function''' defined in Test variable C?
  
 
== Answer ==
 
== Answer ==
Line 44: Line 15:
  
 
=== Formula ===
 
=== Formula ===
 +
 +
# The code below will not work since the table in Test variable A is in the wrong format.
 +
  
 
<rcode showcode="1"
 
<rcode showcode="1"
 
name="answer"  
 
name="answer"  
label="Run code"  
+
label="Run"  
 
include="
 
include="
 
page:Object-oriented_programming_in_Opasnet|name:answer|
 
page:Object-oriented_programming_in_Opasnet|name:answer|
Line 57: Line 31:
 
cat("Initiation successful. \n")
 
cat("Initiation successful. \n")
  
library(xtable)
+
out <- op_baseGetData("opasnet_base", "Op_en5682") # Fetches data from Test variable A.
out <- op_baseGetData("opasnet_base", "Op_en5682") # Downloads data from the data table of that page.
+
 
 
colnames(out)[colnames(out) == "obs.1"] <- "Row" # Changes the column name "obs.1" to "Row"
 
colnames(out)[colnames(out) == "obs.1"] <- "Row" # Changes the column name "obs.1" to "Row"
 
out <- tidy(out , direction = "wide")
 
out <- tidy(out , direction = "wide")

Revision as of 14:09, 16 May 2012


Question

A simple test variable that fetches the data defined in "Test variable A", as well as a function defined in Test variable C?

Answer

Rationale

Dependencies

Formula

  1. The code below will not work since the table in Test variable A is in the wrong format.


- Hide code


cat("Initiation successful. \n")

out <- op_baseGetData("opasnet_base", "Op_en5682") # Fetches data from Test variable A.

colnames(out)[colnames(out) == "obs.1"] <- "Row" # Changes the column name "obs.1" to "Row"
out <- tidy(out , direction = "wide")
print(out)

Lden <- 60
HA <- ERF_Lden_HA(Lden)

Lden
HA


See also

Keywords

References


Related files

<mfanonymousfilelist></mfanonymousfilelist>

Test variable B. Opasnet . [1]. Accessed 11 May 2024.