[R] ggplot - position=position_dodge()) and scale_y_continuous

2019-07-30 Thread Knut Krueger via R-help
Hello to all, how can I can set both y as character to get the bars beside like example 1 and use scale_y_continuous And an additional question: why are the bar colors of x-axes = 8 turned datax= data.frame("fac"=c(c(rep(1,10),c(rep(2,10,"x"=c(c(1:10,c(1:10))),

[R] duplicates including first occurrence

2019-01-28 Thread Knut Krueger via R-help
Ho to all i get the results mtcars[duplicated(mtcars$wt,fromLast=TRUE),] Hornet Sportabout 18.7 8 360.0 175 3.15 3.44 17.02 0 032 Duster 36014.3 8 360.0 245 3.21 3.57 15.84 0 034 Merc 280 19.2 6 167.6 123 3.92 3.44 18.30 1 044

[R] time mathematics

2018-11-20 Thread Knut Krueger
I have an dataframe from with a given time format: "23:01:19" to change some given data: x=data.frame ("Y"=c(1:5),"TIME"=c("23:01:18","23:01:18","23:01:18","23:01:18","23:01:18")) I need to change the time increasing in seconds x=data.frame

[R] unique() duplicate() not what i am looking for

2018-11-19 Thread Knut Krueger
It should be simple but i do not find the right keywords: Dup = c(1,2,3,4,1,2,3,5) I need 4,5 as result unique(Dup) gives me [1] 4 1 2 3 5 duplicated(Dup) gives me [1] FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE I need [1] TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE Kind regards

Re: [R] "logical indexing, " [was] match() question or needle haystack problem for a data.frame

2018-10-26 Thread Knut Krueger
Am 25.10.18 um 16:13 schrieb peter dalgaard: Yes: x[!(x$A %in% y$B),] Ok thats in my opinion a little workaround why?: There is an = and != < and > means the opposite is available between terms. why is there f.e no %!in%, %notin% or !%in% This would be more intuitive. Kind regards

Re: [R] "logical indexing, " [was] match() question or needle haystack problem for a data.frame

2018-10-25 Thread Knut Krueger
Hi Bert, another question for indexing 1. is there a good manual for indexing 2. is it possible to get !%in% f.e x =data.frame("A"=c(1:5),"C"=c("A","B","C","D","E")) y =data.frame("B"=c(1,3,5)) test = x[x$A %in% y$B,] test = x[x$A %in% y$B,] test A C 1 1 A 3 3 C 5 5 E means: the result

Re: [R] match() question or needle haystack problem for a data.frame

2018-10-22 Thread Knut Krueger
Am 22.10.18 um 18:02 schrieb Bert Gunter: I suggest you spend a bit of time with an R tutorial or two and, in particular learn about "logical indexing," as this basic R construct seems to be mysterious to you. Hi Bert, especially the "match" help area is a little bit confusing. And

Re: [R] match() question or needle haystack problem for a data.frame

2018-10-22 Thread Knut Krueger
Am 22.10.18 um 17:01 schrieb Eric Berger: v <- match(Mydata$DATA1, needles, nomatch=NA) > found <- Mydata[ !is.na (v), ] > missing <- Mdata[ is.na (v), ] Thank you it is working, additionally as Bert suggested, it seems that Mydata[Mydata$DATA1 %in% needles,] is

[R] match() question or needle haystack problem for a data.frame

2018-10-22 Thread Knut Krueger
Hi to all I would like to reduce the "Mydata" to rows, only if Mydata$Data1 are in needles needles =c(14390, 14391, 14392, 14427, 14428, 14429, 14430, 14431, 14432, 14433, 14434, 14435, 14436, 14437, 14439, 14440, 14441, 15195, 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203,

Re: [R] subset only if f.e a column is successive for more than 3 values

2018-09-28 Thread Knut Krueger
Hi Jim, thank's it is working with the given example, but whats the difference when using testdata=data.frame(TIME=c("17:11:20", "17:11:21", "17:11:22", "17:11:23", "17:11:24", "17:11:25", "17:11:26", "17:11:27", "17:11:28", "17:21:43", "17:22:16", "17:22:19",

Re: [R] Installation of R/qtl

2018-09-27 Thread Knut Krueger
Am 27.09.2018 um 17:02 schrieb Swapan Kumar Tripathy: Sir, I have successfully installed R, but could not install the R/qtl. There is instruction that "To install R/qtl, the simplest approach is to start R and type install.packages("qtl"). But, I do not find any step where to type

[R] subset only if f.e a column is successive for more than 3 values

2018-09-27 Thread Knut Krueger
Hi to all I need a subset for values if there are f.e 3 values successive in a column of a Data Frame: Example from the subset help page: subset(airquality, Temp > 80, select = c(Ozone, Temp)) 29 45 81 35 NA 84 36 NA 85 38 29 82 39 NA 87 40 71 90 41 39

[R] counting similar strings in data.frame

2015-06-26 Thread Knut Krueger
Dear Members, is there a better solution to count the amounts of occurrence in a row with string data than with loops to get the count data.frame? test =data.frame(first=c(seven,two,five,four), second=c(three,one,three,one), third=c(four,two,three,four),

Re: [R] counting similar strings in data.frame

2015-06-26 Thread Knut Krueger
Sorry last count was wrong ... test =data.frame(first=c(seven,two,five,four), second=c(three,one,three,one), third=c(four,two,three,four), fourth=c(four,one,one,four)) count =data.frame(dobule1=c(four,two,three,NA),

Re: [R] counting similar strings in data.frame

2015-06-26 Thread Knut Krueger
Am 26.06.2015 um 10:38 schrieb PIKAL Petr: Hi I am little bit lost in your logic. Why triple in your fourth line is one. I expected it will be four? Petr Sorry yes you are right ... type mismatch Knut __ R-help@r-project.org mailing list -- To

[R] digits in matrix

2015-01-30 Thread Knut Krueger
I have a matrix winth integer values after an arithmetic calulation How can prevent the [1:3]1:3] part of the matrix to be converted to floats data = matrix(c(1:16),nrow=4,ncol=4) #create matrix data[4,] = data[4,]/3 data[,4] = data[,4]/3 data Kind regards Knut

Re: [R] digits in matrix

2015-01-30 Thread Knut Krueger
Am 30.01.2015 um 12:51 schrieb Duncan Murdoch: You are mixing up formatting with storage. Floating point numbers will be displayed without decimals if they are close enough to whole numbers. Duncan Murdoch Ok, I am talking from display data = matrix(c(1:16),nrow=4,ncol=4) #create matrix

Re: [R] digits in matrix

2015-01-30 Thread Knut Krueger
Am 30.01.2015 um 11:50 schrieb PIKAL Petr: You cannot. Matrix is a vector with dimensions so basically it has to have the same mode and type of data. The only way I can think about is to split matrix to 3 matrices before making calculation an keep those 3 matrices separate. Cheers Petr

Re: [R] RODBC Error - solved

2014-12-10 Thread Knut Krueger
Just an update This error can be reproduced with: Windows system without MS Office (especially Excel) and an Excel file with graphs inside a sheet. It does not depend whether this sheet is used or not for import. Knut __ R-help@r-project.org

[R] RODBC Error

2014-12-08 Thread Knut Krueger
There is a system wide installation for the university computer of r and Rcmdr (R-Commander) There a a few computer with the following message the user tries to open an excel sheet with R.Commander: (I assume the german message is from the german operating system win 7) library(RODBC,

Re: [R] writeWorksheet(....,rownames..) warning

2014-06-18 Thread Knut Krueger
Am 17.06.2014 23:11, schrieb jim holtman: You were using 'rownames' incorrectly. Here is the correct way: library(XLConnect) wb - loadWorkbook(writeWorksheet.xlsx, create = TRUE) createSheet(wb, name = CO2) writeWorksheet(wb, CO2, sheet = CO2,rownames=Row Names) saveWorkbook(wb) Thank you I

[R] Matrix Tests

2014-06-17 Thread Knut Krueger
There is a Mtrix Tester on the pages of Charlotte K. Hemelrijk, with TauKr-Test Partial TAU Kr-TEst , MantelZ, R-Test andK TEst Is there a similar package on R for that? ( http://www.rug.nl/research/behavioural-ecology-and-self-organization/people/hemelrijk scroll down to MatrixTester Social

[R] writeWorksheet(....,rownames..) warning

2014-06-17 Thread Knut Krueger
Any Idea to prevent the warning message? library(XLConnect) wb - loadWorkbook(writeWorksheet.xlsx, create = TRUE) createSheet(wb, name = CO2) writeWorksheet(wb, CO2, sheet = CO2,rownames=c(,1:84)) saveWorkbook(wb) Warning message: In names(res)[1] - colname : number of items to replace is not

Re: [R] \ escape sequence and windows path

2014-05-22 Thread Knut Krueger
Am 20.05.2014 19:03, schrieb Duncan Murdoch: I have no idea what you mean by a callback from utils. clipboard {utils} readClipboard function (format = 1L, raw = FALSE) .Call(C_readClipboard, format, raw) bytecode: 0x080d6c20 environment: namespace:utils I do not know whether it is an real

Re: [R] \ escape sequence and windows path

2014-05-22 Thread Knut Krueger
Sorry https://en.wikipedia.org/wiki/Callback_%28computer_programming%29 Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] \ escape sequence and windows path

2014-05-21 Thread Knut Krueger
Am 20.05.2014 19:00, schrieb David L Carlson: Now I understand. Not really a solution, but you can instruct students to use only forward slashes in their paths since R will convert to backslash on Windows systems automatically. After a couple of broken commands, they should get the hang of

[R] \ escape sequence and windows path

2014-05-20 Thread Knut Krueger
Is there any function to change the windows path to linux path? especially I would like to have the possibility to use f.e path=C:\foo1\foo2\ I can import those paths with path = readline() but not directly in a script Regards Knut __

Re: [R] \ escape sequence and windows path

2014-05-20 Thread Knut Krueger
Am 20.05.2014 15:22, schrieb Jeff Newmiller: Most importantly, \\ is a string literal containing ONE backslash character. Yes you can create strings in R source code that represent Windows-style paths, but they must APPEAR different in that context. You may find it helpful to know that the

Re: [R] \ escape sequence and windows path

2014-05-20 Thread Knut Krueger
Am 20.05.2014 17:32, schrieb Bert Gunter: paste(a,b,sep=\\) ## \\ is the escaped single backslash [1] a\\b cat(paste(a,b,sep=\\)) a\b Does this help clarify? Or have i misunderstood you? @David and @Bert unfortunately yes. My question is more a system level question as about any

Re: [R] XLConnect readWorksheet comma decimal sign

2013-12-03 Thread Knut Krueger
Am 02.12.2013 21:28, schrieb David Winsemius: In fact you can set that globally with: ?options options()$OutDec # my setting [1] . Oh sorry I thought you mentioned to set excel globally to dot. no change when setting it to dot. I seems that XLConnect is not able to deal with NA in Excel,

Re: [R] XLConnect readWorksheet comma decimal sign

2013-12-02 Thread Knut Krueger
Am 29.11.2013 20:39, schrieb David Winsemius: Thats impossible, we are used to hit the comma I don't know what that means. it is common here, that the decimal sign is commy All computer in the cip-pools are using the comma ( an I think 99.9% of all other computers here) Can you imagine what

Re: [R] XLConnect readWorksheet comma decimal sign

2013-11-29 Thread Knut Krueger
Am 25.11.2013 13:06, schrieb Knut Krueger: how can I read exel files where the decimal sign is comma instead dot. I get the data as ascii and when converting 3,5 with as.numeric the 3,5 will be converted to NA I think here is a major bug because no warning is genereated. It is impossible

Re: [R] XLConnect readWorksheet comma decimal sign

2013-11-29 Thread Knut Krueger
Am 29.11.2013 18:31, schrieb David Winsemius: On Nov 29, 2013, at 6:18 AM, Knut Krueger wrote: Am 25.11.2013 13:06, schrieb Knut Krueger: how can I read exel files where the decimal sign is comma instead dot. I get the data as ascii and when converting 3,5 with as.numeric the 3,5

[R] XLConnect readWorksheet comma decimal sign

2013-11-25 Thread Knut Krueger
Hi to all, how can I read exel files where the decimal sign is comma instead dot. I get the data as ascii and when converting 3,5 with as.numeric the 3,5 will be converted to NA Kind Regards Knut __ R-help@r-project.org mailing list

Re: [R] XLConnect readWorksheet comma decimal sign

2013-11-25 Thread Knut Krueger
Am 25.11.2013 11:29, schrieb PIKAL Petr: Hi Either change comma to dot in Excel (but sometimes Excel is rather reluctant to accept such changes). Or change commaa to dot in R which probably can be easily done by gsub command Or read data with option dec=,. I do not know XLConnect but in

[R] any news about resetting last.warning - warnings()

2013-06-25 Thread Knut Krueger
Hi to all, I need a possibility do delete the last warning to write the suitable warning (not the last warning from minutes ago) into a file. I found a lot of treats but no really solution. Regards Knut __ R-help@r-project.org mailing list

Re: [R] read excel files problem [was] Rcmdr Bug

2013-05-17 Thread Knut Krueger
(dataset) - follow up to r-de...@r-project.org Regards, Pascal 2013/5/17 Knut Krueger r...@knut-krueger.de mailto:r...@knut-krueger.de may be it is a bug: if a excel file is not containing headlines the first data row will not be imported Knut

Re: [R] Rcmdr Bug?

2013-05-17 Thread Knut Krueger
Am 17.05.2013 13:36, schrieb John Fox: Dear Knut, This is really more a limitation than a bug. Like most of the dialogs in the Rcmdr, the dialog to read Excel files uses existing facilities in R and R packages. I'll see whether it's possible to add an option to read a data set without

[R] Rcmdr Bug?

2013-05-16 Thread Knut Krueger
may be it is a bug: if a excel file is not containing headlines the first data row will not be imported Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] substitute rename.vars {gdata}

2013-04-24 Thread Knut Krueger
is there a equivalent to rename.vars {gdata}? As I do not use read.xls i am not using library gdata for a package except this function Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] time from excel with XLConnect

2013-04-23 Thread Knut Krueger
When I read a time hh:mm:ss from a excel sheet with gdata read.xls it is as expected. When I read the time with readWorksheet I get 1899-12-31 00:20:00 UTC. I would prefer XLConnect because it does not nee perl installed but the data coming with XLConnect is not usable.

Re: [R] R CMD build

2013-04-22 Thread Knut Krueger
Am 21.04.2013 04:14, schrieb Henrik Bengtsson: FYI, R CMD build ... works just fine on Windows (and I'm sure R cmd build ... won't). /Henrik Yes it works, unfortunately windows user need not consider capitals or not. When sitting on a Windows PC I usually typing lower cas only on Linux I am

Re: [R] R CMD build

2013-04-22 Thread Knut Krueger
Am 21.04.2013 04:59, schrieb Gabor Grothendieck: That is correct but if one were using the batchfiles I mentioned then both work. -- Statistics Batch files? I can find only xls2csv.bat and RunSnowWorker.bat in the 3.0 directories. Knut __

[R] R CMD build

2013-04-20 Thread Knut Krueger
I have no idea where I must R CMD build... I am using Windows 7 wiht pearl installed http://stat.ethz.ch/R-manual/R-patched/library/utils/html/PkgUtils.html its completely unclear for me ... sorry Knut __ R-help@r-project.org mailing list

Re: [R] R CMD build

2013-04-20 Thread Knut Krueger
Am 20.04.2013 15:50, schrieb Gabor Grothendieck: Note that there is a separate directory for the 64-bit R executables. Does it make any difference to check and pack the source files iwth 32 or 64 bit? Also, downloading MinGW should not be needed. Rtools already contains the needed UNIX

Re: [R] chi square exact test

2013-03-07 Thread Knut Krueger
Am 06.03.2013 22:20, schrieb David L Carlson: Actually, the http://www.sussex.ac.uk/its/pdfs/SPSS_Exact_Tests_20.pdf file indicates that for small samples and a one-way chi square test, SPSS uses a multinomial distribution to tabulate the distribution of chi square for a given N, K, and

[R] chi square exact test

2013-03-06 Thread Knut Krueger
SPPS is offering a chi square exact test for one dimensional data with small sample size (6). What is the comparable function in R? Kind Regards Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] chi square exact test

2013-03-06 Thread Knut Krueger
and International Affairs University of South Florida office: SOC 012M Sent from my iPhone On Mar 6, 2013, at 6:30 AM, Knut Krueger r...@knut-krueger.de wrote: SPPS is offering a chi square exact test for one dimensional data with small sample size (6). What is the comparable function in R

Re: [R] chi square exact test

2013-03-06 Thread Knut Krueger
Am 06.03.2013 18:29, schrieb Milan Bouchet-Valat: Le mercredi 06 mars 2013 à 18:03 +0100, Knut Krueger a écrit : Am 06.03.2013 14:27, schrieb Nicole Ford: Dear Nicole, my be you are wondering about, but I know Google an I am using google before I am asking here. If you are more familiar

[R] legend with pch and colors possible?

2011-11-21 Thread Knut Krueger
Hi to all is it possible to build a legend with plot(NA, type = l,col=blue,lwd=2,ylim=c(-0.05,10),xlim=c(0,13),xaxt = n,xlab=,ylab=) # Grafikmodus mit erster Linie starten Lcolors=c(blue,orchid,green) lsymbols= c(16,17,15) Ltext= c(text1,tex2,text3) legend(topleft,cex=1,pch = lsymbols,

Re: [R] legend with pch and colors possible?

2011-11-21 Thread Knut Krueger
Am 21.11.2011 10:06, schrieb Jim Lemon: Hi Knut, Have a look at the legendg function (plotrix). Hi Jim Thanks for the package it is very useful .. but I did not solve my problem. As I have not much time I tried some basic configuration but the characters are einther above the colored sqares

Re: [R] similar package in R like SKEW CALCULATOR?

2011-11-08 Thread Knut Krueger
Am 08.11.2011 13:01, schrieb R. Michael Weylandt: See the replies given to you two days ago when you asked the same Hi Michael, thank you for your second answer. I did not get my first question and I did not get your answer via mail - strange Knut

[R] similar package in R like SKEW CALCULATOR?

2011-11-07 Thread Knut Krueger
Hi to all is there a similar package like the SKEW CALCULATOR from Peter Nonacs (University of California - Department of Ecology and Evolutionary Biology) http://www.eeb.ucla.edu/Faculty/Nonacs/shareware.htm Kind Regards Knut __

[R] similar package in R like SKEW CALCULATOR?

2011-11-05 Thread Knut Krueger
Hi to all is there a similar package like the SKEW CALCULATOR from Peter Nonacs (University of California - Department of Ecology and Evolutionary Biology) http://www.eeb.ucla.edu/Faculty/Nonacs/shareware.htm Kind Regards Knut __

[R] read.xls - rotate data.frame

2011-03-25 Thread Knut Krueger
Hi to all, how could I to rotate automatically a data sheet which was imported by read.xls? x1 x2 x3 xn y1 1 4 7 ... xn/y1 y2 2 5 8 xn/y2 y3 3 6 9xn/y2 yn ... ... ... Xn/Yn to y1 y2 y3 yn x1 1 23 . Yn/x1 x2 4 5

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Knut Krueger
Am 25.03.2011 12:31, schrieb Philipp Pagel: If all the columns (x) are of the same type (e.g. all numeric) you can use t(). Example: Unfortunately we have mixed types f.e text , dates times , and numbers Knut __ R-help@r-project.org mailing list

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Knut Krueger
Am 25.03.2011 12:56, schrieb Philipp Pagel: OK - in that case you can't fit the data into data.frame. Possibley you cold get what you need using some kind of list structure but I think it's better to ask why you need to transpose the data. we have (imported from excel) frame -

Re: [R] read.xls - rotate data.frame

2011-03-25 Thread Knut Krueger
Am 25.03.2011 14:51, schrieb Philipp Pagel: The frame$y2 notation still only works for columns, of course. Maybe, if you tell us some more about your actual analysis, more help can be provided. Thank,s but the only question was to use a common notation like for columns if the excel sheet

[R] Plots inside a Plot

2010-11-01 Thread Knut Krueger
hi, is it possible to draw a plot inside another plot f.e in the upper right corner. I do not mean the possbility par(mfrow = c(2,2). Kind Regards Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Plots inside a Plot

2010-11-01 Thread Knut Krueger
Am 01.11.2010 12:31, schrieb Jim Lemon: On 11/01/2010 09:59 PM, Knut Krueger wrote: hi, is it possible to draw a plot inside another plot f.e in the upper right corner. I do not mean the possbility par(mfrow = c(2,2). Hi Knut, Try the subplot function in the TeachingDemos package. Hi Jim

Re: [R] points( .... pch=2) substitue pch with image

2010-10-20 Thread Knut Krueger
Am 19.10.2010 23:23, schrieb Greg Snow: Look at my.symbols and ms.image in the TeachingDemos package. Thank you, that's I was looking for. Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] points( .... pch=2) substitue pch with image

2010-10-19 Thread Knut Krueger
Hi to all, is there any function where I can substitute the characters with an (jpg) image ? Kind regards Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] randomisation for matrix

2010-07-28 Thread Knut Krueger
Hi to all, I am looking for a randomisation procedure for a single matrix, including a possibility to set the number of randomisations and the to set the number of row and columns . Knut __ R-help@r-project.org mailing list

Re: [R] Tinn-R related problem

2010-07-28 Thread Knut Krueger
ForestStats schrieb: Hello, I too am having this problem. Some two minutes ago all was well then all of a sudden I cannot backspace or delete or use arrows etc.. there is a special Tinn-R forum: http://sourceforge.net/projects/tinn-r/forums Kind Regards Knut

Re: [R] fisher's posthock test or fisher's combination test

2010-07-28 Thread Knut Krueger
I was looking for: fisher.comb - function (pvalues) { df=length(pvalues) ch2=(-2*sum(log(pvalues))) return pchisq(ch2, df=df, lower.tail=FALSE) } http://en.wikipedia.org/wiki/Fisher%27s_method for the second part: the calculation of the p-value from the result of fischer combination test .

Re: [R] randomisation for matrix

2010-07-28 Thread Knut Krueger
Gray Calhoun schrieb: Hi Knut, I think you're going to have to be more specific. The code matrix(rnorm(25), 5, 5) I found the answer there is a generator seed field in Ucinet, I do not know why its possible to set the random generator starting point, by hand and I assume the generator

[R] Chi-square distribution probability density function:

2010-07-21 Thread Knut Krueger
Hi to all I found an formular of an ** ***p-Value Calculator for the Chi-Square test* *http://www.danielsoper.com/statcalc/calc11.aspx* *with the formula* *http://www.danielsoper.com/statkb/topic11.aspx* *what's the gamma function of this formula in r?* *df=5* *ch2=25.50878* *the following code

Re: [R] Chi-square distribution probability density function:

2010-07-21 Thread Knut Krueger
David Winsemius schrieb: And exactly why did you think I offered ?Chisquare I was completely on the wrong way, and tried to find a solution with the formula instead to substitute the formula. So I tried to implement pchisq into the formula - and of course I got wrong values ... Thank's

[R] looking for .. dec if vector if element x

2010-05-18 Thread Knut Krueger
Hi to all, I am just looking for more efficient ways ;-) is there a better way instead a loop to decrease x if greater y test - c(1,3,5,7,9) decrease if greater 1 to test2 - c(1,2,4,6,8) Kind regards Knut __ R-help@r-project.org mailing list

Re: [R] looking for .. dec if vector if element x

2010-05-18 Thread Knut Krueger
Henrique Dallazuanna schrieb: Try this also: pmax(test - 1, 1) O test - c(1,3,5,7,9,11,12,13,14) test test - pmax(test - 1, 1) test This works for 1 what about if I would dec 11: to 14 to close the gap between 9 and 10 ? I did not find the answer with the help file Thank you Knut

Re: [R] looking for .. dec if vector if element x

2010-05-18 Thread Knut Krueger
Thank you Adrian, its working fine. Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

[R] merging two vectors

2010-05-14 Thread Knut Krueger
Hi to all, is there a better way instead for loop to merge two vectors: V1 - c(1,3,5,7,9) V2- c(20,40,60,80,100) to V_merged - c(1,20,3,40,5,60,7,80,9,100) Kind regards Knut __ R-help@r-project.org mailing list

Re: [R] fisher's posthock test or fisher's combination test

2010-05-13 Thread Knut Krueger
(Ted Harding) schrieb: Thank you, for your answer, As to Fisher's combination test, I'm not sure whether this is meant to be something different from the above. It should be the same, only another name. Regards Knut __ R-help@r-project.org

[R] fisher's posthock test or fisher's combination test

2010-05-12 Thread Knut Krueger
Hi to all is there a fisher's post hock test or fisher's combination test in R available? Maybe not -- its very easy to do it in excel ... Kind regards Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] deleting column from data frame

2010-02-23 Thread Knut Krueger
Hi to all, test - data.frame(X=c(1:4),Y=c(5:8),Z=c(8:11)) test - test[,-2] Is there a way to specify the col name Y to delete instead the number? Kind regards Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] String question

2009-12-23 Thread Knut Krueger
Hi to all I need a string like temp - paste(m1,m2,m3,sep=,) But i must know how many items are in the string,afterwards the other option would be to use a vector temp - c(m1,m2,m3) No problem to get the count of items but I must get afterwards the string m1,m2,m3 No problem to build the string

Re: [R] String question

2009-12-23 Thread Knut Krueger
Will this do? temp - paste(m, 1:3, sep=,collapse=,) Unfortunately not, because I explained the example not detailed enough. The string could have different Items, like November, December, Monday, Tuesday, Daylight and so on Therefore I must count the Items of the string separated by , or

Re: [R] String question

2009-12-23 Thread Knut Krueger
Jim Lemon schrieb: Not as easy as I thought it would be, but: mlist-as.list(paste(m,1:sample(5:10,1),sep=)) do.call(paste,c(mlist,sep=,)) Hi Jim, yes it works :-) temp - c(November, December,Monday,Tuesday) length(temp) #getting the length of the vector

Re: [R] String question

2009-12-23 Thread Knut Krueger
Hi Baptiste, Isn't paste doing exactly this? yes indeed - surprising temp - c(November, December,Monday,Tuesday) paste(temp, collapse=,) paste(temp, sep=,) I tried to use sep :-( Arguments |...| one or more *R* objects, to be converted to character vectors. |sep| a

Re: [R] GLM Question

2009-12-04 Thread Knut Krueger
Peter Flom schrieb: What do you mean by better? Dear Peter Thank you for your kind respons as well. You are right, we are in constant debate whether it makes sense to remove variables (no matter whether significant or not) from a total dataset which in itself has a certain meaning and may not

[R] GLM Question

2009-12-03 Thread Knut Krueger
Hi to all I think this is more an general question to GLMs. The result was better in all prior GLMs when I admitted the non significant factors, but this is the first time that the result is worse than before. What could be the reason for that?

Re: [R] sum(row1==y) if row2=x

2009-11-15 Thread Knut Krueger
Thanks to all R is fantastic but ... not easy to know all possible terms ;-) Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

[R] sum(row1==y) if row2=x

2009-11-13 Thread Knut Krueger
Hi to all is there any construct to sum data=data.frame(row1=c(1,1,3,1,2,3,2,2,1,3,4,5,2,3,2,1) , row2=c(2,2,1,1,1,2,1,2,1,1,1,1,2,2,2,1) ) Means I would like to get all y of row1 if in row2 of the data.frame is an x f.e row1=3 and row2=2 so I would like to get 6 And

Re: [R] object .trPaths not found

2009-07-13 Thread Knut Krueger
Uwe Ligges schrieb: I have to admit that I have no idea what we are talking about here (yes, I tend to forget many things these days) - and you have not cited the original message, unfortunately (nor have you specifies R versions, Tinn-R versions and both OS versions, but just one) ...

Re: [R] object .trPaths not found

2009-07-13 Thread Knut Krueger
Thomas Petzoldt schrieb: Hi, using a variable named .trPaths is a feature and a frequent nuisance of recent Tinn-R and also explained in the Tinn-R docs. Solution 1: In Tinn-R select the menu: R -- Configure -- and then Temporarily or Permanent Solution 2: Manually edit file

Re: [R] object .trPaths not found

2009-07-07 Thread Knut Krueger
Uwe Ligges schrieb: Maybe, but the may depend on your script, your OS, your R version, used packages and so on. Hence please read and follow the posting guide and provide commented, minimal, self-contained, reproducible code. Hi Uwe, I was just asked the same question and hat the same

[R] plot() - thicker points when pair exist more than 1 time?

2009-04-24 Thread Knut Krueger
Hi to all, is it possible to show in anyway that point 1,1 is existing more than 1one time? f.e.: f- data.frame(x=c(1,3,5,6,1),y=c(1,2,3,4,1)) plot(f) Regards Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Igraph: family 'serif' not included in PostScript device

2009-04-16 Thread Knut Krueger
Does anybody know how to solve this error? postscript(file= file.ps, family = Helvetica, font = Helvetica) plot.igraph(g, layout=layout.circle, vertex.label.font=2) dev.off() error in text.default(x, y, labels = labels, col = label.color, family = label.family, : family 'serif' not included

Re: [R] Search for a graph package - see link

2009-04-15 Thread Knut Krueger
Gábor Csárdi schrieb: The would prefer two parallel arrows one for each direction. You can set 'curved' to a value close to zero and then the arrows will be only a bit curved. No I am lost ... do you mean? ... E(g)$curved - 0.5 ... plot.igraph(g, layout=layout.kamada.kawai,

Re: [R] Search for a graph package - see link

2009-04-15 Thread Knut Krueger
Gábor Csárdi schrieb: Hi Gabor, it seems that anybody doesnt not want us to find a solution ;-) and install version 0.5.2, it is on CRAN now (except for OSX). I got the 0.5.1 at 06.April.2009 I just tried the Munich Mirror got 0.5.1 there is also only 0.5.1 on

Re: [R] Search for a graph package - see link

2009-04-15 Thread Knut Krueger
Gábor Csárdi schrieb: Dear Gabor, I am very sorry but i am not able to reproduce your example. there is no change, i am using r 2.8.0 library(igraph) g - graph.ring(3, dir=TRUE, mut=TRUE) g$layout - layout.circle E(g)$curved - 0.5 plot(g) E(g)$curved - 0.1 plot(g) It is a good idea to

Re: [R] Search for a graph package - see link

2009-04-15 Thread Knut Krueger
Knut Krueger schrieb: http://cneurocvs.rmki.kfki.hu/igraph/download/igraph_0.5.2.zip Server is now available again I got the file. Thanks Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Search for a graph package - solved

2009-04-15 Thread Knut Krueger
Dear Gábor, thank you for your help, I tried the 0.5.2 Version. It works fine. The team is very satisfied with the curved graph. Regards Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Search for a graph package - see link

2009-04-14 Thread Knut Krueger
Gábor Csárdi schrieb: Hmmm, how should 'plot' know automatically what size/width you want? Sorry, I don't really know what you want to achieve here. If you want to calculate the width from some properties of the graph, then simply do that and assign it as the 'width' argument. Hi Gábor, the

Re: [R] Search for a graph package - see link

2009-04-14 Thread Knut Krueger
Follow along these lines: http://lists.gnu.org/archive/html/igraph-help/2009-04/msg00104.html plus set the 'width' edge attribute to represent the number of actions. Thanks,Gabor this was my first solution, but unfortunately the data are very complicated to visualize. let me expand the

Re: [R] Search for a graph package - see link

2009-04-07 Thread Knut Krueger
Gábor Csárdi schrieb: Hi Knut, What about subtracting one? graph(data-1, directed=TRUE) yes that is what i mean and did with 0 to n-1 but the item numbers in all other figures are from 1 to n 2. is it possible to change the thickness of the lines depending of the interactions

Re: [R] Search for a graph package - see link

2009-04-07 Thread Knut Krueger
Gábor Csárdi schrieb: Hi Gábor, thank you for your hint to your package. It is very useful for us. I tried to use the example: http://igraph.sourceforge.net/screenshots2.html#2 Two questions: 1. Is it possible to start from 1 to n instead from 0 to n-1 using graph(data, directed=TRUE) 2. is it

[R] Search for a graph package - see link

2009-04-06 Thread Knut Krueger
Hi to all, does anybody knows whether there is a package to plot those http://www.equine-science.de/temp/graph.jpg graphs. the thickness of the points and/or the lines should be represent the numbers of behaviours With kind regards Knut __

Re: [R] loop with splitted data -solved

2008-08-27 Thread Knut Krueger
Thank you for the hints, finally I was looking for the substitution of splitted$2 to splitted[[as.character(counter)]] I did not know that I can substitute f.e the $2 with [[2]] or/and $y (second column) with [[2]] Knut __ R-help@r-project.org

[R] loop with splitted data

2008-08-26 Thread Knut Krueger
Hi to all, seems to be simple, but I do not find the solution: What must I write for the splitted to get splitted$3$x and splitted$3$x y = c(rep(2,5),rep(3,5)) ma - data.frame(x = 1:10, y=y ) splitted - split(ma, ma$y) for (counter in (min(ma$y):max(ma$y))) { splitted$x } Regards

  1   2   >