similar to: help formatting data for clustering

Displaying 20 results from an estimated 1200 matches similar to: "help formatting data for clustering"

2007 Apr 03
2
has_many :through associated object ids assignment error
Hi, I have the following situation: class Article < ActiveRecord::Base has_many :readings has_many :users, :through => :readings end class Reading < ActiveRecord::Base belongs_to :article belongs_to :user end Now what I''m trying to do is: article = Article.new article.save! # user ids 1,2,3 exist in database, as does the article article.user_ids = [ 1, 2, 3 ] But I
2006 Jan 20
11
HABTM relations
Hi, I have 3 tables with HABTM relation. USERS -> QUOTE_TO_USER <- QUOTES Table QUOTE_TO_USER has 3 attributes: quote_id, user_id, component. I have a form where I can tie multiple users to QUOTE. This is easy one, thru "user_ids" (@quote[:user_ids] = @params[:quote][:user_ids]). In this form I have all users and I just check those I want to tie to this quote, however
2006 Dec 25
2
how to insert data using has_and_belongs_to_many
I''am newbie in RoR, so my question might look stupid, but I stuck in one thing. I''ve created 3 tables: users{ id, user } books { id, book } books_users{ book_id, user_id} Model class Book< ActiveRecord::Base has_and_belongs_to_many:users I can''t figure out how to insert data to the books_users table. For example users post info about new book and information
2009 Sep 27
2
Count number of zeros in a collumn
I have a matrix 700x2000 which is sampled in each cycle from another matrix 788x2000 with the numbers 0,1 and 9 There is one specific collumn of this matrix, dart[,1977], that usually, after the samplimg procedure has only 1 and 9 (because the zero frequency in this collumn is low). However, when this happens, I want to include an IF conditional in my code. so basically what i wanted to do was to
2006 Jul 26
8
team captain - habtm w/has_one...
the below... class User < ActiveRecord::Base has_and_belongs_to_many :teams class Team < ActiveRecord::Base has_and_belongs_to_many :users has_one :captain, :class_name => ''User'' produces the error... Mysql::Error: Unknown column ''users.team_id'' in ''where clause'': SELECT * FROM users WHERE (users.team_id = 1) LIMIT 1 i
2006 Jun 22
3
best way to generate sums of groups
I''m a rails newby, so I''m trying to wrap my head around how to tackle this, since my first few attempts failed. Let''s say your database looks like this: Users id, name, created_at Points id, user_id, value, created_at Users complete different tasks and are awarded varying levels of points, which are recorded in the Points table. What if you wanted to display a
2005 Dec 14
5
inserting multiple rows
I have table which stores multiple entries. Each row has user_id, game_id and a pick_id. On a page the user has to make load of choices. All this gets submitted. the html looks like so: <input type="hidden" name="game_id" value="3"> <input type="hidden" name="user_id" value="19"> <select name="pick[3]"> ....
2006 Sep 28
5
Eager loading using find_by_sql
Here''s the problem I have the following models User - is a person Team - is a team Wherenote - snipet of info about a user''s whereabouts on a certain day Team has_and_belongs_to_many :users User has_and_belongs_to_many :teams has_many :wherenotes Wherenote belongs_to :user each Wherenote has a note_date On one page I want to pull back all the Users from a particular Team
2010 Jul 30
1
Unique rows in data frame (with condition)
I have to deal with data frames that contain multiple entries of the same (based on an identifying collumn 'id'). The second collumn is mostly corresponding to the the id collumn which means that double entries can be eliminated with ?unique. a <- unique(data.frame(timestamp=c(3,3,3,5,8), mylabel=c("a","a","a","b","c"))) However
2010 Aug 04
4
Adding collumn to existing data frame
Hi experts, I am trying to write a very flexible method that allows me to add a new column to an existing data frame. This is what I have so far: add.column <- function(df, new.col, name) { n.row <- dim(df)[1] length(new.col) <- n.row names(new.col) <- name return(cbind(df, new.col)) } df <- NULL df <- data.frame(a=c(1,2,3)) df # corect: added NA to new collumn df <-
2011 Apr 20
2
'Record' row values every time the binary value in a collumn changes
My question is twofold. Part 1: My data looks like this: (example set, real data has 2*10^6 rows) binary<-c(1,1,1,0,0,0,1,1,1,0,0) Chromosome<-c(1,1,1,1,1,1,2,2,2,2,2) start<-c(12,17,18,20,25,36,12,15,16,17,19) Table<-cbind(Chromosome,start,binary) Chromosome start binary [1,] 1 12 1 [2,] 1 17 1 [3,] 1 18 1 [4,] 1
2009 Sep 13
2
(no subject)
How would I make a histogram using R from a table in excel that has 4 variables, but I only want to use 2 of the columns to make the histogram? [[alternative HTML version deleted]]
2012 Jan 05
1
match matrices of different lengths
was trying to match different matrices of different lengths with in the first collumn date and time info (yearmonthdayhourminute). the routine needs to return NA?s where data of either of the matrices is non existent. have been trying the following: #### x <- c(200112030003, 200112030004, 200112030005, 200112030006) y <- c(0.1, 1, 1.1, 1.5) a <- c(200112030004, 200112030005,
2009 Sep 23
1
BLUP with missing data
hello guys, I need to do a BLUP in the simplest model y = Xm + Zg + e however I have missing data in the analysis which I can?t consider as 0(zero). So I need to generate the matrix X'Z, Z'X and Z'Z step by step; I can?t use crossprod(x) #neither X'X <- t(x)%*%x because I should skip the elements with missing data in the matrix I?ll try to be more clear, supposing a matrix x
2005 May 24
4
Table Help
Reply to sender Reply to all Reply to folder Forward Move/Copy Delete Read previous item Read next item Get help information on the current window From: McMurtry, Benjamin G. To: 'r-help-request at stat.math.ethz.ch' Cc: Subject: Table Help Sent: 5/24/2005 4:33 PM Importance: Normal I have a very large table that I want to add some of the certain rows. The table is
2009 Nov 05
4
collumn error when exporting to Excel
Dear all, I am attempting to export my results (data.frame) created with the help of a number of you to Excel. In the procedure my column structure is however lost and all results are placed together into the first Excel column. I have tried: write(), write.table(), write.matrix(), export() and have the same results. I Have checked the import/export FAQ and did a Google search to no avail. Any
2008 Sep 29
3
replicating dataframe rows
Dear all, I have a data.frame like the sample below, and I would like to expand my data.frame using "population" variable. So, for each line of my data.frame I would like that the new data.frame have many rows as the population collumn. place<-c("place1", "place2", "place3", "place4", "place5") population<-c(100,200,300,50,30)
2008 Apr 05
2
installing dotnet20 fails
I am trying to install dotnet20 in 0.9.58 with sh winetricks dotnet20 It hangs after extracting a file with sh winetricks dotnet20 Using system libcrypto, version 90709F DLSYM: Failed to resolve FIPS_mode_set: 127 DLSYM: Failed to resolve FIPS_mode: 127 DLSYM: Failed to resolve SHA256: 127 DLSYM: Failed to resolve SHA512: 127 DLSYM: Failed to resolve EVP_sha224: 127 DLSYM: Failed to
2006 Apr 05
7
AdminPages Rails CMS is now an engine
Hi all, I just released the new version of my CMS AdminPages as a Rails engine. It uses the Dojo Toolkit for UI elements. Features: Manipulate pages and content with Drag n Drop, Pages in a sortable tree, easy to define new page elements, "Nice" URLs, Page Caching, Rich Text Editor, multiple columns per page, custom content types, Layout scaffolding BSD license
2010 Jan 25
0
has_many, :finder_sql, setting attributes
Hi all, My question is somewhat complicated, but bear with me. My project has a number of models: User, Program, and Team. Users belong to multiple Programs. Programs have multiple teams, but Teams belong to one program. For each Program a User belongs to, he can belong to multiple Teams. (Think of this in an athletic context where users are athletes, programs are universities). So my