[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))),
   "y"=c(89,69,46,57,43,5,83,35,15,19,
 51,16,36, 4, 3,3,77, 5,30,61))


ggplot(data=datax, aes(x=x, y=as.character(y), fill=fac)) +
  geom_bar(stat="identity", color="black", position=position_dodge())+
  theme_minimal()+
  scale_x_continuous(breaks=c(1:12)) #+
 # scale_y_continuous(limits=c(0, 100))


ggplot(data=datax, aes(x=x, y=y, fill=fac)) +
  geom_bar(stat="identity", color="black", position=position_dodge())+
  theme_minimal()+
  scale_x_continuous(breaks=c(1:12)) +
scale_y_continuous(limits=c(0, 100))


Kind regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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


mtcars[duplicated(mtcars$wt),]

Merc 280  19.2   6 167.6 123 3.92 3.44 18.3  1  044
Merc 280C 17.8   6 167.6 123 3.92 3.44 18.9  1  044
Maserati Bora 15.0   8 301.0 335 3.54 3.57 14.6  0  158


The first occurrence is missing - is there any possibility to get

Hornet Sportabout 18.7   8 360.0 175 3.15 3.44 17.02  0  032
Merc 280  19.2   6 167.6 123 3.92 3.44 18.30  1  044
Merc 280C 17.8   6 167.6 123 3.92 3.44 18.90  1  044
Duster 36014.3   8  360 245 3.21 3.57 15.84  0  034
Maserati Bora 15.0   8  301 335 3.54 3.57 14.60  0  158


Kind regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 
("Y"=c(1:5),"TIME"=c("23:01:18","23:01:19","23:01:20","23:01:21","23:01:22"))



Is it possible without any additional package ?


Kind Regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 where I am looking for is:
test
A C
2 2 B
4 4 D

no problem with a loop but in a short way I do not find a solution

Kind Regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 additional using a couple of programming languages with different 
logical operators and different syntax is misleading me sometimes to the 
wrong direction...


So the logic operations itself are not mysterious ;-)  but the 
translation to R.
And thank's a lot to give me the keyword to find for what I am was 
looking for: logical indexing.


I can not count the sites where I was looking to solve my problem .. 
with the wrong keywords ... :-)


Kind Regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 doing the same.

Kind Regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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, 15204, 15205, 
15206, 15207, 15208, 15209, 17615, 17616, 17617, 17618, 17619, 17620, 
17621, 17622, 17623, 17624, 17625, 17626, 17627, 17628, 17629, 17630, 
17631, 17679, 17680, 17681, 17682, 17683, 17823, 17824, 17825, 17826, 
17827, 17828, 17829, 17830, 17831, 17862, 17863, 17864, 17865, 17866, 
17867, 17868, 17869, 17870, 17871, 17872, 17873, 17874, 17875, 17876, 
17877, 17878, 17879, 17880, 17881, 17882, 17883, 19255, 19256, 19257, 
19258, 21289, 21290, 21291, 21292, 22890, 22891, 22892, 22893, 22894, 
22895, 22896, 22897, 22898, 22899, 22900, 22901, 22902, 40428, 40429, 
40430, 40431, 40432, 40433, 40434, 40435, 40436, 40437)


Haystack =c(14390, 14391, 14392, 14427, 14428, 14429, 14430, 14431, 
14432, 14433, 14434, 14435, 14436, 14437, 14439, 14440, 14441, 15187, 
15188, 15195, 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203, 
15204, 15205, 15206, 15207, 15208, 15209, 16717, 16718, 17615, 17616, 
17617, 17618, 17619, 17620, 17621, 17622, 17623, 17624, 17625, 17626, 
17627, 17628, 17629, 17630, 17631, 17679, 17680, 17681, 17682, 17683, 
17817, 17818, 17823, 17824, 17825, 17826, 17827, 17828, 17829, 17830, 
17831, 17862, 17863, 17864, 17865, 17866, 17867, 17868, 17869, 17870, 
17871, 17872, 17873, 17874, 17875, 17876, 17877, 17878, 17879, 17880, 
17881, 17882, 17883, 17886, 19255, 19256, 19257, 19258, 21289, 21290, 
21291, 21292, 22890, 22891, 22892, 22893, 22894, 22895, 22896, 22897, 
22898, 22899, 22900, 22901, 22902, 40428, 40429, 40430, 40431, 40432, 
40433, 40434, 40435, 40436, 40437, 40710, 40711, 49127, 49128, 52768)


