11 Matching Annotations
  1. Last 7 days
    1. QUESTIONS:

      What the hell is the answer to:

      1) Exercise 2: In the editor, three vectors are defined. Each one represents the box office numbers from the first three Star Wars movies. The first element of each vector indicates the US box office revenue, the second element refers to the Non-US box office. In this exercise, you’ll combine all these figures into a single vector with name ‘box_office’. Next construct a ‘matrix star_wars’ with 2 rows and 3 columns.

      2) Exercise 1: Write code to create an array ‘l’ with 3 sheets of 2 rows and 4 columns, filled with the first 5 letters of the alphabet.

    2. "!(2>3) + 2

      [1] FALSE

      !(2>3) + 0:5

      [1] TRUE FALSE FALSE FALSE FALSE FALSE

      z <- (1 > 2)

      is.logical(z)

      [1] TRUE"

      Consulta realizada correctamente
      

      These examples demonstrate how R handles "conflicts" between different types of operations and how it manages collections of data (vectors). 1. !(2>3) + 2 → FALSE

      This is another result of Operator Precedence. In R, the addition operator (+) is much stronger than the negation operator (!).

      What you expect: NOT (2 > 3) is NOT FALSE, which is TRUE. Then TRUE + 2 should be 3.
      
      What R does: It groups the + 2 with the expression immediately to its left.
      
          First, it evaluates the comparison: (2 > 3) is FALSE.
      
          Now the expression is !FALSE + 2.
      
          Because + happens before !, R calculates FALSE + 2 first.
      
          FALSE is coerced to 0. So, 0 + 2 = 2.
      
          Finally, it applies the negation: !2.
      
          In R, any non-zero number is treated as TRUE for logical operations. Therefore, NOT 2 (NOT TRUE) becomes FALSE.
      
      1. !(2>3) + 0:5 → TRUE FALSE FALSE FALSE FALSE FALSE

      This uses the same precedence rule but adds Vectorization into the mix.

      Step-by-Step:
      
          2 > 3 is FALSE.
      
          0:5 creates a vector: c(0, 1, 2, 3, 4, 5).
      
          R evaluates the addition first: FALSE + c(0, 1, 2, 3, 4, 5).
      
          FALSE becomes 0, and is added to every number in the vector (Recycling). Result: c(0, 1, 2, 3, 4, 5).
      
          Now R applies ! to that entire vector: !c(0, 1, 2, 3, 4, 5).
      
          The Result:
      
              !0 is TRUE (because 0 is the only "False" number).
      
              !1, !2, !3, etc., are all FALSE (because non-zero numbers are "True").
      
      1. z <- (1 > 2) and is.logical(z) → TRUE

      This is the simplest case because of the Parentheses.

      The parentheses force R to finish the comparison (1 > 2) before doing anything else.
      
      1 > 2 is strictly a logical comparison, so the result stored in z is the logical value FALSE.
      
      Since z is a "logical" data type, is.logical(z) correctly returns TRUE.
      

      The Golden Rule for R Logic

      If you are combining a logical test (!, >, ==) with an arithmetic operation (+, *, /), always wrap your logical test in parentheses.

      Bad: !x + y (Does !(x+y))
      
      Good: (!x) + y (Does (Not x) + y)
      
    3. "!(1>2) * 3

      [1] TRUE

      3 * !(1>2)

      [1] 3"

      This is a classic "trap" in the R language caused by Operator Precedence. It’s the coding equivalent of the math rule that multiplication comes before addition (BODMAS), but with a twist that is unique to R.

      Here is exactly why those two lines give different results: 1. !(1>2) * 3 → TRUE

      In R, the multiplication operator (*) has a higher precedence than the negation operator (!).

      The Math: R doesn't see "Not (1 > 2), then times 3." Instead, it groups the * and the ! together in a way that prioritizes the multiplication first.
      
      The Step-by-Step:
      
          First, it evaluates the comparison: (1 > 2) is FALSE.
      
          Now the expression is !FALSE * 3.
      
          Because * is stronger than !, R tries to do FALSE * 3 first.
      
          As we discussed, FALSE is converted to 0. So, 0 * 3 is 0.
      
          Finally, it applies the ! to that result: !0.
      
          In R, any number that is exactly 0 is FALSE, and anything else is TRUE. Therefore, !0 becomes TRUE.
      
      1. 3 * !(1>2) → 3

      When you flip the order, the grouping changes because the ! is now tucked inside the operation differently.

      The Step-by-Step:
      
          First, it evaluates the comparison: (1 > 2) is FALSE.
      
          Now the expression is 3 * !FALSE.
      
          R evaluates the negation: !FALSE is TRUE.
      
          Now the expression is 3 * TRUE.
      
          R converts TRUE to 1 for the computation: 3 * 1 is 3.
      

      How to avoid this confusion

      The "Safe Way" is to always use parentheses around your logical negations if you plan to do math with them. This forces R to do exactly what you want: R

      (!(1 > 2)) * 3

      [1] 3

      Pro Tip: In the R terminal, you can type ?Syntax to see the full list of which operators are "stronger" than others. You'll see that * and / are way up at the top, while ! is surprisingly far down!
      
    4. Note that the logical data type objects are automatically converted to a ‘numeric’ type when used inside a computation: TRUE is replaced by 1 and FALSE by 0.2 2

      Why isn't FALSE simply 0?

  2. Oct 2025
    1. ‘If we can only receive by giving, then we must begin to give’ (Phatthanaphraiwan & Greene, 2025). The ecological and social challenges we collectively, albeit differentially, confront today in the form of climate change, biodiversity decline and social injustice were created over hundreds of years of appropriation, structural violence on Indigenous, Afro-descendant and other frontline communities globally (Correia, 2024). To guide sustainability management in more ethical and equitable ways, we need to address these relations by recognising the existent inherited prejudice, power asymmetry and hierarchical status. Hence, it is necessary to imagine that rebuilding healthy relations will also take time.

      colonial past implications for reciprocity practice

    2. While the role of IP and LC is increasingly recognised in academic and international policy arenas, a lack of recognition by national governments and some academic fora persists (McElwee et al., 2020; Tormos-Aponte, 2021). Lack of awareness is fourfold: epistemological (different knowledge production and validation methods), ontological (different assumptions of reality), ethical (different moral responsibilities between human and non-human beings) and political (different positions of power to enforce perspectives in collaborative practices, Ludwig & El-Hani, 2020).

      the political problem. How to go beyond academic reciprocity and into social reciprocity.

    3. This relationship between the human and the non-human has been conceptualised as ‘kincentric ecology’ (Bird-David, 1999; Salmón, 2000). From this perspective, plants, animals and fungi are not seen as food or material sources, but rather as vital participants in a relational web that connects humans and animals to spirits, ancestors and other beings. For example, in Baka knowledge systems, individuals of each type of being (‘species’) only exist through their interactions with many other beings and their shared environment, which they all constantly change (Hoyte & Mangombe, 2024).

      Similar to the concept of agential realism!

    4. In many cultures, reciprocity is understood as an interpersonal and communal responsibility to ensure the welfare of the community and the social-ecological system as a whole, where ancestors and those yet to be born are equally considered (Fernández-Llamazares & Virtanen, 2020).

      key term here: "ancestors". We need to think of reciprocity in a way that account for the years of exploitation of our ancestors.

  3. Jun 2024