Displaying 20 results from an estimated 35 matches for "site_id".
2005 Jul 12
4
Calculation of group summaries
...ttach(PlantGrowth)
stack(mean(unstack(PlantGrowth)))
I'd like to do something slightly more complex, using a data frame and
groups identified by unique combinations of three id variables. There
may be thousands of such combinations in the data. This is easy in SQL:
select year,
site_id,
visit_no,
mean(undercut) AS meanUndercut,
count(undercut) AS nUndercut,
std(undercut) AS stdUndercut
from channelMorphology
group by year, site_id, visit_no
;
Reading a CSV written by SAS and selecting only records expected to have
values is also stra...
2005 Nov 25
2
acts_as_list with 2 fields in the scope
Hi Railers,
I''ve got a Categories table.
I want it to act as a list within the scope of the parent_id AND the
site_id.
Categories table :
id
label
site_id
parent_id
So, in my Category class, I have :
acts_as_list :scope => ''site_id = #{site_id} AND parent_id = #
{parent_id}''
The problem is that when I try to move_up a Category with a parent_id
that is null, the generated query (found in...
2008 Oct 16
1
merge/combine data
Hi,
I have the following data imported from a csv file
user_id site_id name
1 1 11 februari
2 1 11 redbook
3 1 11 tips
7 3 6 sleep
8 3 6 monitoring
9 3 6 alarm
Which I would like to merge/combine into
user_id site_id name
1 1...
2010 Feb 20
1
Contingency Table - output to odfWeave not working for matrix
...me with this. It should be easy but it seems to get stuck for no obvious reason! I am trying to set a report up in odfWeave so that we can re-run the same analysis at 3 time points as the data matures and provide an 'instant' report.
To simplify the situation we have two pieces of data: site_id (numerical value 1-9) and reaction (categorical Y or N).
mydata=""
mydata$site_id = rep(1:9, 15)
mydata$reaction = rep(c("Y","N","N","Y","N"),27)
until now I've simply used the command:
with (mydata, table (site_id, reaction))
to g...
2010 Jan 20
0
putting labels back on a matrix.
...I have an analysis using a matrix in which I needed to strip the ID variable off the input data to run the analysis. Now I want to reattach the ID back to the results matrix but I can't seem to find a way to join the ID back. Below is the exact input I'm using, row 9 is where I strip the Site_ID value from the input data.
library(vegan)
library(reshape)
csv_base <- read.csv("c:/temp/cvs_export.csv", header=T, as.is=T)
csv_basef <- subset(csv_base, Site_Id >= 1)
testm <- melt(csv_basef, id = 1:4, measure = 5)
test <- cast(testm, Site_Id ~ Element_Id, sum)
dim(test)...
2006 Apr 19
4
Weird Problem - probably a noob mistake
...tumped.
I have this relatively simple controller to load up a bio. It''s basicly
id, name, desc, type (I use STI).
class BioController < ApplicationController
layout ''layouts/singlepanel''
def index
@bio = Bio.find(:all, :conditions => [''site_id = ?'',
@session[''site''].id])
render ''bio/index''
end
end
However when I attempt to display the data in the view using this:
<h2> <%=@bio.name%> </h2>
I get an error:
undefined method `name'' for #<Array:0x3892618>...
2006 Jul 29
0
Accessing vars within helpers in Markaby
I''ve been trying to figure out how to do this:
select_tag ''site_id'',
@helpers.options_from_collection_for_select(Site.find(:all,
:order=>''name''), ''id'', ''name'', @site_id)
The select_tag gets output fine, but the default value
isn''t set. @site_id is set in the controller (@site_id
= cookies[...
2006 May 25
11
belongs_to confusion and some other questions - thanks!
Hello all,
Thanks for the help in advance, I am having some trouble with
belongs_to, and I caint seem to figure it out.
I have two tables, one called ''pow_users'' and one is called ''pow_site''
pow_users has a field called site that has the site ID for primary id in
the pow_site'' table.
the pow_site table setup as the Site class with the following:
2006 May 23
7
self-referencing has_many
Having a devil of a time finding records in a self-referencing has_many
table relationship.
Everything is working find looking at the has_many and the belongs_to
relationship.
But, when I try to find all "orphans", records that are neither a parent
nor a child, I can not find a query that work in ActiveRecord.
This query works in MySQL:
SELECT * FROM templates
LEFT JOIN templates
2006 Oct 27
1
has_many with nullable foreign_key?
Is there a way to use has_many and have it operate like such?
select * from pages where site_id = #{id} or site_id is null
I know there''s finder_sql, but then I''ll lose the find_in_collection
goodness.
Thanks,
Joe
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the...
2008 Oct 31
0
Get an object other than primary key ID
Hello,
i want to retrieve and object from a table other than primary
key ID.
eg: @sites.each do |@site|
@site_id = @site.id
@tower = Tower.find(:all, :conditions => ["site_id =?",
@site_id])
Tower Belongs to Site. so Site_id is a reference in tower object.
there will be only one Tower object for Site Object.
Should we give relation as has_obne in site model??
help me ot.
Karthik
--...
2017 Jun 12
2
plotting gamm results in lattice
...I am running a generalised mixed effect model, gamm4, for an ecology project. Below is the code for the model:
model<-gamm4(LIFE.OE_spring~s(Q95, by=super.end.group)+Year+Hms_Rsctned+Hms_Poaching+X.broadleaved_woodland? ? ? ? ? ? ?+X.urban.suburban+X.CapWks, data=spring, random=~(1|WATERBODY_ID/SITE_ID))
plot(model$gam, page=1, font.lab=2, xlab="Residual Q95")
I am trying to plot the results in lattice for publication purposes so I need to figure this out. I have been struggling but I think I have reached a dead end.?
Here is what I have been able to code:
M<-predict(model$gam,type...
2017 Jun 12
0
plotting gamm results in lattice
...then plot with xyplot
the same applies to xyplot
Try
library(gamm4)
spring <- dget(file = "G:/1/example.txt")
str(spring)
'data.frame': 11744 obs. of 11 variables:
$ WATERBODY_ID : Factor w/ 1994 levels "GB102021072830",..: 1 1 2 2 2 3 3 3 4 4 ...
$ SITE_ID : int 157166 157166 1636 1636 1636 1635 1635 1635 134261 1631 ...
$ Year : int 2011 2014 2013 2006 2003 2002 2013 2005 2013 2006 ...
$ Q95 : num 100 100 80 80 80 98 98 98 105 105 ...
$ LIFE.OE_spring : num 1.02 1.03 1.02 1.06 1.06 1.07...
2006 Jul 28
2
change url based on account name
Hi,
Is this possible
Can I specify a url ie
http://localhost/AccountName/:contorller/:action/:id
Where AccountName is should be a userName, which will lookup a siteId in
the database?
Whats the best way of going about this, is there somthing in the
routes.rb file I can change to get the account name into a variable?
Thanks for your help
jon
--
Posted via http://www.ruby-forum.com/.
2006 Mar 09
5
link_to_remote id or class
Can anyone out there tell me how to add a class or id property to a
link using link_to_remote? I''ve been banging my head on this for far
too long.
Thanks
Clint
2006 Apr 21
4
Dynamic Menu
...I''m doing this the right way, but can''t get it going. I''m
building a menu from the values in a mySQL table, and want to build it
on the fly. This is something that should be working but only works
halfway:
<% @pages = Page.find(:all, :conditions => [''site_id = 4'']) %>
<% @pages.each do |p| %>
xyz
<%p.id%>
<% end %>
I know there are two page objects in the array, and the literal in the
loop indeed paints twice, but I can''t get p.id to paint anything at all
though.
--
Posted via http://www.ruby-forum.com/.
2018 Jan 23
0
interaction term by a factor group in gamm4
...ne page. Here is my code but I get the following message
dat<-read.table("dat.txt", header=TRUE)
str(dat)
#'data.frame': 11744 obs. of 11 variables:
#$ WATERBODY_ID : Factor w/ 1994 levels "GB102021072830",..: 1 1 2 2 2 3 3 3 4 4 5 5 5 5 5 6 ...
#$ SITE_ID : int 157166 157166 1636 1636 1636 1635 1635 1635 134261 1631 65383 65383 65383 111828 ...
#$ Year : int 2011 2014 2013 2006 2003 2002 2013 2005 2013 2006 2011 2005 2004 ...
#$ ResidualQ95 : num 100 100 80 80 80 98 98 98 105 105 101 101 130 120 120 ...
#...
2009 Jan 22
2
time date stamp since, january 1st 1970
...nverting this time date
stamp to a useable field in R, date and time in a data-frame. The
developer says its the number of milliseconds since midnight, January 1,
1970.
sample: *1232558018624*
---------------------
How do I interpret the time stamp? Is there a date, i need a date and time.
site_id,survey_id,version_id,survey_start_ts,survey_question_id,start_ts,end_ts,answer
2,registration,1,1232558018625,z1,*1232558018624*,*1232558266179*,4
Answer: The timestamp is a number representing the exact date and time.
it is the number of milliseconds since midnight, January 1, 1970. Are
you us...
2006 Apr 14
3
Many to Many
Hi, I have three tables, a domain of Sites, a domain of Users, and a
junction of Sites_Users with the tables named as such.
My RoR application has a model and controller both User and Site. I
tried to add a controller and model named Site_User but I can''t
reference any functions in the controller, I get an Uninitialized
Constant error.
I''m very new to RoR, but not to
2006 Apr 04
1
has_many fails where find_by_sql succeeds
...ctiveRecord::Base
has_and_belongs_to_many :sites
has_many :sites_not_using_this_stock_group,
:class_name => "Site",
:finder_sql => ''select sites.* from sites
where id not in
(select site_id from sites_stock_groups
where stock_group_id = #{id})
order by id asc''
<snip>
def sites_not_using_this_stock_group
Site.find_by_sql(["select sites.* from sites
where id not in...