Re: [R] List of Words in BioWordVec

2024-02-03 Thread Martin Møller Skarbiniks Pedersen
On Fri, Feb 2, 2024, 01:37 TJUN KIAT TEO wrote: > Is there a way to extract list of words in BioWordVec in R > library(text) word_vectors <- textEmbed(texts = NULL, model = 'bioWordVecModel', model_type = 'wordvectors') word_list <- rownames(word_vectors$wordvectors) [[alternative

Re: [R] List of Words in BioWordVec

2024-02-01 Thread Jeff Newmiller via R-help
I thought so too, but Google suggests there is at least one package on CRAN with this symbol in it. OP: a) You should always mention which contributed package you are using. Most references to this term online seem to be related to Python rather than R. b) This seems like extremely

Re: [R] List of Words in BioWordVec

2024-02-01 Thread Bert Gunter
I *think* this might be better posted here: https://bioconductor.org/help/support/ Cheers, Bert On Thu, Feb 1, 2024 at 4:37 PM TJUN KIAT TEO wrote: > Is there a way to extract list of words in BioWordVec in R > > Thank you > > Tjun Kiat > > [[alternative HTML version deleted]] > >

[R] List of Words in BioWordVec

2024-02-01 Thread TJUN KIAT TEO
Is there a way to extract list of words in BioWordVec in R Thank you Tjun Kiat [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] List / Matrix to Data Frame

