Displaying 20 results from an estimated 2000 matches similar to: "Matrix and list indices"
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
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
2008 Jan 08
1
storing matrices in a list or vector and preserve dimensions
Hi all,
As an R newbie, I wonder how I can store multiple matrices in a list()
or vector() object without losing their structure. I should be able to
retrieve the matrix from the list later on.
If I just append() the matrices to a list() object, they automatically
lose their dimensions, whereas I would like to preserve the dimensions
of the matrices.
Is there any function in R which allows
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 Oct 07
1
iplots
Hi guys,
I am trying to plot a scatterplot with lines instead of with points using function iplot in library iplots.
The best I can come up with is
x =(1:100)
y = rnorm(100)
iplot(x,y,ptDiam=0)
ilines(x,y)
Do you guys know of any paramter to set the "type" in iplot or iplot.opt?
Thanks,
Fernando ?lvarez
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 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
2010 Oct 08
6
Selección de observaciones
Hola a todos.
Estoy atascado en un sitio que no me he encontrado antes, debe ser fácil y
rápido, a ver si alguien me puede ayudar.
Puesto fácil, tengo:
> aa <- matrix(11:19,3,3)
> aa
[,1] [,2] [,3]
[1,] 11 14 17
[2,] 12 15 18
[3,] 13 16 19
Quiero la fila cuyo primer elemento es 12 y el segundo 15.
> aa[aa[,1:2] == (c(12,15)),]
Error: (subscript) logical
2011 Oct 03
1
Matrix/Vector manipulation
Hi guys,
Have the following problem computing vectors with pure vector algebra and end up reverting to recursion or for-looping.
Function my_cumsum calculates a weighted average (W) of ratios (R), but only up to the given size/volume (v). Now I recurse into the vector (from left to right) with what you have left from the difference of volume minus current weight, and stop when the difference is
2020 Jan 15
4
[cfe-dev] Phabricator -> GitHub PRs?
On 1/15/20 6:50 PM, David Greene wrote:
> "Doerfert, Johannes via llvm-dev" <llvm-dev at lists.llvm.org> writes:
>
>>> Nowadays we have tools to manage the stacks for us [1][2], and that as a
>>> plus don't require arc/php to be installed on your system.
>>>
>>> I don't do much LLVM / clang stuff, but submitting stuff with [1] just
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
2011 Feb 04
2
All DomU failing SSLv3 handshake (curl, apt-get, wget, etc.) but OK on Dom0
Hi,
First of all I''ve googled this subject a lot (several hours) but right now I''m simply stuck. All my 4 DomU fails SSL handshake:
> niklas@stats:~$ curl -vI https://graph.facebook.com
> * About to connect() to graph.facebook.com port 443 (#0)
> * Trying 69.63.181.58... connected
> * Connected to graph.facebook.com (69.63.181.58) port 443 (#0)
> * successfully
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