[R] where is a value in my list

2009-11-15 Thread Grzes
I heve got a list: lista=list() a=c(2,4,5,5,6) b=c(3,5,4,2) c=c(1,1,1,8) lista[[1]]=a lista[[2]]=b lista[[3]]=c lista [[1]] [1] 2 4 5 5 6 [[2]] [1] 3 5 4 2 [[3]] [1] 1 1 1 8 I would like to know where is number 5 (which line)? For example I have got a loop: k= vector(mode

Re: [R] where is a value in my list

2009-11-15 Thread Grzes
But it's not what I wont I need get a number of line my list 5 is in: list[[1]][1] and list[[2]][1] so I would like to get a vector k = 1,2 David Winsemius wrote: On Nov 15, 2009, at 10:01 AM, Grzes wrote: I heve got a list: lista=list() a=c(2,4,5,5,6) b=c(3,5,4,2) c=c(1,1,1,8

Re: [R] where is a value in my list

2009-11-15 Thread Grzes
It's excellent! Now, if I have a vector k=c( TRUE, TRUE, FALSE) how I may get lines from list? which (list ?? k) ? David Winsemius wrote: On Nov 15, 2009, at 10:47 AM, Grzes wrote: But it's not what I wont I need get a number of line my list 5 is in: list[[1]][1] and list[[2]][1

[R] write data frame in a list

2009-11-10 Thread Grzes
Hi, I have got a data frame: df=data.frame(x=c(3,6,7),y=c(2,7,4)) and I would like to write my values from data frame to list using loop, for example: lista=list() for (i in 1: length(?)){ lista[[?]][?] = df [?] } But I havn't got any idea what I should put in places where I put a

Re: [R] write data frame in a list

2009-11-10 Thread Grzes
at 6:05 AM, Grzes gregori...@gmail.com wrote: Hi, I have got a data frame: df=data.frame(x=c(3,6,7),y=c(2,7,4)) and I would like to write my values from data frame to list using loop, for example: lista=list() for (i in 1: length(?)){        lista[[?]][?] = df [?] } But I havn't got any

[R] Find the first values in vector

2009-11-09 Thread Grzes
Hi ! I have a vector: vec= TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE and I'm looking for a method which let me get only the first values equal TRUE from this vector. It means that I want to get a vector: vec_out = TRUE TRUE TRUE TRUE or posictions values = TRUE:

Re: [R] Find the first values in vector

2009-11-09 Thread Grzes
Thank You All Very Much :jumping: baptiste auguie-5 wrote: Hi, One way would be, vec[ cumsum(!vec)==0 ] HTH, baptiste 2009/11/9 Grzes gregori...@gmail.com: Hi ! I have a vector: vec= TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE TRUE  TRUE  FALSE and I'm looking

[R] Java and R

2009-11-09 Thread Grzes
Hello, I'm looking for any manual about using Java and R for begginers. Do you know any? -- View this message in context: http://old.nabble.com/Java-and-R-tp26275500p26275500.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Find the first values in vector

2009-11-09 Thread Grzes
Thank You All Very Much :jumping: Dimitris Rizopoulos-4 wrote: yet another solution is: vec - c(TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE) seq_len(rle(vec)$lengths[1]) I hope it helps. Best, Dimitris Grzes wrote: Hi ! I have a vector: vec

[R] ipredknn - How may I find values?

2009-10-27 Thread Grzes
Hi everybody! I want to find a closer neighbourins observation. This is my code: ## library(klaR) library(ipred) library(mlbench) data(PimaIndiansDiabetes2) dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)] dane[,2]=log(dane[,2]) dane[,1:2]=scale(dane[,1:2])

Re: [R] ipredknn - How may I find values?

2009-10-27 Thread Grzes
wrote: On Oct 27, 2009, at 6:02 AM, Grzes wrote: Hi everybody! I want to find a closer neighbourins observation. This is my code: ## library(klaR) library(ipred) library(mlbench) data(PimaIndiansDiabetes2) dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)] dane[,2]=log

Re: [R] ipredknn - How may I find values?

2009-10-27 Thread Grzes
, ylab = NULL) David Winsemius wrote: On Oct 27, 2009, at 10:18 AM, Grzes wrote: Yes, I want to know which points in my picture are in red or green area. For example: .glucose..insulin.diabetes 609 0.95177272 1.139969011 - I want to know

Re: [R] avoid NA in list

2009-09-07 Thread Grzes
Henrique and Peter, thank you very much for your advices :) -- View this message in context: http://www.nabble.com/avoid-NA-in-list-tp25321020p25330422.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] Two packages in one method

2009-09-06 Thread Grzes
Hi! I want to use one method combinations from gtools package but in my code I must use also dprep method where is method combinations too. Mayby I show you result my help function: Help on topic 'combinations' was found in the following packages: Package Library dprep

[R] avoid NA in list

2009-09-06 Thread Grzes
Hi! I Have list, for example: ... [[22]] [1] 27 51 69 107 119 [[23]] [1] NA [[24]] [1] 54 57 62 And I would like to avoid NA value. Similar way like I may do it in vector using na.value() function. Do you have any idea? -- View this message in context:

Re: [R] Best R text editors?

2009-08-30 Thread Grzes
Hello, I'm using PLD Linux and in my opinion, if you looking for very easy editor - Geany!!! It'll be fantastic ;) -- View this message in context: http://www.nabble.com/Best-R-text-editors--tp25178744p25210782.html Sent from the R help mailing list archive at Nabble.com.

[R] about isoMDS method

2009-08-30 Thread Grzes
Hi, For example: I built a half matrix w using a daisy(x, metric = c(euclidean)) http://www.nabble.com/file/p25211016/1.jpg And next I transformed this matrix w using isoMDS function, for example isoMDS(w, k=2) and as result I got: http://www.nabble.com/file/p25211016/2.jpg And now I have a

Re: [R] about isoMDS method

2009-08-30 Thread Grzes
Yes, I'm using euclidean distances -- View this message in context: http://www.nabble.com/about-isoMDS-method-tp25211016p25213217.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] dificult loop for

2009-08-23 Thread Grzes
Hi, My english isn't briliant and my problem is very dificult to descripe but I try ;) My first question is: May I write loop for like this or similar - for (i in sth : sth[length(sth)], k in sth else : length(sth else) ) - I'd like to have two independent conditions in the same loop for. My