Re: [R] Warning message: NAs introduced by coercion

2019-01-08 Thread PIKAL Petr
Hi see in line > -Original Message- > From: R-help On Behalf Of N Meriam > Sent: Tuesday, January 8, 2019 3:08 PM > To: r-help@r-project.org > Subject: [R] Warning message: NAs introduced by coercion > > Dear all, > > I have a .csv file called df4. (15752 obs. of 264 variables). > I appl

Re: [R] error in plotting model from kernlab

2019-01-08 Thread PIKAL Petr
Hi I cannot help you with kernlab > > pred = predict(mod, df, type = "probabilities") > > acc = table(pred, df$cons) > Error in table(pred, df$cons) : all arguments must have the same length > which again is weird since mod, df and df$cons are made from the same > dataframe. Why not check leng

Re: [R] error in plotting model from kernlab

2019-01-08 Thread PIKAL Petr
t;. Cheers Petr > -Original Message- > From: Luigi Marongiu > Sent: Tuesday, January 8, 2019 4:40 PM > To: PIKAL Petr > Cc: r-help > Subject: Re: [R] error in plotting model from kernlab > > Hi, > the maintainer hasn't answered yet. The problem with &#

Re: [R] Mailinglist

2019-01-09 Thread PIKAL Petr
elaborate your results further and it is always good to have appropriately structured results. Cheers Petr From: Rachel Thompson Sent: Tuesday, January 8, 2019 4:24 PM To: PIKAL Petr Cc: r-help mailing list Subject: Re: [R] Mailinglist Hi Thank you for your help and suggestions! I have tried

Re: [R] Warning message: NAs introduced by coercion

2019-01-09 Thread PIKAL Petr
From: N Meriam Sent: Tuesday, January 8, 2019 4:36 PM To: PIKAL Petr Cc: r-help@r-project.org Subject: Re: [R] Warning message: NAs introduced by coercion I see... Here's a portion of what my data looks like (csv file attached). I run again and here are the results: df4 <- read.

Re: [R] Warning message: NAs introduced by coercion

2019-01-09 Thread PIKAL Petr
And as you use bioconductor related package you probably could get better answers in specialised biconductor help https://www.bioconductor.org/help/ Cheers Petr From: N Meriam Sent: Tuesday, January 8, 2019 4:36 PM To: PIKAL Petr Cc: r-help@r-project.org Subject: Re: [R] Warning message: NAs

Re: [R] importing data error question

2019-01-11 Thread PIKAL Petr
Hi I do not use Rcmdr but from documentation it seems to me that it does not have much to do with importing data from Excel. So without some additional info from your side (at least used commands) you hardly get any reasonable answer. Cheers Petr > -Original Message- > From: R-help O

Re: [R] NA rows appeared in data.frame

2019-01-14 Thread PIKAL Petr
Hi If you want to remove rows with NA values from your data you could use ?complete.cases or t2 <- t1[!is.na(t1$Petal.Width),] Cheers Petr > -Original Message- > From: R-help On Behalf Of Rui Barradas > Sent: Saturday, January 12, 2019 12:55 PM > To: Ernest Han ; r-help@r-project.org

Re: [R] NA rows appeared in data.frame

2019-01-15 Thread PIKAL Petr
1$Petal.Width) [1] NA > mean(t1$Petal.Width, na.rm=T) [1] 1.147101 > Cheers Petr > -Original Message- > From: Ernest Han > Sent: Wednesday, January 16, 2019 3:27 AM > To: PIKAL Petr > Cc: r-help@r-project.org > Subject: Re: [R] NA rows appeared in data.frame >

Re: [R] create groups from data with duplicates, such that each group has a duplicate represented once

2019-01-17 Thread PIKAL Petr
Hi Instead of attachment which is usually removed you should use dput Something like output from dput(head(yourdata,30)) To remove duplicate values see unique or duplicated Cheers Petr > -Original Message- > From: R-help On Behalf Of Kevin Wamae > Sent: Thursday, January 17, 2019 1:2

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread PIKAL Petr
Hi Or you could use rounding. which(round(lut, 3)==1.8) [1] 401 Cheers Petr > -Original Message- > From: R-help On Behalf Of Ben Tupper > Sent: Thursday, January 17, 2019 2:43 PM > To: POLWART, Calum (COUNTY DURHAM AND DARLINGTON NHS > FOUNDATION TRUST) > Cc: r-help@r-project.org > Sub

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread PIKAL Petr
) > Sent: Thursday, January 17, 2019 2:56 PM > To: PIKAL Petr ; Ben Tupper > Cc: r-help@r-project.org > Subject: RE: [R] I can't get seq to behave how I think it should > > Thanks guys. > > I've used Petr's method and its working for me. > > If the data had been

