similar to: need technique for speeding up R dataframe individual element insertion (no deletion though)

Displaying 20 results from an estimated 5000 matches similar to: "need technique for speeding up R dataframe individual element insertion (no deletion though)"

2012 Jul 10
1
calculating the difference between days?
Hi List, I have one column of beginning dates and one column of ending dates, I want to find their difference. And I want to ignore the trailing zeros, basically everything after the first colon mark. Begin_date End_date 01JAN2000:00:00:00:000 02FEB2002:00:00:00:000 24MAR2012:00:00:00:000 18MAY2012:00:00:00:000 01OCT2003:00:00:00:000
2009 Sep 18
2
Suppressing script commands in R console when executing long program
Hi R users, I have a script composing of more than 1000 lines and would like suppress the R codes from the console when executing the script (to reduce the physical processing time) I have tried options(echo=T) but no luck.. *Q1. Are there any way of suppressing the commands in the R console?* Also, when importing spreadsheet consisting of numbers with 1,000 separator commas (i.e 10000 as
2006 Jun 25
1
Sorting ferret results by column
I have the acts_as_ferret plugin installed. Everything searches great, but I would like to limit the results (i.e. by ''end_date'') and sort them (by ''end_date''). ''end_date'' is a valid column in my "posts" table. Here''s the code I have already: @posts = Post.find_by_contents(params[:query]) params[:query] comes from a form. I
2006 Jun 14
4
Using now() to determine what should be displayed
I''m trying to create a paginated list that will take note of the "end_date" field in my table. This is what I have: @post_pages, @posts = paginate(:posts, :per_page => 10, :order_by => ''end_date'') in the controller. And for the view: <h1>Posts ending soon</h1> <ul><% for post in @posts do %> <strong>Post Title:
2006 Dec 11
1
Compute date during before_validation_on_create
Hello, - the form posted by the user have a date field - this date is begin_date, I need to compute end_date - so, added callback before_validation_on_create - in this method I do : end_date = begin_date >> 12 - unfortunately, beeing in before_validation the actual self.begin_date have not been type casted - It''s always a string - unfortunately again, I can''t put this code
2009 Jun 19
1
R on Mobile Devices (Android)
> > Hell R-list, > > > > At the cost of sounding far-fetched and almost incredulous, I would > > like to know if any R user is remotely considering the use of R on > > Mobile devices, and Android in particular. > > First, rewrite R in Java. Good luck with that! > > http://code.google.com/android/kb/general.html#c > > > I really do not have an
2006 Dec 08
2
trouble using ActiveRecord classes
I''ve been trying unsuccessfully for the better part of today to write a worker that can use by ActiveRecord model classes. The bizarre thing is that worker just stops at the point accessing the database connection. An exception isn''t raising, it just dies. My worker class is below, I''ve interspersed log messages throughout to try to determine where it is dying. =====
2011 May 19
1
update_attributes updates data from second instance of nested form but not the first
Got a weird situation with an update put to a controller with a form with nested attributes. On the data below, I am updating data for both items (''0'' and ''1'') in rosters_attributes (in the example below I am updating the ''name'' attribute to a new value in both cases. What I am stuck on is that ''1'' gets its data updated,
2010 Jun 08
2
type conversion with apply or not
Folks, i thought it should be straightforward but after a few hours poking around, I decided it's best to post my question on this list. I have a data frame consisting of a (large) number of date columns, which are read in from a csv file as character string. I want to convert them to Date type. Following is an example, where the first column is of integer type, while the rest are type
2013 Jan 29
2
Count entries in postgresql grouped by date
Hi! I have a table with visits with a visited_at: attribute which is a datetime field. They seem to be stored as UTC. Now I want to count all visits each day and return something like: { 2013-01-01: 8, 2013-01-02: 4, 2013-01-07: 9, ... } So, I did it like this which kind of works...: def self.total_grouped_by_day(start_date, end_date) visits = where(visited_at:
2006 Jun 25
1
Using AND in :conditions queries
I have what amounts to a simple search engine running through a table using input from a form. Everything works fine when looking for "title" or "body" But, when I want to couple that with an AND statement the search still works fine, but it seems to disregard the AND statements. Code below: In the view: <%= start_form_tag :action=> "show_search" %>
2006 Jun 25
3
Sorting results by column
I have the acts_as_ferret plugin installed. Everything searches great, but I would like to limit the results (i.e. by ''end_date'') and sort them (by ''end_date''). ''end_date'' is a valid column in my "posts" table. Here''s the code I have already: @posts = Post.find_by_contents(params[:query]) params[:query] comes from a
2004 Nov 08
2
Matrix Indexing
Hi, I have the following problem. In a csv file I have under column A, the date, and column B, the prices. Thus, for example, the file looks something like this -> 1/31/04 2.5 2/1/04 2.6 ... 4/12/04 3.5 Basically, I use the function inputframe = read.csv( ) which reads the csv file into the inputframe. My question is, how can I make a function that has, as inputs,
2013 Feb 26
4
3 models, joining and nested queries
I have 3 models, class Host ref: string address: string, name: string primary_key=''ref'' has_many :rooms, :class_name=>"Room", :foreign_key=>''host_ref'' Class Room ref :string host_ref: string capacity: integer primary_key=''ref'' has_many
2008 Nov 11
1
Every other week recurring event
I have the code for computing a weekly event: (start_date..end_date).select{|d| d.wday == wday} but I am wondering if anyone has any ideas for using this to figure out a recurring event for every other week. Is it possible to somehow specify every other within the .select method? Any other implementation ideas? --~--~---------~--~----~------------~-------~--~----~ You received this message
2007 Jul 08
2
datetime_select, is creating an instance of the Time class
Hello It seems that datetime_select, is creating an instance of the Time class. Why would that be? I found this while building a site where people can create vigils (prayer vigils, peace vigils, etc). When I added a validation method that compared start_date to created_at, it generated the error: ArgumentError (comparison of Time with DateTime failed): I was able to put a breakpoint in the
2006 Jun 15
1
Paginating a .find
how exactly would I apply paginate to a .find I have: @posts = Post.find(:all, :conditions => [ ''(title) OR (body) LIKE ?'', ''%'' + params[:query] + ''%''], :order => ''end_date'') How would I go about paginating the uoputed list? Something like 10 on a page. -- Posted via
2006 Jun 15
1
Multiple :conditions?
How do I add multiple conditions to a paginated list? I have: @post_pages, @posts = paginate(:posts, :per_page => 10, :conditions => [ ''(title) OR (body) LIKE ?'', ''%'' + params[:query] + ''%''], :order =>
2006 Jun 18
3
Ambiguous clause error
I''m trying to query one table to ultimately display the relate info from another table. I have 2 tables: "posts" and "numbers". I''m trying to do a query like this: @numbers = Number.find(:all, :conditions => [ ''(user_id) = :id'', {:id =>
2006 Apr 18
3
ez_where query question
I''m having fun composing queries with ez_where, but am stuck on how to formulate the following using the ez syntax: (begin_date >= ? OR end_date >= ?) AND (description LIKE ? OR name LIKE ?) There are two clauses, each containing OR operators (the ez ''any'' syntax) but both clauses must evaulate to true for a match. Can anyone suggest the proper way to construct