Re: [R] Factor function

2011-04-26 Thread Petr PIKAL
Hi d<-data.frame(matrix(c("ww","ww","xx","yy","ww","yy","xx","yy","NA"), ncol=3, byrow=TRUE)) Change character value "NA" to missing value d[d[,3]=="NA",3]<-NA If you want drop any unused levels of a factor just use factor(d[,3]) [1] xx yy Levels: xx yy Regards Petr r-help-boun...@r-

[R] Odp: ploting continuos function

2011-04-22 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 22.04.2011 09:19:19: > Hello R, > > I would like to plot continuos function (e.g. y=x^2) without creating a > sequence for x. > Is there a possibility to somehow specify the range - x belongs to > <-100,100>? Something like curve(x^2, -100,100) Mayb

Re: [R] problem reading csv file

2011-04-20 Thread Petr PIKAL
riate values for Windows ‘Unicode’ text files. If the first two bytes are the Byte Order Mark ‘0xFFFE’ then these are removed as some implementations of ‘iconv’ do not accept BOMs. ˙ţ1 looks in hex editor like that 0xFFFE so the problem is solved for now. Thanks again Petr > > --

[R] problem reading csv file

2011-04-19 Thread Petr Pikal
Dear all I have several files which claim to be *.csv (one attached, maybe it will come through) . They can be read to Open Office without much problem, however I can not read them into R. I tried read.table("H2O.CSV", sep=",", dec=".") V1 1 ˙ţ1 2 3 > read.table("H2O.CSV", sep=",", dec=".", s

Re: [R] Odp: Data frame with 3 columns to matrix

2011-04-19 Thread Petr PIKAL
Hi Michael Bach napsal dne 19.04.2011 14:21:13: > Petr PIKAL writes: > > > Hi > > > > r-help-boun...@r-project.org napsal dne 19.04.2011 09:46:47: > > > >> Dear R Users, > >> > >> Lets assume I have this data frame: > >> &

[R] Odp: Data frame with 3 columns to matrix

2011-04-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.04.2011 09:46:47: > Dear R Users, > > Lets assume I have this data frame: > > x y z > 1 1.00 5 0.5 > 2 1.02 5 0.7 > 3 1.04 7 0.1 > 4 1.06 9 0.4 > > x and y columns are sorted and the values not necessarily integers. z > values are not sorte

Re: [R] zero fill empty cell in data.frame

2011-04-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.04.2011 12:02:31: > On 04/19/2011 07:39 PM, Simone Gabbriellini wrote: > > Hello List, > > > > I have a data frame like: > > > >V130 V131 V132 V133 V134 V135 V136 > > 1 0 0 0.9 0 0.9 0 0 > > 2 0

[R] Odp: Simple Missing cases Function

2011-04-19 Thread Petr PIKAL
Hi Hi try colSums(is.na(data.m)) It is not in data frame but you can easily transform it if you want. Regards Petr r-help-boun...@r-project.org napsal dne 19.04.2011 09:29:08: > Dear all > > > > I have written a function to perform a very simple but useful task which I > do regularly. It

Re: [R] (no subject)

2011-04-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 18.04.2011 14:32:11: > Hai, > > Where can i get the dataset votes.repub > Ram Use your favourite browser, put R votes.repub in its search facilities and you shall be lucky enough to get it from first several hits. If you have installed R you can star

[R] Odp: boxplot with 2 treatments and 2 variables (with 2 corresponding y-axes)

2011-04-17 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 15.04.2011 16:20:23: > Hi, > > I am a complete newcomer to R and although I can plot standard box-plots I am > struggling with this... > > I have two treatments - A & B, and 2 variables 1 & 2. I want to compare > boxplots of variable 1 with variable

Re: [R] Deleting the last value of a vector

2011-04-17 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 18.04.2011 04:51:20: > Or perhaps even more parsimoniously (by a couple of characters) - > > r <- c(1, 2, 3, 4, 5) > r2<-r[-length(r)] Maybe even shorter head(x,-1) Regards Petr > > Min-Han > > On Sun, Apr 17, 2011 at 10:23 PM, Daisy Englert Duur

[R] Odp: nesting multiple for loops

2011-04-15 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 15.04.2011 01:34:22: > Hi everyone. > > I am quite frustrated that this doesn't work, as all the functions within > work fine by themselves. I'd also like any pointers to how to avoid 'for' > loops in my code. I understand it's less than desirable, bu

[R] Odp: Coding matrix equation

2011-04-11 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 11.04.2011 09:43:03: > Hi all, > > I have two matrices: > > G<-matrix(c(2.0, 0.5, 0.5, 0.5, 2.0, 0.5, 0.5, 0.5,2.0),3,3) > P<-matrix(c(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5,1.0),3,3) > > and I want to run this equation to get a new matrix F: > > F =

[R] Odp: In need of help with correlations

2011-04-11 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.04.2011 19:24:38: > I am in need of someone's help in correlating gene expression. I'm somewhat > new to R, and can't seem to find anyone local to help me with what I think > is a simple problem. > > I need to obtain pearson and spearman correlati

Re: [R] help question

2011-04-10 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 08.04.2011 18:24:37: > On 08/04/2011 9:20 AM, DEBERGH Patrick wrote: > > hello > > > > I am at the very beginneing of using the R program > > > > I just don't understand how one can save a programfile > > > > For exemple, if I type in R 23+456 and want

[R] Odp: random sampling with levels and with replacement

2011-04-08 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 08.04.2011 09:31:44: > Dear all, > i have a dataset of about 400 records , with a variable that has two levels > 40 bad and 360 good among other variables,how do i come up with10 random > samples that have the composition of as the main sample but

[R] Odp: Need a more efficient way to implement this type of logic in R

2011-04-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.04.2011 22:02:29: > I have cobbled together the following logic. It works but is very > slow. I'm sure that there must be a better r-specific way to implement > this kind of thing, but have been unable to find/understand one. Any > help would

[R] Odp: Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.04.2011 10:48:04: > Dear list, > > I have a dataframe with two column as fellow. > > > head(dat) >V1 V2 > 0.15624 0.94567 > 0.26039 0.66442 > 0.16629 0.97822 > 0.23474 0.72079 > 0.11037 0.83760 > 0.14969 0.91312 > > I want to ge

[R] Odp: Decimal Accuracy Loss?

2011-04-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.04.2011 17:33:48: > This is hopefully a quick question on decimal accuracy. Is any > decimal accuracy lost when casting a numeric vector as a matrix? And > then again casting the result back to a numeric? > > I'm finding that my calculation values

Re: [R] Odp: Loop to mapply. Error

2011-02-03 Thread Petr PIKAL
102 [2,]3 113 [3,]4 124 > mat[-(1:2),-(3:4)] [,1] [,2] [1,] 3 7 [2,]48 Which result is "correct" from your point of wiev? Regards Petr > > > > From: Petr PIKAL > > Subject: Odp: [R] Loop to mapply. Error > > To: &

[R] Odp: Loop to mapply. Error

2011-02-03 Thread Petr PIKAL
Hi Well, no data so a wild guess. You want select values from matrix sr based on values in borders[,1] and borders[,2]. If it is the case plain selection could be far better > mat<-matrix(1:12, 4,4) > mat [,1] [,2] [,3] [,4] [1,]1591 [2,]26 102 [3,]37

Re: [R] Average of several line plots

2011-02-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.02.2011 10:36:57: > > Hi, > > Peter: thank you, I have taken a look at ?approxfun but I'm not sure it does > what I'm after. Hm, maybe yes. But not approxfun but approx x1<-1:15 x2<-50:100 y1<-rnorm(15) y2<-rnorm(51) yy2<-approx(x2,y2)$y yy1<-app

Re: [R] looping variable names

2011-02-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.02.2011 00:56:40: > > Thanks for the reply! > > This sounds great. Is there a nice way to store these 100 variable names in > a list without typing them all out? Why? When you need your 42nd variable from a list lll you can just use lll[42] and

Re: [R] matrix and a function - apply function

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.02.2011 16:05:21: > > On Feb 2, 2011, at 9:12 AM, ADias wrote: > > > > > Hi > > > > I have this function and this matrix: > > > > function(x,y) x+y/x > > > > m<-matrix(c(1,2,4,2,10,8),3,2) > > > >> m > > [,1] [,2] > > [1,]12 > > [2,]

[R] Odp: Read a similarity matrix from excel

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.02.2011 10:20:48: > Good morning, > > I have an excel spreadsheet with similarities among objects. The format of > the file is the following: > > 1st row: ,,,..., > 2nd row: ,0,s<1,2>,s<1,3>,...,s<1,N> > 3rd row: ,s<2,1>,0,s<2,3>,...,s<2,N> > > Th

Re: [R] Help in getting info from a DataFrame

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.02.2011 11:14:18: > Hi > > r-help-boun...@r-project.org napsal dne 31.01.2011 15:51:16: > > > > > > > > > > > > > > > > > > > Hi > > > > thanks. I am not sure if I have understood 100% but at least I know now > that > > there's a diferen

Re: [R] sum the values in a vector as a complete number

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.02.2011 07:02:50: > Hi AD, > > You might try the following: > > # data > a <- c(2,3,5) > b <- c(8,7) # you got this wrong ;) > > # option 1 > foo <- function(x) as.numeric(paste(x, sep = "", collapse = "")) > > # examples > foo(a) > # [1] 235 >

Re: [R] Help in getting info from a DataFrame

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 31.01.2011 15:51:16: > > > > > > > > Hi > > thanks. I am not sure if I have understood 100% but at least I know now that > there's a diference. > > About this: > > lapsales > Store Prod qtd > 5 Aveiro Lapiseira 3 > 8 Coimbra

Re: [R] Help in getting info from a DataFrame

2011-01-31 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 31.01.2011 09:44:00: > > > David Winsemius wrote: > > > > > > On Jan 30, 2011, at 5:27 PM, ADias wrote: > > > >> dados<- > >> data > >> .frame > >> (Store > >> = > >> c > >> ("Setubal > >> ","lx > >> ","Aveiro > >> ","Coimbra > >> ","Aveir

Re: [R] Odp: Letters(V1, V2..) as row col indices instead of numbers

2011-01-28 Thread Petr PIKAL
Regards Petr > > This I m using to draw a graph. > > Regards, > Kumaraguru > > > On Jan 28, 2011, at 6:47 AM, Petr PIKAL wrote: > > > Hi > > > > r-help-boun...@r-project.org napsal dne 28.01.2011 09:52:05: > > > >> > >&

[R] Odp: (no subject)

2011-01-28 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.01.2011 15:37:07: > Hello, > I have a data set with each column containing data like this: > row column1 > 1 1.2 > 2 NA > 3 NA > 4 3 > 5 5 > 6 NA > 7 1.5 > 8 NA > 9 NA > 10 NA > 11 3 > 12 NA > 13 3 > 14 NA > 15 NA > 16 NA > 17 NA >

[R] Odp: Letters(V1,V2..) as row col indices instead of numbers

2011-01-28 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.01.2011 09:52:05: > > What makes matrix to print V1, V2 as the row and col indices instead of > numbers?? > > cdata = read.table("ramesh.txt") #cdata is read from a file. > c1 = cor(cdata) > > I am printing c1 below. I need only numbers. I dont ne

Re: [R] crazy loop error.

2011-01-25 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 25.01.2011 10:58:36: > ooh.. I have another question. > What if I want to add the value in the vector a to the hello each time it > prints. > Here is your output > > a <- c(2,3,5,5,5,6,6,7) > mapply(rep, "hello", rle(a)$lengths, USE.NAMES = FALSE) > >

Re: [R] ggplot geom_boxplot and stat_smooth

2011-01-25 Thread Petr PIKAL
use > stat_summary(), for example, because it is a bit easier to plot individual > layers that way. > > HTH, > Dennis > > On Mon, Jan 24, 2011 at 11:05 PM, Petr PIKAL wrote: > > > Dear all > > > > I would like to superpose some smoothing line through

[R] Odp: Extract NA data rows

2011-01-25 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 25.01.2011 08:07:10: > > hi i have the following dataframe > > x y > 1 345 > 6 NA > 8 123 > 32 123 > 12 NA > 6 124 > 7 NA > > and i want to extract the data rows which contains "NA" data, I tried > > subset(dataframe,y=="NA") See

Re: [R] crazy loop error.

2011-01-25 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 24.01.2011 23:18:35: > Thanks for the reply Erik, As you mentioned, grouping consecutive elements > of 'a' was my idea. > I am unaware of any R'ish way to do it. It would be nice if someone in the > community knows this. > > The error resulting in th

[R] ggplot geom_boxplot and stat_smooth

2011-01-24 Thread Petr PIKAL
Dear all I would like to superpose some smoothing line through boxplot in ggplot > dput(ad) structure(list(konc.f = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 4L, 4L, 4L

[R] Odp: count of factors

2011-01-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.01.2011 09:51:43: > > Hello everyone, > > I have a data set like this: > > > head( fish_transect) > ID_TRANSECT ID_PROJECT DE_ZONE DE_LOCALITY DE_SECTOR MES > 1 42 MB TarragonaCreixell Control I 9 > 2 42

Re: [R] substituting level for NA in factor column

2011-01-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.01.2011 00:03:10: > > On Jan 18, 2011, at 5:25 PM, kurt_h...@nps.gov wrote: > > > Greetings > > I have a bunch of NAs in a column of categorical variables > > designating > > the size classes (e.g., smallest to largest: 1,2,3,4) of cave > > cr

[R] Odp: to append a column to a data frame, has I use loop/if in my case?

2011-01-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 17.01.2011 15:59:37: > days=Sys.Date()-1:70 > price=abs(rnorm(70)) > regular=rep(c(0,0,0,0,1,0,1,0,0,1),c(7,7,7,7,7,7,7,7,7,7)) > y=data.frame(cbind(days,price,regular)) > > > y is like > days price regular > 1 14990 0.16149463 0 > 2 1

[R] Odp: Relative frequency on a character vector

2011-01-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 18.01.2011 13:51:05: > > Hi, > > I have this character vector: > > A<-c("Tell me how many different letter this vector has?") > > Is there a way with R that it can let me know how many different letters I > have on this vector? A<-c("Tell me how ma

[R] Odp: Sampling question

2011-01-18 Thread Petr PIKAL
Hi It is rather unclear how do you want sample your data. It seems to me that you can sample row numbers and choose sampled rows from data frame. I probably direct output to a list ("mylist") and use result <- lapply("mylist", GFD) Regards Petr r-help-boun...@r-project.org napsal dne 17.01

[R] Odp: Outputting csv file from dataframe with columns in a particular order

2011-01-12 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 12.01.2011 16:16:16: > I have a dataframe with columns "ID",'date","estimate","actual" (but > not necessarily in that order - I do a merge somewhere and that > somehow messes up the order of the columns). If you have datafreme with column order a, b, c,

[R] Odp: Integration in R

2011-01-10 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 10.01.2011 15:12:33: > Dear all, > > It has been ages since I studied integration in college. Right now I > try to recover all this kind of knowledge and then try to understand how > integration works. > > > > Thus I am doing some first 'experim

[R] Odp: Currency return calculations

2011-01-07 Thread Petr PIKAL
Hi What is wrong with my suggestion then. > rate1 USDGBP EURO CHFAUD 1 112.05 171.52 42.71 41.50 109.55 2 112.90 168.27 42.68 41.47 102.52 3 110.85 169.03 41.86 42.84 114.91 4 109.63 169.64 44.71 43.44 122.48 5 108.08 169.29 44.14 43.69 122.12 6 111.23 169.47 44.58 42.30 12

[R] Odp: Calculating Returns : (Extremely sorry for earlier incomplete mail)

2011-01-07 Thread Petr PIKAL
Hi Your code is quite complicated and I get an error spot_returns_table <- lapply(1:nrow(trans), function(z) with(trans[z, ], spot_trans(currency_trans=trans$currency_transacted))) Error in if (currency_trans == "USD") { : argument is of length zero It seems to me that you do not know what is y

[R] Odp: List to a summary table

2011-01-05 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.01.2011 01:26:42: > > Hi > > Suppose you have the code below. The result I get from the cat function is > from the avgs object. Now, I have 30 diferent objects like this and I wish I would stick to list and do not make 30 objects a.g. avg.width f

Re: [R] how to subset unique factor combinations from a data frame.

2011-01-05 Thread Petr PIKAL
il(df, n = 10) // example data// > > YearCountry Commodity Attribute Unit > Value > 1991United Kingdom Wheat, DurumTotal Supply(1000 MT) 70 > 1991United Kingdom Wheat, DurumTY Exports (1000 MT) 0 > 1991United Kingdom Wheat,

[R] Odp: bwplot

2011-01-05 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.01.2011 09:20:35: > I'm trying use the function bwplot, but I receive a message that the > function is not found. I charged the lattice, sm, and Hmrsc, package but Can you please explain how one can **charge** packages? I never did it. Besides did y

Re: [R] how to subset unique factor combinations from a data frame.

2011-01-04 Thread Petr PIKAL
atter how exactly you will describe your data if you fail to show any code you used and how this code failed in delivering desired result you will get only vague responses. Regards Petr > > Regards, > > SNVK > > -Original Message- > From: Petr PIKAL [mailto:petr.pi

[R] Odp: Default Working directory on windows 7?

2011-01-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.01.2011 10:35:23: > Hi, > > Just installed R on a new Windows 7 machine (as admin). > > > I feel quite uncomfortable knowing that the default WD when starting R is: > > > getwd() > [1] "C:/Windows/system32" Something was set incorrectly. I belie

[R] Odp: how to subset unique factor combinations from a data frame.

2011-01-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.01.2011 05:21:25: > Hi All > > I have these questions and request members expert view on this. > > a) I have a dataframe (df) with five factors (identity variables) and value > (measured value). The id variables are Year, Country, Commodity, Attr

[R] Odp: R-way to doing this?

2010-12-22 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 23.12.2010 05:13:37: > Dear friends, hope I could be able to explain my problem through following > example. Please consider this: > > > > > set.seed(1) > > > input <- rnorm(10) > > > input > > [1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.32

[R] Odp: replace values of a table !!!

2010-12-21 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 21.12.2010 09:59:31: > Dear all, > > Dear all, > > I am a relatively new user. > I have an ascii file with 550 rows and 400 columns. The file contain values > ranging from 1 to 2000 and some values with -. > > I want to generate a new file where

[R] Odp: NA's in survey analysis

2010-12-21 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 21.12.2010 11:02:07: > Hello, > > I am trying to analyze sociological survey data using R. It is often > important in survey to calculate both the actual factor sums and > percentages (easily done with describe() ), but also the numbers and > total perc

[R] Odp: For-loop

2010-12-20 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 20.12.2010 11:48:51: > Hi, > I have the following problem: > > I have a data.frame with 36 sample sites (colums) for which I have covariates > in 3 categories: Area, Month and River. Each Area consists of 3 rivers, which > were sampled over 3 month.

[R] Odp: tabulating 2 factors weighting by a third var

2010-12-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 20.12.2010 07:07:35: > Hi, > > This must be an easy one but so far I haven't find a way out... > > I have a data frame such as: > > $ v1: Factor w/ 5 levels > $ v2: Factor w/ 2 levels > $ v3: Class 'difftime' atomic [1:] > > basical

[R] Odp: Title for y-axis on right side

2010-12-17 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 17.12.2010 12:41:20: > Hi, > > I want to have a title for the y-axis on the right side of the plot. > I know how to do it on the left side: > > > title(ylab="Title for y-axis") > > But how can I have the title on the right side? See ?mtext Regards

[R] Odp: How to arrange the data

2010-12-17 Thread Petr PIKAL
Hi use melt from reshape package > test<-data.frame(a=letters[1:3], v1=1:3, v2=5:7, v3=100:102) > test a v1 v2 v3 1 a 1 5 100 2 b 2 6 101 3 c 3 7 102 > melt(test) Using a as id variables a variable value 1 a v1 1 2 b v1 2 3 c v1 3 4 a v2 5 5 b

[R] Odp: calculating mean of list components

2010-12-15 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 15.12.2010 14:22:15: > I get a list object from an iterative function. I'm trying to figure > out the most efficient way to calculate the mean of one element, across > all components of the overall list. > > I've tried > > output <- mean (listobject

Re: [R] Why do we have to turn factors into characters for various functions?

2010-12-15 Thread Petr PIKAL
our" "five" > > > >Anyway it is maybe more about personal habits than about bad factor > >"features" > > I agree with you regarding personal habits. It's not the features of > factors. For me it's the rather inconsistent use in

Re: [R] Why do we have to turn factors into characters for various functions?

2010-12-12 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 12.12.2010 21:00:37: > At 12.12.2010 00:48 +0200, Tal Galili wrote: > >Hello dear R-help mailing list, > > > >My question is *not* about how factors are implemented in R (which is, if I > >understand correctly, that factors keeps numbers and assign leve

Re: [R] Adding numbers in Outputs

2010-12-11 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 10.12.2010 15:00:12: > Dear Mr Holtman Sir, > > Thanks a lot for your great solution. This certainly is helping me achieve > what I need to get. However, I shall be hugely thankful to you if you can > guide me in one respect. > > Sir, you have used

[R] Odp: 2 plots with different scales in the same graphical window

2010-12-09 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.12.2010 16:25:06: > Dear useRs, > I have two sets of data that I would like to plot in the same window, but their > ranges are really different, e.g. > > a <- c(0.2, 0.5, 0.8, 0.3, 0.4, 0.5, 0.2, 0.2, 0.3) > b <- c(100, 2000, 800, 200, 100, 50, 4,

Re: [R] Sequence generation in a table

2010-12-09 Thread Petr PIKAL
d to keep my problem > short in oder not to consume your valuable time. > > Regards > > Vince Pyne > > > > --- On Thu, 12/9/10, Petr PIKAL wrote: > > From: Petr PIKAL > Subject: Re: [R] Sequence generation in a table > To: "Vincy Pyne" > Cc

Re: [R] Sequence generation in a table

2010-12-09 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.12.2010 12:41:47: > Dear Sir, > > Sorry to bother you again. Sir, the R code provided by you gives me following output. > > > yy <- lapply(c(257, 520, 110), seq, to=0, by=-100) > > yy > [[1]] > [1] 257 157 57 > > [[2]] > [1] 520 420 320 220 120

[R] Odp: piechart

2010-12-08 Thread Petr PIKAL
Hi Use par(new=TRUE) before calling new plot pie(rep(1,12), col=rainbow(24), radius=0.9) par(new=TRUE) pie(rep(1,12), col=topo.colors(24), radius=0.5) But use piechearts only when you want to deceive your audience. Regards Petr r-help-boun...@r-project.org napsal dne 08.12.2010 09:08:13: > d

[R] Odp: how to find smallest non-negative and biggest non-positive number in a matrix column ?

2010-12-08 Thread Petr PIKAL
Hi x<-rnorm(20) max(x[x<=0]) [1] -0.1028260 x<-c(x,0) max(x[x<=0]) min(x[x>=0]) AFAIK there is no other number fulfilling both criteria other than zero. So if you want both criteria to be true (as your "and" suggests), just check if there is zero. Regards Petr r-help-boun...@r-project.org n

[R] Odp: Urgent Help with R calculation correlation coefficient

2010-12-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.12.2010 11:02:03: > > Hi, > > I am trying to calculate correlation coefficient for gene expression data. > > Tab delimited file looks like this > > Id v1 v2v3 > df 56 9045 > gh 87 9878 > ty 897867 > > I used this code >

Re: [R] plot more plots from one matrix

2010-12-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.12.2010 16:56:37: > > I solved the 1° problem with this command: > > matrix2plot2[,"sensor_data"]<-as.numeric(as.character((matrix2plot2[,"sensor_data"]))) > > In fact before the previous command I if write: > > str(matrix2plot2[,"sensor_data"])

[R] Odp: Help with diff(sqrt()) function in terms of time series

2010-12-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.12.2010 00:19:17: > > year1 is the time series data set below > 11.64 > 11.50 > 11.49 > 11.16 > 11.15 > 11.37 > 11.37 > 11.57 > 11.83 > 11.87 > 11.85 > 11.92 > 11.77 > 11.71 > 11.57 > 11.24 > 11.27 > 11.33 > 11.17 > . > > With a tota

[R] Odp: recode letters to numbers

2010-12-03 Thread Petr PIKAL
Hi If you had your variables as factors you can change levels of each factor. levels(some.factor) <- c(0,25,50,27,100) fac<-factor(sample(LETTERS[1:5],20, replace=TRUE) ) fac [1] A A D A D A D A C B A A D D D B D E C B Levels: A B C D E levels(fac)<-1:5 fac [1] 1 1 4 1 4 1 4 1 3 2 1 1 4 4 4

Re: [R] Filter data

2010-12-03 Thread Petr PIKAL
Hi Hm. Does str(poli) revealed said explicitly that poli is data frame? I presume that it told you that it is list. In that case you need to use appropriate indexing, which suits structure of your list. Regards r-help-boun...@r-project.org napsal dne 02.12.2010 22:06:15: > > Simplified versi

Re: [R] Please help......barplot2

2010-12-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.12.2010 17:26:20: > > On Dec 2, 2010, at 11:10 AM, David Lyon wrote: > > > Thanks David > > > > Do you have the url link that details the worked solution to my > > problem: > > > > "that we have an extensive collection of documentation suitable for

[R] Odp: Please help......barplot2

2010-12-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.12.2010 16:36:09: > Hi everyone > > I spent hours trying to figure this out but as a newbie I am stuck... > can someone show me the R code for the following: > > If I had a tab delimited file called "file", containing 3 rows : > 9.56 8.67 9.28

Re: [R] Odp: Plot a matrix

2010-11-30 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 30.11.2010 11:52:38: > > I explain better > > key > index sensor1.A sensor1.B sensor2.A sensor2.B sensor3.A > 2010-10-1 7:32:00 8NA 5NA 2 > 2010-10-3 4:33:21NA

[R] Odp: Plot a matrix

2010-11-30 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 30.11.2010 10:52:35: > > Hi, > > I have this MATRIX m: > > key > index sensor1.A sensor1.B sensor2.A sensor2.B sensor3.A > 2010-10-1 7:32:00 8NA 5NA 2 > 2010-10-3 4:33:21

Re: [R] Odp: HELPPPPPP

2010-11-30 Thread Petr PIKAL
Hi I am not an expert in time series but I believe you can check easily different values for arima parameters based on ACF and PACF. To give you better help I would need to study some literature and I believe you could more easily do it yourself. Best regards Petr r-help-boun...@r-project.org

Re: [R] in regards of plotting using functions.

2010-11-29 Thread Petr PIKAL
x=[,1],y=[,2]), What is [,1]? You shall have some data from which you wanted to extract first and second column. What about to look into R-intro manual to chapter 2. Regards Petr > > so how should i embedded the expression within the plot? > > regards, > Pravin > > On Mon,

[R] Odp: in regards of plotting using functions.

2010-11-29 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.11.2010 11:48:07: > Hello, > > I am using basic plotting technique to get a graph. > but i want to color the points plotted onto the graph depending upon few > mathematical logics. > values > x should be colored blue. > values < y should be colored g

[R] Odp: HELPPPPPP

2010-11-29 Thread Petr PIKAL
Hi What does your teacher says about the procedures you shall use? You shall go through help pages for ?spectrum, ?acf, ?ar and maybe some others. Regards Petr r-help-boun...@r-project.org napsal dne 29.11.2010 11:33:58: > > please i've a big problem. > i've to do a econometric-quantitativ

[R] Odp: save a regression model that can be used later

2010-11-23 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 22.11.2010 16:02:20: > Hi everyone > > I have a question about how to save a regression model in R and how to > retrieve it for making predictions in a new session. > > To be more specific, I fitted a multilevel logistic regression model using the > l

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-23 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 21.11.2010 19:31:33: > > I have looked into par documentation, and only setting for size of the plot > area was pin. But this setting sets the area as inflexible, that is no R intro manual Chapter 12: Graphical procedures page, 71 A typical figure is

Re: [R] Odp: Still confused with lapply

2010-11-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.11.2010 16:58:01: > PtitBleu > > Hello Petr, > > Your solution works well with my example. > But with the function I want to use (which calls another functions), I still > have errors. > I have to work on it again (but only on monday). > > Again

[R] Odp: how to improve this inefficient R code for imputing missing values

2010-11-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.11.2010 16:34:04: Without going too deeply to your code, try to check na.locf function from zoo package. I would split your data to list according to study and subject, use na.locf with respect to your miising value types > x<-c(NA, 1:5) > y<-rev(

[R] Odp: Still confused with lapply

2010-11-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.11.2010 15:41:08: > > Hello, > > I would like to replace a for loop with lapply in order to speed up the > treatment of my data (I've read lapply can help to do it). Not exactly. For loop if correctly written can be as quick as lapply. See P.Burns

[R] Odp: Why some times R-halts?

2010-11-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 18.11.2010 11:29:28: > Alaios > Odeslal: r-help-boun...@r-project.org > > > Hello everyone. > I have written a small function that returns a 3*n array where n is typicall > between 5-55. > I issued in R > shweights<-shadowing_weights(x,xr) > and I

[R] Odp: Sampling problem

2010-11-16 Thread Petr PIKAL
Hi Here is one way (If I understood what you did ask). test<-read.table("clipboard", header=T) > test SubID CSE1 CSE2 CSE3 CSE4 WSE1 WSE2 WSE3 WSE4 1 165626224 2 264726623 3 355555545 4

Re: [R] Do loop

2010-11-14 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.11.2010 16:17:47: > Re: [R] Do loop > > Gud evening sir ,I want do the cluster analysis algorithm in r software can > u guide me sir ??cluster gives you bunch of methods > > My mail id is :sundars...@gmail.com > > And I want the brief explanati

Re: [R] filling a vector with a tapply function applied to another vector

2010-11-12 Thread Petr PIKAL
Hi Use ave instead of tapply. It is designed for such task Regards Petr r-help-boun...@r-project.org napsal dne 12.11.2010 10:49:17: > albechan > Odeslal: r-help-boun...@r-project.org > > 12.11.2010 10:49 > > Re: [R] filling a vector with a tapply function applied to another vector > > >

Re: [R] how do i plot this "hist"?

2010-11-09 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.11.2010 20:25:09: > casperyc > Odeslal: r-help-boun...@r-project.org > > 09.11.2010 20:25 > > Re: [R] how do i plot this "hist"? > > > Hi all, > > Thank you both. The codes work perfectly. > > I now use > > barplot(t(x.m)[-1,], names.arg = x.

[R] Odp: Question regarding to replace

2010-11-09 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.11.2010 18:33:54: > Kate Hsu > Odeslal: r-help-boun...@r-project.org > > 09.11.2010 18:33 > > Komu > > r-help@r-project.org > > Kopie > > Předmět > > [R] Question regarding to replace > > Dear r-users, > > Basically, I have a data as follow

Re: [R] Creating a list to store output objects from a recursive loop

2010-11-09 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.11.2010 10:26:09: > "Santosh Srinivas" > Odeslal: r-help-boun...@r-project.org > > 09.11.2010 10:26 > > > Re: [R] Creating a list to store output objects from a recursive loop > > Figured this out this ways I think > > outPut <- list(list(resul

Re: [R] Loop

2010-11-04 Thread Petr PIKAL
; lll[[5]][3] > > 13 > > 5079 > > > > without need for writing to individual files pasting together letters > > and numbers etc. > > > > There shall be R-intro document in your installation and it is worth > > reading. It is not so big, you can m

Re: [R] Loop

2010-11-04 Thread Petr PIKAL
numbers etc. There shall be R-intro document in your installation and it is worth reading. It is not so big, you can manage it in less then month if you complete more than 3 pages per day. Regards Petr > > M > > -Original Message- > From: Petr PIKAL [mailto:petr.

Re: [R] Loop

2010-11-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.11.2010 14:21:38: > Hi David, > > I am still having troubles with that loop ... > > This code gives me (kinda) the name of the column/field in a data frame. Filed > names are form W1-W10. But there is a space between W and a number --> "W 10", >

[R] Odp: Sorting data from one column with strings

2010-11-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.11.2010 13:28:06: > > Hello, > > I have tried to find this out some other way, but unsuccessful I have to > try this list. > I assume this should be quite simple. > > I have a dataset with 4 columns, "Sample_no", "Species", "Nitrogen", > "Carbon" i

Re: [R] Odp: connecting points into a smooth curve

2010-11-01 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.11.2010 13:02:46: > > > > > > > > > To: kai...@berkeley.edu > > From: petr.pi...@precheza.cz > > Date: Mon, 1 Nov 2010 11:50:17 +0100 > > CC: r-help@r-project.org > > Subject: [R] Odp: connecting points i

Re: [R] Plots inside a Plot

2010-11-01 Thread Petr PIKAL
Hi I remember that I did it also in base graphics but it took me some time to find out how and it was a long time ago so. If I remember it correctly it was some combination of graphic parameters to set user coordinates and do not overwrite the first plot by setting par(new=TRUE) Regards Petr

[R] Odp: connecting points into a smooth curve

2010-11-01 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.11.2010 07:18:47: > > If I have, say, five scatter points and want to connect them together into a > smooth curve. As you are not much specific about what you consider "smooth curve" here are some options use some model ?lm and plot predicted val

<    1   2   3   4   5   6   7   8   9   10   >