Mydata =data.frame (DATA1=Haystack, Data2=c(1:length(Haystack)))



match(Mydata$DATA1, needles, nomatch=NA) does find all data which are in 
needle - the others are set to the nomatch value.


But I don not find out how to reduce the data.frame  -  maybe match() is 
not helpful for that.


Kind regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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", "18:04:48", "18:04:49", 
"18:04:50", "18:04:51", "18:04:52", "19:50:09", "00:59:27", "00:59:28",

"00:59:29", "04:13:40", "04:13:43", "04:13:44"),

index=c(8960,8961,8962,8963,8964,8965,8966,8967,8968,9583,9616,9619,12168,12169,12170,12171,12172,18489
  ,37047,37048,37049,48700,48701,48702))

seqindx<-rle(diff(testdata$index)==1)
runsel<-seqindx$lengths >= 3 & seqindx$values
# get the indices for the starts of the runs
starts<-cumsum(seqindx$lengths)[runsel[-1]]+1
# and the ends
ends<-cumsum(seqindx$lengths)[runsel]+1

eval(parse(text=paste0("testdata[c(",paste(starts,ends,sep=":",collapse=","),"),]")))

the result (index)  is 
12168,9619,9616,9583,8968,12168,12169,12170,12171,12172



maybe the gaps between .. 8967,8968,9583,9616,9619,12168,12169 ..?

Regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 install.packages("qtl") during the process of installing R.
  Kindly, advice me and suggest steps to install R/qtl.
Looking forward your suggestion.


You can install packages only after R is installed and working.

If you are not familiar with the R console  you can try the GUI Rstudio 
https://www.rstudio.com/


Kind regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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   87
42 NA   93
43 NA   92
44 23   82
.

I would like to get only

...
40 71   90
41 39   87
42 NA   93
43 NA   92
44 23   82


because the left column is ascending more than f.e three times without gap

Any hints for a package or do I need to build a own function?

Kind Regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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),
 fourth=c(four,one,one,four))



count =data.frame(double1=c(four,two,three,NA),
 double2=c(NA,one,NA,NA),
 triple=c(NA,NA,NA,one))


double1: first double occurrence in row  (NA if triple available)
double2: second double occurrence in row (NA if triple available or if 
there is only one double)

triple: triple occurrence in row (NA if a double available)


Kind regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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),
 double2=c(NA,one,NA,NA),
 triple=c(NA,NA,NA,four))

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 UNSUBSCRIBE and more, see
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, reproducible code.