Re: [R] large number of scrollable histograms....

2019-01-22 Thread PIKAL Petr
Hi what about to create all histograms in pdf device? see ?pdf Cheers Petr > -Original Message- > From: R-help On Behalf Of akshay kulkarni > Sent: Tuesday, January 22, 2019 2:21 PM > To: R help Mailing list > Subject: [R] large number of scrollable histograms > > dear members, >

Re: [R] large number of scrollable histograms....

2019-01-23 Thread PIKAL Petr
arni Sent: Wednesday, January 23, 2019 8:01 AM To: PIKAL Petr ; R help Mailing list Subject: Re: large number of scrollable histograms dear pikal, Thanks for the suggestion I have checked ?pdf. The syntax is: > pdf("sample.pdf", 7, 5) > hist(vector1)

Re: [R] Requested r code and references for doing network analysis with experimental data

2019-01-27 Thread PIKAL Petr
Hi Well, I tried google and this https://www.jessesadler.com/post/network-analysis-with-r/ seems to provide some insights. If it is not appropriate to your situation, you should be more specific. Cheers Petr BTW, what is factor in continuous scale? I am almost sure that factors are discrete

Re: [R] Your input

2019-01-29 Thread PIKAL Petr
do not know R basics and want to do highly sophisticated analysis. Spending few hours reading R intro could save you much time and headache. Sorry, I could not help you with network analysis as I do not know anything about it. Cheers Petr From: Bhubaneswor Dhakal Sent: Tuesday, January 29, 201

[R] pattern evaluation in electron microscopy images

2019-02-08 Thread PIKAL Petr
Dear all I enclose 3 electron microscope images in which I would like to evaluate plane spacing. Before I start to dig deeper and use trial and error in trying to find some packages/functions for such pattern evaluation in electron microscopy pictures I would like to ask if anybody could point

Re: [R] pattern evaluation in electron microscopy images

2019-02-14 Thread PIKAL Petr
: S Ellison > Sent: Monday, February 11, 2019 12:54 PM > To: PIKAL Petr ; r-help@r-project.org > Subject: RE: pattern evaluation in electron microscopy images > > Not really my field, but would you not approach this using FFT on selected > regions? > > I think IMageJ ha

Re: [R] Problem with combining 2 data frame

2019-02-18 Thread PIKAL Petr
Hi and if you consider stringsAsFactor option a nuisance you probably could use as.character df1$x2[match(df2$x1, df1$x1)] <- as.character(df2$x2) Slightly different approach is merge merge(df1, df2, by=c("x1"), all=T) which gives you additional column from df2 with NA values together with mer

Re: [R] Taking the Average of a subset of data