2021-07-02 Thread Sparks, John
Works like a charm. Thanks so much. --John Sparks From: Bill Dunlap Sent: Thursday, July 1, 2021 8:01 PM To: Sparks, John Cc: r-help@r-project.org Subject: Re: [R] List / Matrix to Data Frame Does this do what you want? > df <- data.frame(check.names

Re: [R] List / Matrix to Data Frame

2021-07-01 Thread Avi Gross via R-help
8186 5 2016-09-30 45687 84263 6 2015-09-30 53394 93626 It may be easier to work with this, but again, if you need the dates to be real dates, as in graphing. Hope that helps. -Original Message- From: R-help On Behalf Of Bill Dunlap Sent: Thursday, July 1, 2021 9:01 PM To

Re: [R] List / Matrix to Data Frame

2021-07-01 Thread Bill Dunlap
Does this do what you want? > df <- data.frame(check.names=FALSE, lapply(c(Date="date",netIncome="netIncome",`Gross Profit`="grossProfit"), function(nm)vapply(ISY, "[[", nm, FUN.VALUE=NA_character_))) > str(df) 'data.frame': 36 obs. of 3 variables: $ Date: chr "2020-09-30"

[R] List / Matrix to Data Frame

2021-07-01 Thread Sparks, John
Hi R-Helpers, I am taking it upon myself to delve into the world of lists for R. In no small part because I appear to have discovered a source of data for an exceptionally good price but that delivers much of that data in json format. So over the last day or so I managed to fight the list

Re: [R] create a r list from dataframe using the first column as list names

2020-04-10 Thread Bert Gunter
"I thought: why make this overly complicated,..." Indeed, though "complicated" is in the eyes of the beholder. One wonders whether any of this is necessary, though: see ?apply , as in apply(a, 1, whatever...) to do things rowwise. Cheers, Bert Bert Gunter "The trouble with having an open mind

Re: [R] create a r list from dataframe using the first column as list names

2020-04-10 Thread Rasmus Liland
On 2020-04-09 18:00 +, aiguo li wrote: | That is awesome! Thanks. Dear AiGuo, I thought: why make this overly complicated, when this is also possible: a <- matrix(LETTERS[1:16], nrow=4) X <- split(x=a[,-1], f=a[,1]) lapply(X=X, FUN=as.factor) Best, Rasmus

Re: [R] create a r list from dataframe using the first column as list names

2020-04-09 Thread Rasmus Liland
On 2020-04-09 18:00 +, aiguo li wrote: | That is awesome! Thanks. I'm glad this was helpful for you! __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] create a r list from dataframe using the first column as list names

2020-04-09 Thread Rasmus Liland
On 2020-04-09 18:50 +0100, Rui Barradas wrote: | Hello, | | Your post is unreadable, please repost in | *plain text*, not HTML. Hi! It was not so bad? I was able to extract out the core parts at least to prepare an answer ... maybe a bit hard with no line breaks, but ... Best, Rasmus

Re: [R] create a r list from dataframe using the first column as list names

2020-04-09 Thread Rui Barradas
Hello, Your post is unreadable, please repost in *plain text*, not HTML. Rui Barradas Às 16:00 de 09/04/20, aiguo li via R-help escreveu: Hello allI need to create a r list with each row as a list object and named with the element in the first column.  Illustrated below:> a<- as.data

Re: [R] create a r list from dataframe using the first column as list names

2020-04-09 Thread Rasmus Liland
On 2020-04-09 15:00 +, aiguo li via R-help wrote: | Hello allI need to create a r list with | each row as a list object and named with | the element in the first column.  Dear aiguo, Perhaps this fits your bill? a <- matrix(LETTERS[1:16], nrow = 4) FUN <- function(x) { as.facto

[R] create a r list from dataframe using the first column as list names

2020-04-09 Thread aiguo li via R-help
Hello allI need to create a r list with each row as a list object and named with the element in the first column.  Illustrated below:> a<- as.data.frame(matrix(LETTERS[1:16],nrow = 4))> a  V1 V2 V3 V41  A  E  I  M2  B   F  J  N3  C  G  K  O4  D  H  L  P I want the list looks like

Re: [R] List of data frame

2019-10-20 Thread ani jaya
Hai Rui, It seems doesnt work for me, the "" still there. So I used this one (Bert suggestion), test<-lapply(test,function(x){x$RR[x$RR==] <- NA; x}) Best, Ani On Sat, Oct 19, 2019 at 6:55 PM Rui Barradas wrote: > Hello, > > Why not use read.xlsx argument 'na.strings', an

Re: [R] List of data frame

2019-10-19 Thread Rui Barradas
Hello, Why not use read.xlsx argument 'na.strings', an argument that exists in many file reading functions? (read.table, and derivatives.) test <- lapply(sheets,function(i) { read.xlsx("rainfall.xlsx", sheet = i, startRow = 8, cols = 1:2, na.strings = "") })

Re: [R] List of data frame

2019-10-17 Thread Jim Lemon
Hi ani, Sorry, a typo in the function - should be: makeNA(x)<-function(x,varname,value) { x[,varname][x[,varname]==value]<-NA return(x) } Jim On Fri, Oct 18, 2019 at 2:01 PM Jim Lemon wrote: > > Hi ani, > You say you want to replace with NA, so: > > # it will be easier if you don't use

Re: [R] List of data frame

2019-10-17 Thread Jim Lemon
Hi ani, You say you want to replace with NA, so: # it will be easier if you don't use numbers for the names of the data frames names(test) <- paste0("Y",1986:2015) makeNA(x)<-function(x,varname,value) { x[,varname][x[,varname]<-value]<-NA return(x) } lapply(test,makeNA,list("RR",))

Re: [R] List of data frame

2019-10-17 Thread ani jaya
Thank you Mr. Bert, but my data frame is in the list, here 'test' list of data frame have 30 data frames (elements), names '1986' ~ '2015', and each data frame contain two variables, date and R. >a2<-rbind(test$`1987`) >is.na(a2$RR)<- a2$RR== Above is good enough but only for '1987'. Is it

Re: [R] List of data frame

2019-10-17 Thread Bert Gunter
I'm a little unclear, but maybe ?is.na . As in: > x <- c(1:3,) > x [1]123 > is.na(x) <- x== ## rhs is an "index vector" of logicals > x [1] 1 2 3 NA Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." --

[R] List of data frame

2019-10-17 Thread ani jaya
Dear R-Help, I have a list of data frame that I import from excel file using read.xlsx command. sheets <- openxlsx::getSheetNames("rainfall.xlsx") test <- lapply(sheets,function(i) read.xlsx("rainfall.xlsx", sheet=i, startRow=8, cols=1:2)) names(test) <- sprintf("%i", 1986:2015) And I got a

Re: [R] List of tables needed

2019-07-20 Thread David Winsemius
On 7/20/19 5:17 PM, Jackson Rodrigues wrote: Dear all, My name is Jackson and I need a help in applying functions to a list of tables. Could anyone help me to use loop/array on a list of tables ? I need to apply a group of functions (listed below) to a list of tables I am not that good

Re: [R] List of tables needed

2019-07-20 Thread Bert Gunter
?lapply See also the"Intro to R" tutorial that ships with R. We(or at least I) expect you to do your own homework learning basic R before posting here. This is not a substitute for such efforts, but we are willing to help when you get stuck. See the posting guide linked below and show us your own

[R] List of tables needed

2019-07-20 Thread Jackson Rodrigues
Dear all, My name is Jackson and I need a help in applying functions to a list of tables. Could anyone help me to use loop/array on a list of tables ? I need to apply a group of functions (listed below) to a list of tables I am not that good with loops or arrays or multiple functions. So,

Re: [R] list with list function

2019-02-05 Thread Andras Farkas via R-help
Thanks Rui and Ivan, works perfectly... Andras On Monday, February 4, 2019, 4:18:39 PM EST, Rui Barradas wrote: Hello, Like this? Map('[', listA, lapply(listB, '*', -1)) Hope this helps, Rui Barradas Às 21:01 de 04/02/2019, Andras Farkas via R-help escreveu: > Hello everyone, >

Re: [R] list with list function

2019-02-04 Thread Rui Barradas
Hello, Like this? Map('[', listA, lapply(listB, '*', -1)) Hope this helps, Rui Barradas Às 21:01 de 04/02/2019, Andras Farkas via R-help escreveu: Hello everyone, wonder if you would have a thought on a function for the following: we have a<-sample(seq(as.Date('1999/01/01'),

Re: [R] list with list function

2019-02-04 Thread Ivan Krylov
On Mon, 4 Feb 2019 21:01:06 + (UTC) Andras Farkas via R-help wrote: > listA<-list(a,b,c) > listB<-list(d,e,f) > > what I would like to do with a function <...> as opposed to manually > is to derive the following answer > > listfinal<-list(a[-d],b[-e],c[-f]) The `Map` function, unlike

[R] list with list function

2019-02-04 Thread Andras Farkas via R-help
Hello everyone, wonder if you would have a thought on a function for the following: we have a<-sample(seq(as.Date('1999/01/01'), as.Date('2000/01/01'), by="day"),5) b<-sample(seq(as.Date('1999/01/01'), as.Date('2000/01/01'), by="day"), 4) c<-sample(seq(as.Date('1999/01/01'),

Re: [R] list contingency tables

2018-11-09 Thread Bert Gunter
Yes, exactly (heh, heh). ?fisher.test is probably what is wanted. For arbitrary rxc tables with fixed marginals, this is a difficult problem. Mehta's efficient network algorithm to solve it can be found by a web search on "algorithm for Fisher exact test." -- Bert On Fri, Nov 9, 2018 at

Re: [R] list contingency tables

2018-11-09 Thread David Winsemius
Seems like you are trying to recreate the calculations needed to perform an exact test. Why not look at the code for that or even easier, just use the function. -- David. On 11/8/18 8:05 PM, li li wrote: Hi all, I am trying to list all the 4 by 2 tables with some fixed margins. For

Re: [R] list contingency tables

2018-11-09 Thread Jeff Newmiller
Don't give up on for loops entirely... some of the largest time savings in optimizing loops are achieved by managing memory effectively. [1] [1] https://www.r-bloggers.com/r-tip-use-vectormode-list-to-pre-allocate-lists On November 8, 2018 8:05:39 PM PST, li li wrote: >Hi all, > I am trying

[R] list contingency tables

2018-11-08 Thread li li
Hi all, I am trying to list all the 4 by 2 tables with some fixed margins. For example, consider 4 by 2 tables with row margins 1,2,2,1 and column margins 3,3. I was able to do it using the code below. However, as seen below, I had to first count the total number of tables with the specific

Re: [R] List of occuring values

2017-09-21 Thread Jim Lemon
Hi Ferri, Do you mean getting something like the vector of original values back? boodat<-sample(LETTERS[1:4],100,TRUE) bootab<-table(boodat) untab<-function(x) { lenx<-length(x) newx<-NULL for(i in 1:lenx) newx<-c(newx,rep(names(x)[i],x[i])) return(newx) } untab(bootab) Jim On Thu, Sep 21,

Re: [R] List of occuring values

2017-09-21 Thread William Dunlap via R-help
Note that this data.frame(table(...)) makes a column for each argument to table(...), plus a column for the frequencies so you can easily deal with multiway tabulations. > rawData <- data.frame( + sizes = c("Small", "Large", "Large", "Large"), + colors = c("Red", "Blue", "Blue", "Red"), +

Re: [R] List of occuring values

2017-09-21 Thread William Dunlap via R-help
unique(x) will give you the distinct values in x. table(x) will give you the distrinct values and their frequencies as an array with dimnames. data.frame(table(x)) will give you a 2-column data.frame with the distinct values and their frequencies. > values <- c("Small", "Large", "Large",

Re: [R] List of occuring values

2017-09-21 Thread David L Carlson
y Texas A University College Station, TX 77843-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ferri Leberl Sent: Thursday, September 21, 2017 8:01 AM To: r-help@r-project.org Subject: [R] List of occuring values Dear all, ftable produces a list of

[R] List of occuring values

2017-09-21 Thread Ferri Leberl
Dear all, ftable produces a list of the frequencies of all occuring values. But how about the occuring values? How can I retrieve a list of occuring values? How can I retrieve a table with both the list of occuring values and their respective frequencies? Thank you in advance, Yours, Ferri

Re: [R] list subselect by name ?

2017-09-09 Thread David Winsemius
> On Sep 9, 2017, at 11:45 AM, Andre Mikulec wrote: > > list subselect by name ? > - > > I have this 'list of two elements of named elements.' > >> list(letters=letters, LETTERS=LETTERS)[c("letters","LETTERS")] > > $letters > [1] "a" "b" "c"

[R] list subselect by name ?

2017-09-09 Thread Andre Mikulec
list subselect by name ? - I have this 'list of two elements of named elements.' > list(letters=letters, LETTERS=LETTERS)[c("letters","LETTERS")] $letters [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" [20] "t" "u" "v" "w" "x" "y" "z"

Re: [R] list with element "Class 'Date' num"

2017-04-07 Thread Jeff Newmiller
On Thu, 6 Apr 2017, Tintin wrote: Hi How do I create an element with specificiation " Class 'Date' num " The problem arises when I try to construct my own data structure set in the "termstrc" package. The model list should look like: R> str(govbonds$GERMANY) List of 8 $ ISIN : chr [1:52]

[R] list with element "Class 'Date' num"

2017-04-07 Thread Tintin
Hi How do I create an element with specificiation " Class 'Date' num " The problem arises when I try to construct my own data structure set in the "termstrc" package. The model list should look like: R> str(govbonds$GERMANY) List of 8 $ ISIN : chr [1:52] "DE0001141414" "DE0001137131"

Re: [R] List raster files

2017-03-05 Thread Robert Baer
On 3/4/2017 7:54 AM, Tomás Pérez C. wrote: I am working with raster images of modis of the satellites aqua and terra and I need to combine the images by its day and year (originally in Julian day). However, for the earth I have 6031 images and for aqua 5277. I want to know how to create an

[R] List raster files

2017-03-05 Thread Tomás Pérez C .
I am working with raster images of modis of the satellites aqua and terra and I need to combine the images by its day and year (originally in Julian day). However, for the earth I have 6031 images and for aqua 5277. I want to know how to create an object that selects the images for both folders

Re: [R] List funtion

2016-03-15 Thread Mohammad Tanvir Ahamed via R-help
| mashra...@yahoo.com - Original Message - From: André Luis Neves <andrl...@ualberta.ca> To: r-help@r-project.org Sent: Monday, 14 March 2016, 23:20 Subject: [R] List funtion Dear, I have the following data: v1 <- c(8,4,9,12) v2 <- c(7, 8, 11) my_list <- list(v1,v2) rep

Re: [R] List funtion

2016-03-15 Thread ruipbarradas
Hello, rep() is vectorized so you can do rep (my_list, 2:3) Hope this helps, Rui Barradas   Citando André Luis Neves : > Dear, > > I have the following data: > > v1 <- c(8,4,9,12) > v2 <- c(7, 8, 11) > my_list <- list(v1,v2) > rep (my_list,3) > > My question is how I

[R] List funtion

2016-03-15 Thread André Luis Neves
Dear, I have the following data: v1 <- c(8,4,9,12) v2 <- c(7, 8, 11) my_list <- list(v1,v2) rep (my_list,3) My question is how I can modify my command line to create a list called my_list containing two copies of the first vector (v1) and three copies of the vector 2 (v2). The above command

[R] List of Rserve integrations

2015-05-17 Thread Alex Fun
Hi R users, I am looking for examples of software that comes with an inbuilt connector to Rserve. The only thing I have found so far is Tableau: http://www.simafore.com/blog/bid/120209/Integrating-Tableau-and-R-for-data-analytics-in-four-simple-steps Please let me know if anyone knows of more

[R] list server problem?

2015-04-20 Thread Ivan Calandra
Dear all, I use Thunderbird 31.6.0 on Mac OS 10.6.8 to download my e-mails. Since this morning, Thunderbird downloads several times the same e-mails from the list, some even being from yesterday. It occurs only with e-mails from the R-help and not with my other professional and private

Re: [R] list server problem?

2015-04-20 Thread Martin Maechler
Dear all, I use Thunderbird 31.6.0 on Mac OS 10.6.8 to download my e-mails. Since this morning, Thunderbird downloads several times the same e-mails from the list, some even being from yesterday. It occurs only with e-mails from the R-help and not with my other professional and private

Re: [R] list output

2015-03-26 Thread MacQueen, Don
I don't think you are correctly keeping track of the structure of your objects. (and my email software may mess up the indentation, but I can't prevent it) I have not tested, but try replacing out[i]$phi_0 - x$phi_0 out[i]$maxlike - x$maxlike out[i]$bigp - x$bigp with out[[i]] -

Re: [R] list output

2015-03-26 Thread peter dalgaard
Erin, I think you'll have heard people requesting _reproducible_ examples several times by now... This one isn't. Offhand, I'd suspect that the issue has to do with your single-bracket indexing of the list out. Try out[[i]]. -Peter On 26 Mar 2015, at 19:22 , Erin Hodgess

[R] list output

2015-03-26 Thread Erin Hodgess
Hello! I am having some trouble with some list output. Here is my code: geobunch - function(y) { out - vector(list,3) aic - numeric(length=3) print(str(out)) for(i in 1:3) { x - geomin(y,i) print(i) print(x)

Re: [R] list output

2015-03-26 Thread Erin Hodgess
It's the double bracket issue. I replaced that, and all is well. Thanks to Peter and Don. Sincerely, Erin On Thu, Mar 26, 2015 at 3:21 PM, MacQueen, Don macque...@llnl.gov wrote: I don't think you are correctly keeping track of the structure of your objects. (and my email software may

Re: [R] list of list

2015-02-16 Thread peter dalgaard
On 16 Feb 2015, at 17:43 , Troels Ring tr...@gvdnet.dk wrote: Dear friends - this is simple I know but I can figure it out without your help. I have for each of 2195 instances 10 variables measured at specific times from 6 to several hundred, so if I just take one of the instances, I can

Re: [R] list of list

2015-02-16 Thread Jeff Newmiller
You have two named objects when your goal is to have one that contains five others. ASL - vector( list, 5 ) for (j in 1:5){ ASL[[j]] - vector( list, 5 ) for (i in 1:5) { ASL[[j]][[i]] - i^j } } --- Jeff Newmiller

[R] list of list

2015-02-16 Thread Troels Ring
Dear friends - this is simple I know but I can figure it out without your help. I have for each of 2195 instances 10 variables measured at specific times from 6 to several hundred, so if I just take one of the instances, I can make a list of the 10 variables together with their variable times.

Re: [R] list of list

2015-02-16 Thread jim holtman
Is this what you mean: ASL - list() for (j in 1:5){ RES - list() for (i in 1:5) RES[[i]] - i ^ j # create list ASL[[j]] - RES # store 'list of list' } Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to

Re: [R] list of list

2015-02-16 Thread Troels Ring
Thanks to Jim, Peter and Jeff who all saw the solution! Best wishes Troels Den 16-02-2015 kl. 18:46 skrev Jeff Newmiller: You have two named objects when your goal is to have one that contains five others. ASL - vector( list, 5 ) for (j in 1:5){ ASL[[j]] - vector( list, 5 ) for (i in

Re: [R] list of list

2015-02-16 Thread William Dunlap
You can let lapply() do the preallocation and the looping for you with ASL - lapply(1:5, function(j) lapply(1:5, function(i) i^j)) Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Feb 16, 2015 at 9:46 AM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: You have two named objects when

Re: [R] list of vectors which are part of an initial vector

2015-01-14 Thread Stefano Sofia
Thank you Jeff for your tips, I found what I was looking for. Stefano Da: Jeff Newmiller [jdnew...@dcn.davis.ca.us] Inviato: lunedì 12 gennaio 2015 9.13 A: Stefano Sofia; r-help@r-project.org Oggetto: Re: [R] list of vectors which are part of an initial

Re: [R] list of vectors which are part of an initial vector

2015-01-12 Thread Jeff Newmiller
library(gtools) running(1:5, fun=I, align=center, width=3, allow.fewer=TRUE)[c(-1,-7)] Clue found at http://stackoverflow.com/questions/1311920/lagging-variables-in-r --- Jeff NewmillerThe .

[R] list of vectors which are part of an initial vector

2015-01-11 Thread Stefano Sofia
Dear list users, given for example the vector a - c(1:5), which is the easiest way to create a list of 5 vectors with three elements each apart from the head and the tail, like 1 2 1 2 3 2 3 4 3 4 5 4 5 ? I tried to use the split command, with no success. Could somebody show me hints for an

Re: [R] list of lists, is this element empty

2014-12-21 Thread William Dunlap
Your 'x' has length 2, so x[[3]] cannot be calculated ('subscript out of bounds' is what I get). You can check for this with length(x)3. In general, you want to be more precise: 'does not have a value', 'is NULL', and 'is empty' are not synonymous. I'm not sure what 'does not have a value'

[R] list of lists, is this element empty

2014-12-20 Thread Ragia Ibrahim
Hello, Kindly I have a list of lists as follow x [[1]] [1] 7 [[2]] [1] 3 4 5 as showen x[[3]] does not have a value and it has NULL, how can I check on this how to test if x[[3]] is empty. thanks in advance Ragia [[alternative HTML version

Re: [R] list of lists, is this element empty

2014-12-20 Thread Ben Tupper
Hi, On Dec 20, 2014, at 10:58 AM, Ragia Ibrahim ragi...@hotmail.com wrote: Hello, Kindly I have a list of lists as follow x [[1]] [1] 7 [[2]] [1] 3 4 5 as showen x[[3]] does not have a value and it has NULL, how can I check on this how to test if x[[3]] is empty. In general

Re: [R] list of lists, is this element empty

2014-12-20 Thread Rui Barradas
Hello, Your list seems to have only 2 elements. You can check this with length(x) Or you can try lapply(x, is.null) Hope this helps, Rui Barradas Em 20-12-2014 15:58, Ragia Ibrahim escreveu: Hello, Kindly I have a list of lists as follow x [[1]] [1] 7 [[2]] [1] 3 4 5 as showen x[[3]]

Re: [R] list of lists, is this element empty

2014-12-20 Thread Boris Steipe
This can be tricky, because depending on what the missing object is, you can get either NULL, NA, or an error. Moreover is.na() behaves differently when evaluated on its own, or as the condition of an if() statement. Here is a function that may make life easier. The goal is NOT to have to pass

Re: [R] list of lists, is this element empty

2014-12-20 Thread Bert Gunter
Boris et. al: Indeed, corner cases are a bear, which is why it is incumbent on any OP to precisely define what they mean by, say, missing, null,empty, etc. Here is an evil example to illustrate the sorts of nastiness that can occur: z - list(a=NULL, b=list(), c=NA) with(z,{ +

Re: [R] list of lists, is this element empty

2014-12-20 Thread Duncan Murdoch
This may be out of context, but on the face of it, this claim is wrong: On 20/12/2014, 1:57 PM, Boris Steipe wrote: Moreover is.na() behaves differently when evaluated on its own, or as the condition of an if() statement. The conditions in an if() statement are not evaluated in special

Re: [R] list of lists, is this element empty

2014-12-20 Thread Boris Steipe
Thanks. This is what I was referring to: x - rep(NA, 3) is.na(x) [1] TRUE TRUE TRUE if (is.na(x)) {print(True)} [1] True Warning message: In if (is.na(x)) { : the condition has length 1 and only the first element will be used You are of course right - the warning is generated by if(), not by

Re: [R] List of Lists by for Loop

2014-07-15 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Munjal Patel Sent: Monday, July 14, 2014 8:45 PM To: r-help@r-project.org Subject: [R] List of Lists by for Loop Dear Experts, I have a one more doubt about making list

Re: [R] List of Lists in For Loop

2014-07-15 Thread Adams, Jean
Munjal, Something like this should work: Digits = c(20, 30, 40, 50, 60) result = vector(length(Digits), mode=list) names(result) = Digits for(j in seq(Digits)) { a = vector(Digits[j], mode=list) b = vector(Digits[j], mode=list) for(i in 1:Digits[j]) { #Do Calculation a[[i]] = data.frame()

[R] List of Lists by for Loop

2014-07-14 Thread Munjal Patel
Dear Experts, I have a one more doubt about making list of lists. Here is the simple code i have made. I am doing the following for only one digit=20 a=vector(20,mode=list) b=vector(20,mode=list) for (i in 1:20){ #Do Calculation a[[i]]=data.frame() b[[i]]=data.frame() } Now i have

[R] List of Lists in For Loop

2014-07-14 Thread Munjal Patel
Dear Experts, I have a one more doubt about making list of lists. Here is the simple code i have made. I am doing the following for only one digit=20 a=vector(20,mode=list) b=vector(20,mode=list) for (i in 1:20){ #Do Calculation a[[i]]=data.frame() b[[i]]=data.frame() } Now i have to

Re: [R] list of valid R encodings.in source(...,encoding=)

2014-07-11 Thread Hadley Wickham
It's documented in the Encodings section of ?file: As from R 3.0.0 the encoding UTF-8-BOM is accepted for reading and will remove a Byte Order Mark if present (which it often is for files and webpages generated by Microsoft applications). If it is required (it is not recommended) when writing it

[R] list of valid R encodings.in source(...,encoding=)

2014-07-10 Thread John McKown
This question was spawned by another thread entitled R on Windows crashes when source'ing UTF-8 file. The solution to that problem was to use the _proper_ encoding= parameter of the source() function. But where are they documented? Or how do I find them in R itself? I ask because the proper

Re: [R] List of Dataframes

2014-04-22 Thread Timothy W. Cook
On Mon, Apr 21, 2014 at 10:01 PM, arun smartpink...@yahoo.com wrote: Hi, #or you could use: do.call(rbind,result) A.K. Excellent. Thank you. That also saves a library requirement sine I am not using plyr anywhere else. Cheers, Tim On Monday, April 21, 2014 4:48 PM, Timothy W. Cook

Re: [R] List of Dataframes

2014-04-22 Thread Timothy W. Cook
On Tue, Apr 22, 2014 at 12:24 AM, Jim Holtman jholt...@gmail.com wrote: also do.call(rbind, result) Thanks Jim. I appreciate it. Sent from my iPad On Apr 21, 2014, at 16:47, Timothy W. Cook t...@mlhim.org wrote: Okay, all day on this and I send the msg. and almost immediately

[R] List of Dataframes

2014-04-21 Thread Timothy W. Cook
I am processing an arbitrary number of XML files and extracting specific nodes. I then create a dataframe for each nodeset. I return a list containing these dataframes. Example: str(result)List of 2 $ :'data.frame': 1 obs. of 5 variables: ..$ data-name : chr Etiologic diagnosis

Re: [R] List of Dataframes

2014-04-21 Thread Timothy W. Cook
Okay, all day on this and I send the msg. and almost immediately discover that: dat - ldply(result) solves the problem. On Mon, Apr 21, 2014 at 5:40 PM, Timothy W. Cook t...@mlhim.org wrote: I am processing an arbitrary number of XML files and extracting specific nodes. I then create a

Re: [R] List of Dataframes

2014-04-21 Thread arun
Hi, #or you could use: do.call(rbind,result) A.K. On Monday, April 21, 2014 4:48 PM, Timothy W. Cook t...@mlhim.org wrote: Okay, all day on this and I send the msg. and almost immediately discover that: dat - ldply(result) solves the problem. On Mon, Apr 21, 2014 at 5:40 PM, Timothy W.

Re: [R] List of Dataframes

2014-04-21 Thread Jim Holtman
also do.call(rbind, result) Sent from my iPad On Apr 21, 2014, at 16:47, Timothy W. Cook t...@mlhim.org wrote: Okay, all day on this and I send the msg. and almost immediately discover that: dat - ldply(result) solves the problem. On Mon, Apr 21, 2014 at 5:40 PM, Timothy W.

Re: [R] list and -

2013-10-22 Thread Taiyun Wei
Many thanks:) I have a list(), eg. named opt, I want to check and assign values to it: if(is.null(opt$a)) opt$a = 'x' if(is.null(opt$b)) opt$a = 'y' ... I need to do a lot of these jobs, so I write a function to simplify it: '%=%' = function(x, y){ if(is.null(x)) { x - y } }

Re: [R] list and -

2013-10-22 Thread Greg Snow
Look carefully at your output (and I don't think that you are showing us the output of what you actually ran in the order that you ran it). After running `x %=% 1` you should see that x has the value `1`, but your output shows `2`, this is the result of the next command `y$a %=% 2`, see the `-`

Re: [R] list and -

2013-10-21 Thread Greg Snow
See fortune(174). It is best to avoid using '-', if you tell us what you are trying to accomplish then we may be able to provide a better means to accomplish it. On Sat, Oct 19, 2013 at 10:28 PM, Taiyun Wei weitai...@gmail.com wrote: Dear All, opt = list() opt$aa - TRUE Error in opt$aa -

Re: [R] list and -

2013-10-20 Thread David Winsemius
On Oct 19, 2013, at 9:28 PM, Taiyun Wei wrote: Dear All, opt = list() opt$aa - TRUE Error in opt$aa - TRUE : object 'opt' not found Try _not_ using `-` Why? There wasn't an object by htat name in the enclosing environment. -- David Winsemius Alameda, CA, USA

[R] list and -

2013-10-19 Thread Taiyun Wei
Dear All, opt = list() opt$aa - TRUE Error in opt$aa - TRUE : object 'opt' not found Why? -- Regards, Taiyun -- Taiyun Wei weitai...@gmail.com Homepage: http://blog.cos.name/taiyun/ Phone: +86-15201142716 Renmin University of China __

Re: [R] list to matrix

2013-09-11 Thread PIKAL Petr
. maybe sapply(lapply(your.list, coef), rbind) can do it. Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of eliza botto Sent: Wednesday, September 11, 2013 4:23 PM To: r-help@r-project.org Subject: [R] list

Re: [R] list to matrix

2013-09-11 Thread arun
,]  0.01788307 -0.5624307 A.K. - Original Message - From: eliza botto eliza_bo...@hotmail.com To: r-help@r-project.org r-help@r-project.org Cc: Sent: Wednesday, September 11, 2013 10:22 AM Subject: [R] list to matrix Dear useRs, If i have a list of the following form and i want to convert

Re: [R] list to data frame

2013-08-28 Thread arun
Hi, set.seed(249) dat1- as.data.frame(matrix(sample(1:20,40*20,replace=TRUE),ncol=20)) #Based on your code:  vecNew-sort(t(as.data.frame(lapply(dat1,sum))),decreasing=TRUE)[1:10] #or vec1-sort(unlist(lapply(dat1,sum),use.names=FALSE),decreasing=TRUE)[1:10]  identical(vec1,vecNew) #[1] TRUE

Re: [R] List of lists

2013-08-01 Thread mohan . radhakrishnan
Re: [R] List of lists Jim Lemon

Re: [R] List of lists

2013-07-31 Thread mohan . radhakrishnan
of class c ('integer', 'numeric') Thanks, Mohan Re: [R] List

[R] List of lists

2013-07-30 Thread mohan . radhakrishnan
Hi, I am creating a list of 2 lists, one containing filenames and the other file descriptors. When I retrieve them I am unable to close the file descriptor. I am getting this error when I try to call close(filedescriptors [[2]][[1]]). Error in UseMethod(close) : no applicable

Re: [R] List of lists

2013-07-30 Thread Jim Lemon
On 07/30/2013 10:05 PM, mohan.radhakrish...@polarisft.com wrote: Hi, I am creating a list of 2 lists, one containing filenames and the other file descriptors. When I retrieve them I am unable to close the file descriptor. I am getting this error when I try to call

[R] list of valid characters in object names

2013-07-27 Thread Liviu Andronic
Dear all, Could someone please point me to the definitive list of valid characters that are allowed in object names in R? I believe that the following list covers them: _.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 but I would like to make sure. Thank you, Liviu -- Do you

Re: [R] list of valid characters in object names

2013-07-27 Thread Duncan Murdoch
On 13-07-27 7:36 AM, Liviu Andronic wrote: Dear all, Could someone please point me to the definitive list of valid characters that are allowed in object names in R? I believe that the following list covers them: _.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 but I would like

Re: [R] list of valid characters in object names

2013-07-27 Thread Liviu Andronic
On Sat, Jul 27, 2013 at 3:08 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: Your question is a little ambiguous. All characters are allowed in object names, but the parser will only recognize some of them if they are quoted in backticks. The ones it recognizes without the backticks are

[R] Is it possible (/reasonable) to write an as.RefClass function for R list class?

2013-07-26 Thread Tal Galili
Hello all. I am interested in creating a mutable list object in R. Ideally I would do it through something like this: x - list(a = list(1:4), b = miao, c = 4:1) x_RC - as.RefClass(x) attr(x_RC[[2]], I am) - string x_RC[[3]] - x_RC[[3]]+1 x_new - as.list(x_RC) Is that reasonably possible to

Re: [R] Is it possible (/reasonable) to write an as.RefClass function for R list class?

2013-07-26 Thread Jeff Newmiller
Reference classes are implemented with environment objects, which are mutable. Once you convert to list, the converted object is not mutable, since there is no such thing as a mutable list. So I would say your request is not possible.

  1   2   3   4   5   >