Displaying 20 results from an estimated 1000 matches similar to: "efficient list indexing"
2012 Dec 22
1
plotting and saving diagrams automatically
[if the format of my email is changed or is difficult to understand, a text file is attached for easy understanding]Dear useRs,
i was wondering that if its possible in R to automatically generate plots and get it saved at the desired location? i have
data of cancer patients, from about 1000 cities around the world. i have converted that data into a list (called tcp) and
that list has 1000
2001 Mar 01
2
Individual rename of list items
I am confused by the logic of renaming:
# Rename individual list items?
Empl<-list(employee="Anna",spouse="Fred")
names(Empl)<-c("empl","spo")
names(Empl)
#[1] "empl" "spo"
# worked like a charm... but
names(Empl[1])<-"newempl"
# no error message, yet ....
names(Empl)
#[1] "empl" "spo"
#
2011 Oct 14
3
Split a list
I have a list of dataframes i.e. each list element is a dataframe with three columns and differing number of rows. The third column takes on only two values. I wish to split the list into two sublists based on the value of the third column of the list element.
Second issue with lists as well. I would like to reduce each of the sublist based on the range of the second column, i.e. if the range of
2013 Oct 26
1
Compare two lists, with their sublists that have same structure
Dear all,
I would like to ask your help concering two R lists.
If I did everything should have the same structure (that means the same number of sublists, and their sublists also the same number of sublists). What would change between the two lists is the contents of each element in the lists.
Could you please help me understand how I can do that in R?
I would like to thank you in advance for
2008 Jul 01
1
extracting elements from a list in vectorized form
Hi;
It seems to me that has probably been asked in the past. But I cannot find
the track.
I usually need to extract elements from a list and contruct vector from
them; e.g., to create a table. Perhaps there is a way to directly extract
them without looping?
Simple example:
> S.lst
$sublist.1
$sublist.1$age
[1] 24.58719
$sublist.1$weight
[1] 60.82861
$sublist.2
$sublist.2$age
[1] 32.39551
2007 Feb 22
3
List filtration
Hello R-ologists,
Imagine you have a list "list" like so:
>list
[[1]]
[1] "IPI00776145.1" "IPI00776187.1"
[[2]]
[1] "Something" "IPI00807764.1" "IPI00807887.1"
[[3]]
[1] "IPI00807764.1"
[[4]]
[1] "Somethingelse"
What I need to achieve is a filtered list "list2" like so:
>list2
[[1]]
[1]
2012 Mar 14
2
Apply a loop containing a function on a list
Hi all,
I want to do this:
B.list$aa= (a loop containing My.fun acting on the reults of second
function on a A.list$aa))
or, overally
B.list$aa = function (A.list$aa)
B.list and A.list has many sublists aa, ab and.... Is there a way I can
apply the function and loop on all sublists of A.list and get B.list?
Thanks in advance.
--
View this message in context:
2008 Nov 04
2
strange list structure question
my problem is more complex than below but I think below can suffice. i
have a list and the name of it at the top level is GGG. so, if i do an
lapply and operate on lower components in the sublist, then I can do as
shown in EXAMPLE 1 and what will come back will be named GGG at the top
level.
but, suppose that , the function inside the lapply function was more
complex and i wanted to
2009 Mar 15
4
primitives again
Dear R Gurus:
How do I find the functions which are primitives, please?
Thanks,
Edna Bell
2011 Aug 04
2
How to extract sublist from a list?
Hi everyone,
Suppose I have a list named "lst", see below:
> lst
$sub1
...
$sub1$x
...
$sub1$y
....
$sub2
...
$sub2$x
...
$sub2$y
?
$sub3
...
...
...
Now, I want to extract the sub-sublist $y from every sublist(sub1, sub2...)
and then storage them to a new list.
I know how to extract them by subscript or list name one by one, but I
wonder if there exist some tricks to finish this
2006 Jul 02
4
:order in partial
Hi,
i was looking through the docs and couldn''t find a good clean solution
for ordering a partial with an :order clause.
say i was iterating over categories and thier corresponding
sub-categories (regular belongs to) and wanted to order the
subcategories according to a certain column;
<% for category in @categories %>
<% render: partial => ''sublist'',
2005 Nov 30
4
migrate profile from an old server to a new one - SID and ntuser.dat problem
Hi,
my problem is the following:
i am trying to replace an old SUSE 8.2, Samba 2.2
domain controller with a SUSE 9.3 system with samba
3.0 as PDC.
Everything works fine, i can join the new domain, i
replaced the machine and domain sid from the new
server with the old ones.
But how can reuse the profiles from the old machine
at the new one?
If i make a simple remote copy, the settings of the
2012 Jun 11
1
saving sublist lda object with save.image()
Greetings R experts,
I'm having some difficulty recovering lda objects that I've saved within sublists using the save.image() function. I am running a script that exports a variety of different information as a list, included within that list is an lda object. I then take that list and create a list of that with all the different replications I've run. Unfortunately I've been
2013 Jan 07
2
list of lists to matrix
dear R family,
[a text file has been attached for better understanding]
i have a list of 16 and each of of that is further subdivided into variable number of lists. So, i have a kind of list into lists phenomenon.
[[1]]$'1'
1 2 3 4 5 6
7 8 9
[[1]]$'2'
1 2 3 4 5 6
7 8 9
i want to convert both these sublists into
2016 Sep 26
2
Recursive dir.create() on Windows shares
Hi folks,
I've noticed that there's an issue with the recursive creation of
directories that reside on network shares. For example:
>
dir.create('\\\\SERVERNAME\\Empl\\Home1\\active\\e\\ecortens\\thisisatest',
recursive = TRUE)
Warning message:
In
dir.create("\\\\SERVERNAME\\Empl\\Home1\\active\\e\\ecortens\\thisisatest",
:
cannot create dir
2006 Oct 30
2
which duplicated rows to delete
Hi
Say I've this vector with several duplicates
>x<-c(1,2,3,4,2,6,2,8,2,3)
>which(duplicated(x))
[1] 5 7 9 10 11
But what I realy want is somthing like:
List({2,5,7}, {3,10}, ...)
Then from each sublist I can specify which of the duplicate items to drop
res<-NULL
for(vec in myDuplicateList)
res<-rbind(res, subset(data[vec,], myCrit))
I'll get some of the way by
2008 May 14
4
Accessing items in a list of lists
Using R 2.6.2, say I have the following list of lists, "comb":
data1 <- list(a = 1, b = 2, c = 3)
data2 <- list(a = 4, b = 5, c = 6)
data3 <- list(a = 3, b = 6, c = 9)
comb <- list(data1 = data1, data2 = data2, data3 = data3)
So that all names for the lowest level list are common. How can I most
efficiently access all of the sublist items "a" indexed by the outer
2015 Oct 09
3
reverse object creation
Dear all,
this is my first message to this mailing list - please advise if it is not
the right place for the subject
I've been using R very intensively the last 3-4 years and one of the most
tedious tasks is modification of lookup or conversion tables
So far, I have not found functions that create the commands for creating
objects (vectors, data frames) based on the objects themselves -
2016 Aug 17
5
code to sort otherwise-unsortable "ilist"s, e.g. symbol tables
Dear all,
The below has been tested quite thoroughly by now, including performance-testing by the way of
using a modified compiler that triggers the below while compiling at least an old part of LLVM
["Function.cpp"] and sorting a symbol table with >7000 global variables.
Unfortunately, the optimization I have been working on for which I _thought_ I needed the
ability to sort a
2006 Jan 13
5
Form field naming semantics question
Hi,
I have a question today regarding how the various form elements in
_form.rhtml are named.
I understand that for a database table "persons" with a column headed by
"name", then in _form.rhtml it will probably be like:
<p><label for="person_name">Name><br/>
<%= text_field ''person'', ''name''