[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

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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
data[4,] = data[4,]/3
data[,4] = data[,4]/3
#why is it displayed without decimals here:
data[1:3,1:3]
#and why is data[1:3,1:3] diplayed with 2 decimals here
data

and what could be the solution to display data[1:3,1:3] part when data 
is used  without decimals, if there are no


Kind regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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



but looking to data[,3] this column is not converted, and the matrix is 
mixed


Regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 mailing list -- To UNSUBSCRIBE and more, see
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, reproducible code.


[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, pos=15)
Warning in odbcDriverConnect(con, tabQuote = c([, ]), ...) :
  [RODBC] FEHLER: Status IM002, Code 0, Nachricht [Microsoft][ODBC 
Driver Manager] Der Datenquellenname wurde nicht gefunden, und es wurde 
kein Standardtreiber angegeben

Warning in odbcDriverConnect(con, tabQuote = c([, ]), ...) :
  ODBC connection failed
Error in sqlTables(channel) : first argument is not an open RODBC channel


I do not know what the difference of the Computers systems could be.
Any hint for me? I am not able to reproduce this error with my Win 7 
computers...



Regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 misunderstood the man file as I thougt if tehre is no 
rownames=TRUE/FALSE I must support the names .



Tell me what you want to do,


Supporting the rownames in the ecel file

but it is solved thank you

__
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, reproducible code.


[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 interaction matrices are often analysed with the help of 
matrix-statistics, such as the TauKr test (Hemelrijk, 1990a; Hemelrijk, 1990b). 
The program for such analyses, MatrixTester, can be downloaded here [manual]. 
For questions regarding matrix statistics for social interaction matrices or 
the program MatrixTester, contact Charlotte Hemelrijk.


Kind Regards 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, reproducible code.


[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 a multiple of replacement length

__
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, reproducible code.


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 callback or a normal call to an C 
subroutine

https://en.wikipedia.org/wiki/Callback_%28computer_programming%29Knut

__
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, reproducible code.


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 commented, minimal, self-contained, reproducible code.


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 it.

David C

this was the first idea, but it seems not the easiest way ...

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, reproducible code.


[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

__
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, reproducible code.


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 print 
function can output escaped strings suitable for inclusion in R code, while the cat 
function can output those same strings without the escaping.


Thanks for your answer,

I am familiar with the escape strings, but I was looking for a way to 
convert copied path from windows:


working:

y=readline()
# paste f.e c:\foo1\foo2
y
[1] c:\\foo1\\foo2


but I was looking for

y=foo(c:\foo1\foo2).
because it is annoying to change all \ to \\ or to /

Regards 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, reproducible code.


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 converting functions.


The question is how to paste a windows path directly into an R script 
(without readline() or readClipboard() and how could I convert this 
string that it is usable in R. Means any function which is not using 
escape characters


it seems to be possible for readline() an  readClipboard().

I do not want to use y=readline() I do want to use 
y=foo(c:\foo1\foo2\) but this seems to be impossible because R is 
interpreting one backslash as escape sequence. So how does readline() 
and readClipboard() are working? Is there any other callback from utils 
which is able to deal with this?


I am afraid there is no way.

The reason is to prevent errors for beginning windows R user. If the 
path is long they either forget to convert one backslash or all and then 
they are frustrated that it is not working. And telling them to use 
search and replace ... Whatever they would replace it might be worse 
than before ;-)


regards 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, reproducible code.


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, means its string instead an number after importing.




  If you continue having difficulty using XLConnect, then you should contact 
the authors of that package.

I tried - no answer yet.

Thank you 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, reproducible code.


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 would happen after  changing  this to dot?
Or in the other way, try to get the people in your country to use the 
,comma as separator. It would cause a big jumble.


Until you show a reproducible example, we will not be able to offer 
further advice: 
That*s the problem ... I am still trying to find out  what happened. It 
was definitely wrong in two cases

I was sure that I found the reason when starting this tread...

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, reproducible code.


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 to change  excel to dot decimal separator.
First reason it is unusual  in our (and I think also  other countries).
Lot of computers in the university are using decimal separator mostly 
without R. The user would be  unable (or simply do not want) to use it 
furthermore.


A question
does anybody know whether Rcmdr and XLConnect are using the same or 
different ways to import Excel?
We found also that RCmdr is setting comma separated values to na if 
there is an NA in the column.


Maybe it more useful to discuss this in the devel group?  (set the 
follow up to DEVEL)


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, reproducible code.


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 will 
be converted to NA

I think here is a major bug because no warning is genereated.

You were already advised how to change the defaults for R's input functions' 
behaviors with respect to decimal separators. (I would add that you should also 
become familiar with the 'colClasses' argument.)

? I was adviced:

ither change comma to dot in Excel (but sometimes Excel is rather reluctant to 
accept such changes).

Thats impossible, we are used to hit the comma


Or change commaa to dot in R which probably can be easily done by gsub command

Thats also impossible because the data are lost after teh import


Or read data with option dec=,. I do not know XLConnect but in read.table it 
is optional parameter and maybe it is also readWorksheet.

Read data has no problem

does anybody know whether Rcmdr and XLCOnnectare using the same or different 
ways to import Excel?
Rcmdr: same ; XLConnect:different

You should read the help pages for XLConnect.

http://cran.r-project.org/web/packages/XLConnect/XLConnect.pdf
sorry I did not found anything.



We found also that RCmdr is setting comma separated values to na if there is an 
NA in the column.

Maybe it more useful to discuss this in the devel group?  (set the follow up to 
DEVEL)

No. This is more a sign of your lack of experience with R. There are wiki-pages 
with advice about various ways to do Excel input. (You surely cannot think you 
are the first to experience this. This has been a difficulty for 15 years, and 
more with Excel than with R.)


Once again I have no problems to get the data inside R but I am looking 
for a solution to get an error message instead of setting 0,25 to na and 
only i a few column not in the hole sheet. That's a behaviour what I am 
expecting from MS not from R
But I got definitely wrong inputs with lost data with loadWorkbook. But 
it is not reproducable. doing the same  with a fresh environment,not 
after working 5 hours with R,  the excel sheet is imported without 
error. I am no a newbie in R and i am using it nearly 10 years. Them 
same problem occoured with RCmdr in the university by a phd Student. I 
can not reproduce the problem with the same script and the same file. 
Maybe you can agree that this is strange. Its a kind of never be sure 
to get the correct data and that happened to me the first time with R.


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, reproducible code.


[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
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, reproducible code.


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 read.table it 
is optional parameter and maybe it is also readWorksheet.

Regards
Petr

read table is not able to read xls and xlsx files

I found the reason there are NA inside the column but
  gdata  read.xls  is doing the job fine, but it needs the perl 
interpreter, nor problem but somthing to install addtionally

  also Rcmdr has also no problems with NA in a decimal data column
  readWorksheet does the job also when no NA is in the column and with 
NA readWorksheet is interpreting the NA like any other text.


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, reproducible code.


[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
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, reproducible code.


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

2013-05-17 Thread Knut Krueger
Am 17.05.2013 09:09, schrieb Pascal Oettli:
 Hi,

 Which command? But I would say that the first row is imported as 
 column names.

maybe its a general problem of importing excel files.
First of all I am using only sheeets with headlines ;_) but Students do 
sometimes not. ;-)

So
gdata - read.xls is importing sheets default with header=TRUE (its 
possible to set it false)  if not the fist row is interpreted as 
X+VAlue) means f.e X12.5 thats nearly OK anybody can see that there is a 
value.
readWorksheet the same with header but the name of the Column is Col1 
newbies will not realize that there is a value missing

and R-C commander  has no header Option and the first value will changed 
to F1.

Maybe it would be good to give out a warning in all import functions if 
header is not set explicit to TRUE f.e
Warning: First datarow is used as headlines additionally:  output of 
names(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

 __
 R-help@r-project.org mailto: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, reproducible code.




-- 
 Achtung ---
#
# Rückantwortadresse ist RH-Help Group
#
 Achtung ---


[[alternative HTML version deleted]]

__
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, reproducible code.


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 variable names. The obvious workaround is to add a row of variable 
names to the spreadsheet.

dear John,
indeed I would never use an excel sheet without variable names ... but 
students do and then the statistics are wrong 
As I mentioned in the other answer it would be fine to add a hint that 
the first row is used as variable name ... for the students ;-)


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, reproducible code.


[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 http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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.


__
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, reproducible code.


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 aware of lower or capital letter. The R doesnt matter (because its 
windows) if it is capital or not but the rest is.



R cmd - Argument cmd ignored
after wards you are in the r-console  and if you do not recognize this:
r cmd - unexpected symbol in r cmd

 I tried now three times in the last couple of years to build a 
package. last week I had time to figure out what was wrong. Maybe it 
would be helpful to write this in the manuals f.e PkgUtils (but at least 
in http://win-builder.r-project.org/ ) that Windows user either must use 
capitals (but not  build and check otherwies the error message is also 
not constructive) or they must use rcmd.exe with lower letters for build 
an check . I think this could help others not to waste time.


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, reproducible code.


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-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, reproducible code.


[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
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, reproducible code.


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 utilities. 

Yes indeed it works better than MinGW

You might want to look into the Windows batch files at 
http://batchfiles.googlecode.com . 


At least it would be very helpful for windows user to give the hint to 
the executable rcmd.exe build ... instead of R cmd build ...


I already set up an linux system today to solve the problem 

Thank you
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, reproducible code.


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 probability of membership in each group. In package stats, the 
dmultinom() function can be used to accomplish this. The last example on the 
help page shows the steps.

--
David L Carlson
Associate Professor of Anthropology
Texas AM University
College Station, TX 77843-4352

Than you very much.

This was exactly (incuding the sppss pdf) for what I was looking for.

Maybe its helpful for others here are the IBM PDF files:
ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statistics/20.0/en/client/Manuals/

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, reproducible code.


[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 the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] chi square exact test

2013-03-06 Thread Knut Krueger

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 with googl,e please help me to find the search 
term where I can find

the R function for
chi square exact usable for one column test for a sample size less than 6

You are welcome to use this search:

http://www.giyf.com/chi%20square%20exact


Thanks in advane Knut



A quick google search produces multiple results.  Good luck. :)

~Nicole Ford
Ph.D. Student
Graduate Assistant/ Instructor
Department of Government 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?

Kind Regards 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, reproducible code.


__
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, reproducible code.


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 with googl,e please help me to find the search
 term where I can find
 the R function for
 chi square exact usable for one column test for a sample size less than 6

 You are welcome to use this search:

 http://www.giyf.com/chi%20square%20exact


 Thanks in advane Knut
 See ?fisher.test.
fisher test needs two columns I need  a one column exact test
|x| 

either a two-dimensional contingency table in matrix form, or a factor 
object.

|y| 

a factor object; ignored if |x| is a matrix.



Knut

[[alternative HTML version deleted]]

__
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, reproducible code.


[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, Ltext, fill=Lcolors,  
border=FALSE,ncol=1,xjust=2)



so that the symbols and the color squares have a space between?


Kind regards 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, reproducible code.


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 of the colored squares 
are too bi in x-direction.

But never mind I changed file with a graphical software and will try to 
love it next days

Knut


http://dict.leo.org/ende?lp=endep=ziiQAsearch=graphicaltrestr=0x801

[[alternative HTML version deleted]]

__
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, reproducible code.


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-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, reproducible code.


[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-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, reproducible code.


[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-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, reproducible code.


[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  56   Yn/x2
x3  7  8   9    Yn/x2
xn  ...   ...  ...   .  Yn/xn


Kind regards 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, reproducible code.


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
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, reproducible code.


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 - 
data.frame(x0=c(y1,y2,y3,y4),x1=c(1,2,3,4),x2=c(5,6,7,8),x1=c(9,10,11,12))

where y1..yn are the names of the rows
we need  frame$x1   .. .  frame$xn
and  frame[1,] .. frame[n,]  but the first column is no the rownames.

if it is possible to rotate the whole dataset we could use

frame$y1 ..frame$y2


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, reproducible code.


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 was build rotated.


Its more easy for beginners to use the column notation than the row 
notation from a data.frame.
One solution is to rotate the excel sheet, but than you have multiple 
data. So I was looking for a solution to rotate the data set in R


I think I will explain them the row notation for a data.frame

Thank you 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, reproducible code.


[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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,
that's just what I need

Thank you

__
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, reproducible code.


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 posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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
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, reproducible code.


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

__
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, reproducible code.


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 .

Kind regards 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, reproducible code.


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 starting point is set in rnorm by any kind of f.e 
time date combination.


so matrix(rnorm(x),y,z) is suitable for me.

Kind regards
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, reproducible code.


[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 does not give the result  0.001 for the values above *
*p= ((0.5^(df/2))/gamma(df))*(ch2^((df/2)-1))* (2.718281828459^(-ch2/2))  
or is there any other error?

Regards Knut
***

[[alternative HTML version deleted]]

__
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, reproducible 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 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, reproducible code.


[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
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, reproducible code.


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

__
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, reproducible code.


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, reproducible code.


[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
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, reproducible code.


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 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, reproducible code.


[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 with a loop, but it should be more easy 
but it seems that I am looking to the wrong functions.


Kind regards 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, reproducible code.


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 
change the vector to a string


Thanks for your reply
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, reproducible code.


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
string1=do.call(paste,c(as.list(temp),sep=,)) #converting to a string

but I have no idea where I could find that documentation ;-)

Thanks a lot
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, reproducible code.


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 character string to separate the terms. Not |NA_character_ 
cid:part1.05050004.04080404@krueger-family.de|.
|collapse| 	an optional character string to separate the results. Not 
|NA_character_ cid:part1.05050004.04080404@krueger-family.de|.


and I did not realize that I separated the wrong part ...

Kind regards 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, reproducible code.


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 stand for other studies with differing
variables.

However, in biology it is common practice to remove non significant
factors (and sometimes also variables)from data sets (so called: forward
and backward elimination process), usually when they are permanently non
significant on all the paticular positions in the factor list.

Some authors suggest only to remove data which may have similar meanings,
and therefore may be understod as pseudorepliaions.

Best regards 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, reproducible code.


[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?

glm(data1~data2+data3+data4+data5+data6,family=gaussian)
The result:

Coefficients:
Estimate  Std. Error t value Pr(|t|)
(Intercept)3.3670852  0.8978306   3.750 0.000445 ***
data2  0.0002623  0.0001168   2.245 0.029024 *
data3 -0.9742336  0.5032712  -1.936 0.058337 .
data4  0.0628245  0.1503066   0.418 0.677686
data5 -0.0438871  0.0740210  -0.593 0.555818
data6$-0.0012216  0.0187702  -0.065 0.948357



if I test only or  lm() of course
glm(data1~data2,family=gaussian)

Coefficients:
   Estimate Std. Error t value Pr(|t|)
(Intercept)   2.473e+00  2.787e-01   8.876 2.86e-12 ***
data2 7.289e-05  7.485e-05   0.9740.334



Kind regards 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, reproducible code.


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 provide commented, minimal, self-contained, reproducible code.


[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 is there another construct to get the count of pairs where
row1=3 and row2=2
means the result should be 2
I could do this with loop but I am wondering whether there is any better 
way.


Regards 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, reproducible code.


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) ...


Best wishes,
Uwe

Original question
rkevinbur...@charter.net wrote:
I am running an R script with Tinn-R (2.2.0.1) and I get the error 
message


Error in source(.trPaths[4], echo = TRUE, max.deparse.length = 150) : 
  object .trPaths not found


Any solutions?

System

R 2.8.1
Tinn-R 2.2.02
windows Xp professional Servicepack 3

This combination works on my Pc without problems
And the code is working on the other system with Tinn-R problems
with the R-Editor without problems
so it seems to be a Tinn_R problem

but maybe anybody has a solution for that.

Regards 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, reproducible code.


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 R-installation-directory/etc/Rconfig.site

The minimal line to add is:

.trPaths - paste(paste(Sys.getenv('APPDATA'), '\\Tinn-R\\tmp\\', 
sep=''), c('', 'search.txt', 'objects.txt', 'file.r', 'selection.r', 
'block.r', 'lines.r'), sep='')



Hope it helps


no for me - I do not switched to permanent and i did not have the 
Rconfig.site file edited but it is working

So i do not know *why it is working* ;-)

I hope yes for the others (I will forward it) on the computers where it 
is not working


Thank you 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, reproducible code.


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 problem before. It 
seem that it is a Tinn_R installation problem
. I do not now what I changed to get it working, but the single line (R 
send line) mode is working, the

R send selection and Rsend file mode not.

System Windows XP new installed TinnR File permissions should not a 
problem on windows systems. Maybe any file is set to read only?


The same srcipt which is working at home is not working at the new system.

Regards 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, reproducible code.


[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
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 in PostScript device


Regards 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, reproducible code.


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, vertex.label.font=2)
I do not see any change ..
and I do not found any curved assignment in the plot.igraph function.

Its a very
 long mathematical formula to display those arrows, depending on the radius
of the circles, and there is a ...hidden...error in the formula.



I am a bit lost. What formula are we talking about?
  

http://www.equine-science.de/temp/r-graph.jpg
I tried to get the starting point of the arrows depending on the 
distance arrow-centerline node1/node2 and between the  tangent 
right-angled to the centerline  of both nodes automatically for all nodes.

(I hope you can understand my translated mathematics description...)
That's exactly what the team would like to get.

Regards 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, reproducible code.


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
http://mirrors.softliste.de/cran/bin/windows/contrib/
also in r-devel

and
http://cneurocvs.rmki.kfki.hu/igraph/download/igraph_0.5.2.zip
seems to be down.
Maybe you could send me the file with email?

Regards 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, reproducible code.


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 read the documentation as well, especially if you

don't understand the code.
hmm maybe I do not understand, but there  is no parameter curves inside 
the parameter asignment

   params - i.parse.plot.params(graph, list(...))
   vertex.size - 1/200 * params(vertex, size)
  ..frame - params(plot, frame)
plot() is only called if !add I think this means only the first time
igraph.Arrows is used to draw the arrows and there I do not find any 
assignment for curved.



It is a good idea to read the documentation as well,

See ?igraph.plotting and search for

'curved'.
  


?igraph.plotting redirects me to plot.common.html
and there is no word inside beginning with curv...
I also did a complete text search, (before I asked you again) in all files of 
the R-directory
I found it only in the library diagram and network 


network.arrow(1,1,2,2,curve=0.1,width=0.01,col=red,border=black) # this is 
working fine
or for curved arrowheads.



Regards 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, reproducible code.


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 the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 radius of the circle is representing the numbers of actions of the 
node to all other nodes.
I need an additionally information about the numbers of actions 
*between* the nodes differentiated by the direction from and to the nodes.


Example
Node 1 - 2  1 actions
Node 2 - 125 actions
Node 3 - 1 4 actions
Node 1 - 3   10 actions
Node 2 - 3 5 actions
Node 3 - 2 2 actions

I am looking for any graph which shows the direction and counts of the 
actions with f.e different thickness of the arrows,
It must be  viewable 
http://dict.leo.org/ende?lp=endep=thMx..search=viewable that the 
actions from Node 2 to Node 1 are much more than from Node 1 to 2 and 
also more then from node 3 to three, and so on.


Maximum nodes: about 20

Regards 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, reproducible code.


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 example:

Example
Node 1 - 2 1 actions
Node 2 - 125 actions
Node 3 - 1 4 actions
Node 1 - 325 actions
Node 2 - 3 5 actions
Node 3 - 225 actions

In that case all lines would be thick and the actions Node 1 - 2  ,Node 3 - 1,Node 2 - 3   would be invisible, so I tried the narrow arrows to get above the thick arrows in an other colour, but I found no rule to order them that the are always on the top 
... and the team was not satisfied with this suggestion ;-)


The would prefer two parallel arrows one for each direction. Its a very  
long mathematical formula to display those arrows, depending on the 
radius of the circles, and there is a ...hidden...error in the formula.




So I tried to ask again if there is another solution.

By the way: Do you know such arrow funtion: arrow(starting_point, angle, 
length) ?


Thanks's for your patient
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, reproducible code.


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 between the nodes automatically?



It depends what you mean by 'automatically'. 
  
means: Do I have to calculate by myself that there are 
4 1 0

2 2 1
1 20
1 13
or is there any switch to set  the different V(g)$size and E(g)$width
to get the following result:

iigraph_data -c(1,0, 1,0, 1,0, 1,0, 2,1, 2,0, 2,1, 1,3)
g - graph( igraph_data,n=max(igraph_data), directed=TRUE )
V(g)$size - c(40,20,10,10)
E(g)$width - c(4,4,4,4,2,1,1,1)
E(g)$arrow.size - 1
plot.igraph(g, layout=layout.kamada.kawai, vertex.label.font=2)


With kind regards 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, reproducible code.


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 possible to change the thickness of the lines depending of the 
interactions between the nodes automatically?



With kind regards 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, reproducible code.


[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

__
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, reproducible code.


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 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, reproducible code.


[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 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, reproducible code.


  1   2   >