similar to: storing matrices in a list or vector and preserve dimensions

Displaying 20 results from an estimated 700 matches similar to: "storing matrices in a list or vector and preserve dimensions"

2008 Feb 05
2
dynamically add items to key of lattice xyplot
Hi all, is it possible to dynamically add key items to an already existing key, belonging to a lattice xyplot? This is what I do: I make an xyplot with an initial key. Later on, I want to extend this key with more items, as more lines are added to the plot (lines are added using trellis.focus("panel")). I guess I need some function to access the key panel in order to extend it,
2011 Sep 27
2
Matrix and list indices
Hi guys, I am trying to replace all elements of earth that are equal to zero with their corresponding elements in mars. I can do the replace with a bunch of for-loops, but I don't think this is the R way of doing things. my_list <- list( earth=array(c(0,0,45,0,0,45,0,45),dim=c(2,2,2)), mars=array(c(8:1),dim=c(2,2,2))) my_list for (i in c(1:2)) { for (j in c(1:2)) {
2013 Feb 14
3
list of matrices --> array
i'm somehow embarrassed to even ask this, but is there any built-in method for doing this: my_list <- list() my_list[[1]] <- matrix(1:20, ncol = 5) my_list[[2]] <- matrix(20:1, ncol = 5) now, knowing that these matrices are identical in dimension, i'd like to unfold the list to a 2x4x5 (or some other permutation of the dim sizes) array. i know i can initialize the array, then
2008 Jan 31
1
decrease amount of ticks on y axis in lattice levelplot
Hi all, How can I decrease the number of ticks on the y-axis in a lattice levelplot()? I have as many ticks displayed on the y-axis as I have columns of data (1000 columns), how can I decrease this amount of ticks, while still properly displaying all the data? Note that I get my data from a matrix object, in which the z-values of the levelplot are the actual values in the matrix, whereas the
2013 Aug 14
1
local variable assignment: first copies from higher frame?
hi all -- this might not be the correct list for this question/discussion, though R-help didn't seem like the correct venue, either, so... i'm looking for just some extra clarification of how local variables are defined/bound, beyond the simple cases given in the Language document. the particular instance is when there is variable assignment inside a function. normally, this creates a
2012 Feb 29
2
Using a FOR LOOP to name objects
Hello, I am trying to use a for loop to name objects in each iteraction. As in the following example (which doesn't work quite well) my_list<-c("A","B","C","D","E","F") for(i in c(1:length(my_list))){ url<- "http://finance.yahoo.com" doc = htmlTreeParse(url, useInternalNodes = T) tab_nodes = xpathApply(doc,
2013 Nov 26
1
dynamic lists at C level
Dear R-devel, I am trying to do something similar to dynamic length lists in R, but at C level. In R, that would be rather trivial: - determine the length of the list - create the list object - store the values for each component - access value components by using "[[" At C level, for a single component where I need to store a vector of length 5, I do: int *p_result; SEXP my_list =
2006 Apr 07
3
RJS removing content of div, but not div itself
Hi, I''m creating a list of ingredients on a page. When the user clicks the ''Add Ingredient'' button a record gets added to the db and the ingredient gets added to the page. On the page, each record is represented by a <div> with three <span>s inside. One of the <span>s has a link_to_remote to ''delete'' the ingredient. When the link
2011 Jul 17
1
function design: multiple imput names
dear all, a simple question, I need to write a function in which I retrive an undetermined number of vector in the function. I solved the problem thanks to this link http://stackoverflow.com/questions/2540232/how-to-allow-multiple-inputs-from-user-using-r so my function will look alike this my_fun <- function(...){ my_list <- lapply(..., function(x){x}) } I need just one more
2006 Dec 28
2
lattice xyplot: plot multiple lines with different colors
Hi everyone, I am using the lattice package to plot some simulation results, by using the function xyplot(). However, I cannot find a way to plot multiple lines within the same xyplot and to have each of the lines be drawn in a different color. This is what I am currently doing: xyplot(a + b + c ~ x, my_data, panel = panel.lines) but, of course, all lines are drawn in the same color. What
2006 Apr 03
3
Ready to call this a bug
I''ve been trying to get a handle on AJAX today and am ready to call "BUG!" I started with the code from Curt''s "AJAX on Rails". It used <ul="my_list"> and <li> and worked fine. Except I need a table instead of a list. So I did the simplest thing that I thought could possibly work. In the view, I changed the :position attribute from
2009 Sep 05
5
Filling Wx::ListCtrl with contents
Hi all, I''ve got a question concerning ListCtrl_virtual of wxRuby since I see no way filling the list with dynamic contents. I''m new to Ruby so I maybe have to apologise for my request. The problem is, that I have to define the on_get_item_text(item, col) function. There I would like to use the item and col variables to read data from a two-dimensional array. My very problem
2009 Jun 28
1
applying a function to a pair of components for each row of a list
Hi, I have a set of (x,y) coordinate pairs that are stored as a list > my_list $x [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 $y [1] -8.0866819 -7.3876052 -6.6849311 -5.9837693 -5.2967432 -4.6525466 [7] -4.0999453 -3.6556190 -3.3076102 -3.0360780 -2.8220465 -2.6532085 [13] -2.5192816 -2.4086241 -2.3072977 -2.1969611 -2.0574250 -1.8737694 [19] -1.6357864
2006 Jun 21
2
Using RJS to highlight one LI if using insert_html on an UL?
It seems common to use RJS for quickly adding and highlighting a list that is having content added to it like this: http://rafb.net/paste/results/Z3m32g48.html ... where "my_list" would be an UL and the partial would insert a LI. Given that example, is there an easy way to highlight only the newly inserted LI instead of the whole UL? The only way I can see to do it is to give
2009 Oct 24
6
Working with ListCtrl and ListItem
Hi List, I''m trying to get my ListCtrl to work. Currently I''ve managed to fill my ListCtrl with items, but I think it''s not the most beautiful way: class MyList < Wx::ListCtrl def initialize(parent, *args) super(parent, :style => Wx::LC_REPORT|LC_HRULES ) create_layout fill_list end def create_layout self.insert_column(0, "Name")
2005 Jun 29
1
Can't build cdr_addon_mysql.
I have been unable to build cdr_addon_mysql from asterisk-addons-1.09. Could it be a mysql4 issue [root@server9 asterisk-addons-1.0.9]# make cdr_addon_mysql cc -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql -c -o cdr_addon_mysql.o cdr_addon_mysql.c cdr_addon_mysql.c:24:22: asterisk.h: No such file or directory I have MySQL devel # ls /usr/include/mysql/ total 404 drwxr-xr-x 2
2006 Jan 30
3
RMySQL install
I am having trouble installing RMySQL on a clean install of Fedora Core 4 64 bit on a dual dual core machine (that is, two dual core processors). Seems like the LD_LIBRARY_PATH is incorrect, but I don't seem to have it quite right yet. There are a few mentions of this problem in google, but thus far none of the "fixes" and fixed my problem. I've tried defining the
2005 Dec 20
0
Dynamic fields creation and accessing data
Hi friends , I was trying this code and finding some errors.I am trying this to implement dynamic creation of invoice items in invoices using AJAX .Please go thru . I added a partial :: <% @invoiceitem = invoiceitem -%> <%= text_field ''invoiceitem'', ''item_price'', ''index'' => invoiceitem_counter %> <%= text_field
2005 Dec 23
0
adding items to a particular invoice on the same page
Hi, I have been building a invoice generator(in ruby on rails) for the past some days and been stuck on the final page .This page will have fields for entering the invoice details and also I have added a AJAX effect so that fields for invoice items get created dynamically . its all design well but the issue comes when I am trying to save the page .That is adding ivoice details to invoices
2008 Feb 21
7
looping through a list
what is the proper way to loop through a list in a rails view (assuming that you need to check if it is empty or not) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to