Calc: using field from another entity

  • Asked
  • Active
  • Viewed 6761 times
0

Hi, I tried to get more results for Plot level, as number of species in each plot. There this line

regenSpecies <- sqldf( "SELECT plot_id_ , regen_species_code AS species_code FROM regen " );

caused an error, and I checked in RStudio that regen$regen_species_code was not read in dbGetQuery clause.

I could solve this by adding a "fake" line into previous "Regen - Count total" module as: test <- regen$regen_species_code

BUT, it so that only those fields are read in which are written into the code under that particular entity?

Cheers, Lauri

0

Accepted answer

Dear Lauri,

If you want to have variables read for a specific entity (e.g. regen), you need to add that variable in a calculation step that uses that entity (as you did in the regen – count total).

Afterwards that variable can be used in another calculation step.

I think you can also add a simple comment that includes the variable. e.g.: # regen_ species_ count

in the regen – count total calculation step.

Mino

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.