2019-02-18 Thread PIKAL Petr
Hi Could you show what is your intention with your data? What do you mean by sort data to have the same number of leaves? Do you want to trim excessive rows in both data.frames to meet such condition? I would suggest using merge. merge(test1, test2, by.x=c("plot", "plant"), by.y=c("plot_lai",

[R] particle count probability

2019-02-20 Thread PIKAL Petr
Dear all Sorry, this is probably the most off-topic mail I have ever sent to this help list. However maybe somebody could point me to right direction or give some advice. In microscopy particle counting you have finite viewing field and some particles could be partly outside of this field. My

Re: [R] particle count probability

2019-02-21 Thread PIKAL Petr
for bigger particle. OTOH, if I take your first reasoning I get quite satisfactory values. > 1-(10-c(0.1, 1))* (10-c(0.1,1))/(10^2) [1] 0.0199 0.1900 Cheers. Petr > -Original Message- > From: Jim Lemon > Sent: Thursday, February 21, 2019 12:24 AM > To: Rolf Turner > Cc

Re: [R] particle count probability

2019-02-21 Thread PIKAL Petr
OK. I got it. Thanks. Petr > -Original Message- > From: Jim Lemon > Sent: Thursday, February 21, 2019 11:36 AM > To: PIKAL Petr > Cc: Rolf Turner ; r-help@r-project.org > Subject: Re: [R] particle count probability > > Hi Petr, > My second message was t

Re: [R] Cannot reproduce tutorial results

2019-02-25 Thread PIKAL Petr
Hi. Without going too deep in your messy code: "title" is function to make titles in plots. therefore titles <- c(title, extractTitle(data.combined[i, "name"])) put in your titles object in the first place this "title" function. And I believe, that instead of multiple if/else there is better v

Re: [R] Tidyverse data frame conversion from monthly to annual

2019-03-03 Thread PIKAL Petr
Hi aggregate is another option. aggregate(df[, 2:4], list(df$Year), sum) Cheers Petr > -Original Message- > From: R-help On Behalf Of > p...@philipsmith.ca > Sent: Monday, March 4, 2019 4:15 AM > To: r-help@r-project.org > Subject: [R] Tidyverse data frame conversion from monthly to an

Re: [R] [FORGED] Q re: logical indexing with is.na

2019-03-10 Thread PIKAL Petr
Hi Do you want something like this? > x <- c(1,2,NA, 3, 4, 5, NA, 6,7,8, NA, NA, 9,10) > y <- c(1,2,NA, NA, 3, 4, 5, 6, NA, 7,8, NA, NA, 9,10) > identical(x[which(!is.na(x))], y[which(!is.na(y))]) [1] TRUE If I expect NA and want to extract or compare something, I tend to use which to select onl

Re: [R] Question regarding the dcast function

2019-03-21 Thread PIKAL Petr
Hi You shouldn't use HTML formating unless you want to surprise us with weird and messy email. function dcast is in data.table and/or in reshape2 packages. For both install.packages("data.table") install.packages("reshape2") followed by library(data.table) library(reshape2) should be enough t

Re: [R] [FORGED] Re: Quantile Density Contours

2019-03-27 Thread PIKAL Petr
Hallo Bernard I did not follow all emails in this thread but it seems to me that your request is similar to Bioconductor packages dealing with Flow Cytometry data. Especially flowViz package is designed to visualise such data. Cheers Petr > -Original Message- > From: R-help On Behalf

Re: [R] Fast function for each row of a data.table

2014-07-24 Thread PIKAL Petr
Hi If your problem is not bigger than example (regarding columns following maybe can help (I shortened target.column to tc) dt$target.value <- dt[,3]*(dt$tc==3)+dt[,2]*(dt$tc==2)+dt[,1]*(dt$tc==1) and changed dt to data frame as I do not use data table. But it shall work with data table too.

Re: [R] R function returning a list of variable(s) conditional on the value of an option?

2014-07-25 Thread PIKAL Petr
Hi It is not exactly clear what do you want from your function. foo <- function(x, y, option = TRUE) in that cese you want to return list x,y,z or x,y,z,w with w=NA the same apply with foo <- function(x, y, option = FALSE) return is x,y,w or x,y,z=NA,w? anyway I would use option like that {

Re: [R] working on a data frame

2014-07-27 Thread PIKAL Petr
Hi I like to use logical values directly in computations if possible. yourData[,10] <- yourData[,9]/(yourData[,8]+(yourData[,8]==0)) Logical values are automagicaly considered FALSE=0 and TRUE=1 and can be used in computations. If you really want to change 0 to 1 in column 8 you can use yourDa

Re: [R] Differencing between 2 previous values

2014-07-28 Thread PIKAL Petr
Hi see in line > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Pavneet Arora > Sent: Monday, July 28, 2014 11:08 AM > To: r-help@r-project.org > Subject: [R] Differencing between 2 previous values > > Hello All, > > I am tryi

Re: [R] outputting R loop to a csv file

2014-07-28 Thread PIKAL Petr
Hi Above what David said, there is chance that you do not need cycle for your computation. From what you describe about your csv files there seems to be some mismatch in your write.csv statement. Make a small example code together with data set, preferably as an output from dput, and try agai

Re: [R] DATA SUMMARIZING and REPORTING

2014-07-30 Thread PIKAL Petr
Hi Maybe ?aggregate Use dput for data presentation and no HTML as everything gets scrambled with it. Regards Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Abhinaba Roy > Sent: Wednesday, July 30, 2014 2:46 PM > To:

Re: [R] Multiple plots and postscripts using split function

2014-08-01 Thread PIKAL Petr
Hi Maybe others will disagree but I find for cycle for this type of task better than sapply. for(i in 1:length(ind)) { if (there are more than 3 date items*) { postscript(ind[i]) do all plotting dev.off() }} If you want to plot with gaps you need to add all relevant YEARs for x axis with mis

Re: [R] How to avoid the three loops in R?

2014-08-01 Thread PIKAL Petr
Hi I do not see any solution without loops but maybe others find it. I think that you can do it in one loop. Best structure for loop will be list. In each cycle you will compute matrix with diagonal NA mat<-matrix(1,nrow=number of items, ncol=number of items) diag(mat) <- NA apply(price chunk

Re: [R] How to do t.test to rows of a dataframe using apply family function?

2014-08-25 Thread PIKAL Petr
Hi If your function works for you why to bother with apply? If it does not give you required results, please post some data and show us what is expected. I would remove unlist from your function and declare list for storing data, which seems to me more natural for storing results. t.test.list=

Re: [R] How to do t.test to rows of a dataframe using apply family function?

2014-08-26 Thread PIKAL Petr
3057 0.9007913 Numeric,2 Numeric,2 0 "two.sided" methoddata.name [1,] "Welch Two Sample t-test" "rnorm(20) and rnorm(20)" [2,] "Welch Two Sample t-test" "rnorm(20) and rnorm(20)" Regards Petr From: my1stbox [mai

Re: [R] How to do t.test to rows of a dataframe using apply family function?

2014-08-26 Thread PIKAL Petr
you are interested, the source code is available. Regards Petr From: my1stbox [mailto:my1st...@163.com] Sent: Tuesday, August 26, 2014 12:24 PM To: PIKAL Petr Cc: R Help Subject: Re: RE: RE: [R] How to do t.test to rows of a dataframe using apply family function? Thank you so much! Why do do.c

Re: [R] working with matrices

2014-08-27 Thread PIKAL Petr
Hi Please be more specific and try to post some example to simplify elaborating answer. How big is your matrix. Double loop seems to be the first which come to my mind however it can be unpractical when dealing with big matrix or if you want to do this task repeatedly. Petr > -Original

Re: [R] dont remenber my password

2014-08-29 Thread PIKAL Petr
That is bad, especially if it is password to your bank account. Maybe you shall write it down somewhere next time. Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Ernesto Villarino > Sent: Friday, August 29, 2014 9:32 A

Re: [R] what happened when copying a function definition into R prompt then press Enter?

2014-09-01 Thread PIKAL Petr
Hi Can you be more specific or show some code? I am completely lost in your question. Regards Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of PO SU > Sent: Sunday, August 31, 2014 7:04 AM > To: R. Help > Subject: [R] w

Re: [R] some question about vector[-NULL]

2014-09-10 Thread PIKAL Petr
Hi I am puzzled about what do you want? You was discouraged using $ operator due to partial matching, however you still use it. In your example you do not have named element being NULL. Just check it yourself. > a<-list() > a$ress<-1 > a$res<-NULL > a $ress [1] 1 > str(a) List of 1 $ ress:

Re: [R] sequential input script dataframe process functionality

2014-09-10 Thread PIKAL Petr
Hi > Now confused by "Choices"! :) What is my error please? Your main error is that you do not read help which was offered by Wiliam. Choices is not a function it is name of a variable. You can call it e.g. ctsanddogs if you wish. see in line > -Original Message- > From: r-help-boun..

Re: [R] some question about vector[-NULL]

2014-09-10 Thread PIKAL Petr
Hi You still do not disclose important info about details of your functions. However, when you want to perform indexing like you show, you maybe can get rid of NULL and use zero instead. > a<-1:5 > a[-c(1,3)] [1] 2 4 5 > a[-c(0,1,3)] [1] 2 4 5 > a[-c(1,0,3)] [1] 2 4 5 > a[-c(0,1,0,3,0)] [1] 2 4

Re: [R] some question about vector[-NULL]

2014-09-11 Thread PIKAL Petr
behaviour would change almost any R code I am afraid that you need to reprogram it yourself. Regards Petr > -Original Message- > From: PO SU [mailto:rhelpmaill...@163.com] > Sent: Thursday, September 11, 2014 9:27 AM > To: PIKAL Petr > Cc: R. Help > Subject: Re

Re: [R] Lines instead of points in a scatterplot

2014-09-12 Thread PIKAL Petr
Hi look at str(aggr) I bet you will find that your first column is factor and lines you see are from making a boxplot with your plot command. You can change it by various ways but I would prefer to change factor to numeric, which requires some regular expression. Here is one but I believe that

Re: [R] apply block of if statements with menu function

2014-09-16 Thread PIKAL Petr
Hi > Selection: 1 > Error in if (menu1 == 1) menu1a <- menu(c("1a", "2a", "3a", "4a"), > graphics = FALSE, : > argument is of length zero > > How to correct this error please, for this zero length argument? Instead of writing functions which you are unable to debug and resolve look what e

Re: [R] apply block of if statements with menu function

2014-09-16 Thread PIKAL Petr
ot;) > So if result of menu is 0 (you did not choose anything) you can either stay with 0, then switch does not return anything or add 1 and let evaluate something meaningful specified in second and following positions of switch command. Regards Petr > -Original Message- > From: r...@op

Re: [R] apply block of if statements with menu function

2014-09-22 Thread PIKAL Petr
Hi > -Original Message- > From: r...@openmailbox.org [mailto:r...@openmailbox.org] > Sent: Thursday, September 18, 2014 4:35 PM > To: PIKAL Petr > Cc: r-help@r-project.org > Subject: RE: [R] apply block of if statements with menu function > > On 2014-09-16

Re: [R] error in rownames

2014-09-26 Thread PIKAL Petr
Hi. Partly. You got response from David regarding HTML formating. I polished scrammbled text but I got > AsciiGridImpute(type.rf, xfile, outfile) Error in file(xfiles[[i]], open = "rt") : cannot open the connection In addition: Warning message: In file(xfiles[[i]], open = "rt") : cannot open f

Re: [R] Performance (speed) of ggplot

2014-09-26 Thread PIKAL Petr
Hi I will second Jeff. If you want several plots on one page it could be more convenient to use standard plot. see ?layout or ?split.screen for complex figures or ?par mfrow for simple layout. In all cases it is difficult to combine base and grid graphics though. Regards Petr > -Origina

Re: [R] if else statement in loop

2014-09-28 Thread PIKAL Petr
Hi Please, be more clear in what do you want. I get many errors trying your code and your explanation does not help much. > for(i in length(1:(2*nrow(X{ + Y$IID1new <- ifelse((as.character(Y[,2]) == as.characterXl[,i]) & X$IID1new != '') , as.character(as.matrix(X[,(2*nrow(X)+i)])),'')

Re: [R] if else statement in loop

2014-09-29 Thread PIKAL Petr
e(1:3, .Label = c("samas4", "samas5", "samas6" ), class = "factor")), .Names = c("FID", "IID"), class = "data.frame", row.names = c(NA, -3L)) > -Original Message- > From: Kate Ignatius [mailto:kate.ignat...@g

Re: [R] Loop does not work: Error in else statement

2014-09-29 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Frank S. > Sent: Monday, September 29, 2014 9:17 PM > To: r-help@r-project.org > Subject: [R] Loop does not work: Error in else statement > > Hi to all members of R list, > >

Re: [R] Loop does not work: Error in else statement (II)

2014-09-30 Thread PIKAL Petr
Hi Slightly better but still html scrambled. see in line > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Frank S. > Sent: Tuesday, September 30, 2014 2:55 PM > To: r-help@r-project.org > Subject: [R] Loop does not work: Erro

Re: [R] Converting factor data into Date-time format

2014-09-30 Thread PIKAL Petr
Hi Everything seems to be OK. Please check your if your objects are as required by. str(objects) (and post result if you are in doubt :) from your attempts I presume that datetime was not created properly Maybe this can do it, without actual data it is hard to tell exactly. datetime=as.POSIXct(

Re: [R] apply if else statement to vector

2014-10-02 Thread PIKAL Petr
Hi in this case correct syntax is not to use if at all vectorx*(vectorx>vectory) 1] 0 0 0 70 if you insist you can use ?ifelse which is "vectorised" if Regards Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of r..

Re: [R] (no subject)

2014-10-02 Thread PIKAL Petr
Hi when trying your code I got pval = summary(model)$coeff[2,4] Error in summary(model)$coeff[2, 4] : subscript out of bounds > str(summary(model)$coeff) num [1, 1:4] 1.73e-17 7.07e-01 2.44e-17 1.00 - attr(*, "dimnames")=List of 2 ..$ : chr "(Intercept)" ..$ : chr [1:4] "Estimate" "Std. Er

Re: [R] Identifying Values in Dataframe

2014-10-03 Thread PIKAL Petr
Hi maybe which(abs(data)>0.3, arr.ind=T) row col Loss_EV_Amygdala_SF_left_hemisphere 15 2 Loss_EV_Amygdala_SF_left_hemisphere 15 3 Loss_PE_Amygdala_SF_right_hemisphere 5 7 Loss_PE_Amygdala_SF_left_hemisphere 13 9 Gives you what you want. > se

Re: [R] merge by time, certain value if 5 min before and after an "event"

2014-10-03 Thread PIKAL Petr
Hi If Jean's guess is correct, after simple changing Timestamp to real date see ?strptime and ?as.POSIXct you can use result <- merge(mydata, myframe, all=TRUE) use function ?na.locf from zoo package to fill NAs in Event column and get rid of all rows with NA in location e.g. by ?complete.ca

Re: [R] merge by time, certain value if 5 min before and after an "event"

2014-10-03 Thread PIKAL Petr
Hi So if I understand correctly, you want to spread value "high" to times 5 minutes before its occurrence and 5 minutes after its occurrence. If your dates are not extremely big you can prepare its expanded version and use code suggestions I sent previously myframe <- data.frame (Timestamp=c("

Re: [R] Identifying Values in Dataframe

2014-10-09 Thread PIKAL Petr
: Monday, October 06, 2014 9:25 PM To: PIKAL Petr Cc: R-help@r-project.org Subject: Re: [R] Identifying Values in Dataframe Thanks Pikal - I'd like to actually get the names of the variables for those indices both above and below .3/-.3 with the intention of generating a grid of scatterplots (

Re: [R] Changing date format

2014-10-09 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Frederic Ntirenganya > Sent: Thursday, October 09, 2014 1:32 PM > To: Jim Lemon > Cc: r-help@r-project.org > Subject: Re: [R] Changing date format > > This idea substract 1 fo

Re: [R] Changing date format

2014-10-10 Thread PIKAL Petr
ome data. I do not believe that anybody violates calendar in such a way that all years have 366 days. I may be mistaken but isn’t ?merge function what you really want? Petr From: Frederic Ntirenganya [mailto:ntfr...@gmail.com] Sent: Friday, October 10, 2014 8:33 AM To: Duncan Murdoch Cc: PIK

Re: [R] Sum of two consecutive number in dataset.

2014-10-15 Thread PIKAL Petr
Hi twodays <- rowSums(embed(Samaru56$Rain,2)) gives you sum of rain in 2 cosecutive days sel <- which(twodays>20) gives you vector of row numbers in which above condition results in TRUE value Samaru56[sel,] selects these rows Regards Petr > -Original Message- > From: r-help-boun...

Re: [R] how to ajust y-axis values in plot() ?

2014-10-15 Thread PIKAL Petr
Hi is > plot(11:20, ylim=c(0,40)) > abline(h=40) > what you want? Regards Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of PO SU > Sent: Tuesday, October 14, 2014 11:33 AM > To: R. Help > Subject: [R] how to ajust y-a

Re: [R] Retrieving lists of colnames

2014-10-15 Thread PIKAL Petr
Hi First of all you shall transfer your data to R. Maybe it can be solved by apply but in your case I would use for cycle Let say your data frame is named doc lll<-vector(nrow(doc), mode="list") for(i in 1:nrow(doc)) lll[[i]]<-colnames(doc)[(which(doc[i,]>0))] Cheers Petr > -Original Mess

Re: [R] HELP

2014-10-15 Thread PIKAL Petr
Hi It will be even worse with age, try to contact optician :-) If you want to get better answer you need to provide more info about your file, what you did and how it failed. Cheers Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org]

Re: [R] Retrieving lists of colnames

2014-10-16 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Vikash Kumar > Sent: Thursday, October 16, 2014 7:06 AM > To: adam.n.jenkin...@gmail.com > Cc: r-help@r-project.org > Subject: Re: [R] Retrieving lists of colnames > > Hi Adam

Re: [R] need help for error "incompatible dimensions"

2014-10-17 Thread PIKAL Petr
Hi Your .R attachment did not come through. Included txt file did not have headers. Maybe you just want cor(whatever is the name of your numeric object) Cheers Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Swapnil

[R] format negative numbers

2014-10-20 Thread PIKAL Petr
Dear all. Before I start fishing in (for me) murky regular expression waters I try to ask community about changing format of negative numbers. For some reason I get a file with negative numbers formatted with negative sign at end of number. something like 0.123- It is imported as factors and

Re: [R] format negative numbers

2014-10-20 Thread PIKAL Petr
at negative numbers > > Is it what you want? > > > st <- "0.123-" > > gsub("(.+)(-)", "\\2\\1", st) > [1] "-0.123" > > st <- "0.123" > > gsub("(.+)(-)", "\\2\\1", st) > [1] "

Re: [R] format negative numbers

2014-10-22 Thread PIKAL Petr
ginal Message- > From: David Winsemius [mailto:dwinsem...@comcast.net] > Sent: Monday, October 20, 2014 11:04 PM > To: PIKAL Petr > Cc: Marc Girondot; r-help@r-project.org > Subject: Re: [R] format negative numbers > > > On Oct 20, 2014, at 4:32 AM, PIKAL Petr wrote: > &g

Re: [R] Loop with ggplot2 not as simple as it seems...

2014-10-29 Thread PIKAL Petr
Hi Patricia You are somewhat circling around solution. Is this what you wanted? for (i in 5:7) { plotname = paste("Graph", names(scores)[i], sep="") png(paste0(plotname,".png")) p <- ggplot(scores, aes(x=scores[,i], fill=gender )) print(p+ geom_density(alpha=.3)+xlab(names(scores)[i])) d

Re: [R] Adding labels to ColSums

2014-10-29 Thread PIKAL Petr
Hi Most probably years.before.initiated.cat is a factor. You have basically two options. change it to character by ?as.character or add level named "Total" by levels(years.before.initiated.cat)<-c(levels(years.before.initiated.cat), "Total") Cheers Petr > -Original Message- > From:

Re: [R] weighting histograms

2014-10-29 Thread PIKAL Petr
Hi Your example is not reproducible as we do not have Biota_subset and have no idea what is its structure. You also do not mention any error. Most probably x and y are not what you think it is. This works as expected. testx<-sample(1:10,300,TRUE) testw<-seq(1,4,by=0.01) weighted.hist(testx,tes

Re: [R] assigning a function within a loop

2014-10-29 Thread PIKAL Petr
Hi instead of this paste/assign/get stuff use list for keeping cycle result something like nam <- vector("list", degree) for (i in 1:degree) { nam[[i]] <- lm(y~poly(x,i,raw=TRUE)) } Cheers Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > proje

Re: [R] Function that create day of the year column.

2014-11-04 Thread PIKAL Petr
Hi You want a function with input of either single value or a data frame? This is very strange. One option is to make a method for function but it is quite beyond my capabilities and it is used by "professional" developers. methods(c) or methods(plot) So you need to set method for your functio

Re: [R] Function that creates a Date column

2014-11-04 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Frederic Ntirenganya > Sent: Tuesday, November 04, 2014 3:45 PM > To: r-help@r-project.org > Subject: [R] Function that creates a Date column > > Dear All, > > I would like to

Re: [R] Variance of multiple non-contiguous time periods?

2014-11-04 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of CJ Davies > Sent: Tuesday, November 04, 2014 2:50 PM > To: Jim Lemon; r-help@r-project.org > Subject: Re: [R] Variance of multiple non-contiguous time periods? > > On 04/11/14

Re: [R] Function that create day of the year column.

2014-11-05 Thread PIKAL Petr
ou can for single column option use only the first value, specifying required column. dt1=yday(as.Date(data[,which[1]])) Cheers Petr PS. No HTML post please. From: Frederic Ntirenganya [mailto:ntfr...@gmail.com] Sent: Wednesday, November 05, 2014 9:35 AM To: PIKAL Petr Cc: r-help@r-project.o

Re: [R] Compressing code help in a loop

2014-11-12 Thread PIKAL Petr
Hi slightly more general if first number is quarter and last two are year > index <- c(406, 107, 207, 307, 407, 108, 208, 308, 408, 109, 209, 309, 409, + 110, 210, 310, 410, 111, 211) year<-substr(as.character(index), 2,3) qrt<-substr(as.character(index), 1,1) as.numeric(factor(paste(year, qrt,

Re: [R] Data Import to R

2014-11-13 Thread PIKAL Petr
Hi Your original numeric data probably contain something which prevents read.* to accept them as numeric (decimal point, white space) what is result of str(imported.data) Petr Pikal > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On B

Re: [R] hi

2014-11-13 Thread PIKAL Petr
Hi 1. Do not post in html 2. Post example of data, preferably by dput function 3. Based on posted data explain what do you want to achieve 4. As it seems to be biological issue did you look at Bioconductor? Cheers Petr > -Original Message- > From: r-help-boun...@r-

Re: [R] hi

2014-11-14 Thread PIKAL Petr
It seems rather complicated. AFAIK cor gives you correlation matrix, you can check items in this matrix but I do not understand your rules. ¨ Cheers Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Cox Lwaka > Sent: Frida

[R] problems with mail message

2014-11-18 Thread PIKAL Petr
Dear maintainers I experienced problems with undeliverable messages to R-help Here is header, which basically says that mail to r-help@r-project.org was undelivered and that phil2.ethz.ch refused to accept it. * Doručení těmto příjemcům nebo skupinám se nezda

Re: [R] problems with mail message

2014-11-18 Thread PIKAL Petr
thz.ch] > Sent: Tuesday, November 18, 2014 12:17 PM > To: PIKAL Petr > Cc: r-help > Subject: Re: [R] problems with mail message > > >>>>> PIKAL Petr > >>>>> on Tue, 18 Nov 2014 10:48:28 + writes: > > > Dear maintainers > >

Re: [R] R - PLOT - X-AXIS - DECIMALS

2014-11-20 Thread PIKAL Petr
Hi Plot calls function pretty which calculates values for annotating axes. You can get rid of this behaviour by plot(..., axes=FALSE) and calling axis(1, ...) see ?plot ?pretty ?axis Cheers Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > p

Re: [R] Error Missing values where true/false needed

2014-11-25 Thread PIKAL Petr
Hi Error message seems to be clear > Error in if (data$Rain[i_NA] == 60) { : > missing value where TRUE/FALSE needed data$Rain[i_NA] produces probably NA > x<-NA > if(x==60) print(1+1) else print("Errrorrr") Error in if (x == 60) 1 + 1 : missing value where TRUE/FALSE needed > x<-10 > if(x==6

Re: [R] Error Missing values where true/false needed

2014-11-25 Thread PIKAL Petr
Huh and what is the result of e.g. data$Rain[indicNAs[1]] I bet that you will see [1] NA and your if question askes if (NA eqals 60) which results in NA and "if" is telling you that it expects TRUE or FALSE but not NA. I do not see how much clearer the error message shall be. Cheers Petr >

Re: [R] plot.hclust point to older version

2014-11-26 Thread PIKAL Petr
Hi You say > in other words, experienced R users do not let their workspace be saved > automatically (to '.RData') and hence do not load any .RData > automatically at startup. I save/load .RData for years without any issues (except of not installed packages when working on different PCs).I usua

[R] ggplot facet and subsetting

2014-11-26 Thread PIKAL Petr
Dear all I encountered strange behaviour of ggplot with combination of facet and subsetting. I use for creating plots sometimes a for cycle, something like this for (i in n:m) { p<-ggplot(data, aes(x=x, y=data[,i], colour=f))), ...} However I found strange result with this combination This is

Re: [R] ggplot facet and subsetting

2014-11-27 Thread PIKAL Petr
nt: Thursday, November 27, 2014 9:29 AM > To: PIKAL Petr; R help > Subject: RE: ggplot facet and subsetting > > Dear Petr, > > You need to use aes_string() instead of aes(). > > The.cols <- colnames(data)[n:m] > for (i in The.cols) { p<-ggplot(data, aes_string(x=&quo

Re: [R] plot.hclust point to older version

2014-11-27 Thread PIKAL Petr
Hm > -Original Message- > From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] > Sent: Wednesday, November 26, 2014 8:09 PM > To: PIKAL Petr; Martin Maechler > Cc: R help > Subject: Re: [R] plot.hclust point to older version > > Short answer to your question i

Re: [R] ggplot facet and subsetting

2014-11-27 Thread PIKAL Petr
4 6:13 PM > To: PIKAL Petr; R help > Subject: RE: [R] ggplot facet and subsetting > > Below > > John Kane > Kingston ON Canada > > This is OK but only in BW > > p<-ggplot(vec.c, aes(x=fi, y=nad1mi)) > > p+geom_point(size=5)+geom_line()+facet_grid(.~stroj)

Re: [R] HELP

2014-12-01 Thread PIKAL Petr
my abilities. If I want several graphs sharing one axis I use facet_grid. You can also check twoord.plot from plotrix, which is easier. Cheers Petr From: JAVAD LESSAN [mailto:jlessa...@ku.edu.tr] Sent: Friday, November 28, 2014 4:30 PM To: PIKAL Petr Subject: Re: [R] HELP Hi Sir! Hope you are

Re: [R] Fwd: PLEASE HELP ON R-LANGUAGE

2014-12-01 Thread PIKAL Petr
Hm. What do you meen by "to run a non stationary time series data" http://cran.r-project.org/web/views/TimeSeries.html lead you to some packages for testing stationarity. Did you check them? Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Beha

Re: [R] Sorting method used by order()

2014-12-02 Thread PIKAL Petr
Hi Can you be more specific? How do you want parametrize order? There is no sort.list argument in order. For sort list, the default method is "radix", AFAIK. Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of > Pierrick Bruneau > Sent: Tu

Re: [R] Calculate the area under a curve

2015-08-24 Thread PIKAL Petr
Hi Your data are rather wild so I am not sure if following function can do what you want. I designed it primarily for intagration of peaks from different sources. integ1 <- function (x, y, dm = -Inf, hm = +Inf) { ifelse(dm == -Inf, dm <- min(x), dm <- dm) ifelse(hm == +Inf, hm <- max(x)

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