Re: [R] Grid lines

2009-07-30 Thread Thomas Roth (geb. Kaliwe)
Maybe this helps par(mar = c(5,4,6,1)) plot(1:10, type = n, axes = F) xticks = axis(1, at = c(1,5,9), labels = c(1-1-2009,1-5-2009,1-9-2009)) #set axis manually yticks = axis(2, at = 1:10) #set axis manually abline(v = xticks, col = gray) #verticall lines abline(h = yticks, col = gray,

Re: [R] Grid lines

2009-07-30 Thread Thomas Roth (geb. Kaliwe)
Maybe this helps par(mar = c(5,4,6,1)) plot(1:10, type = n, axes = F) xticks = axis(1, at = c(1,5,9), labels = c(1-1-2009,1-5-2009,1-9-2009)) #set axis manually yticks = axis(2, at = 1:10) #set axis manually abline(v = xticks, col = gray) #verticall lines abline(h = yticks, col = gray,

[R] how to evaluate character vector within pnorm()

2009-07-17 Thread Thomas Roth (geb. Kaliwe)
Hi, I'm trying to evaluate a character vector within pnorm. I have a vector with values and names x = c(2,3) names(x) = c(mean, sd) so that i tried the following temp = paste(names(x), x, sep = =) #gives # temp #[1] mean=2 sd=3 #Problem is that both values 2 and 3 are taken as values for

Re: [R] SOLVED: how to evaluate character vector within pnorm()

2009-07-17 Thread Thomas Roth (geb. Kaliwe)
-help-boun...@r-project.org] On Behalf Of Thomas Roth (geb. Kaliwe) Sent: Friday, 17 July 2009 6:03 PM To: 'r-help@r-project.org' Subject: [R] how to evaluate character vector within pnorm() Hi, I'm trying to evaluate a character vector within pnorm. I have a vector with values and names x = c

[R] how to check if ... is empty

2009-07-16 Thread Thomas Roth (geb. Kaliwe)
Hi, I was wondering what would be the best way to check if the three dots argument contains any arguments (i.e. does ... contain any arguments or not? ) #Example test = function(x,y, ...) { #Wanted R-Code # if(empty(...)) #do some calculation plot(x,y,...) } Thanks

Re: [R] SOLVED: how to check if ... is empty

2009-07-16 Thread Thomas Roth (geb. Kaliwe)
Thank you both. Thomas Dimitris Rizopoulos schrieb: one way is: test - function(x, y, ...) { dots - list(...) if (length(dots)) cat(\nnon-empty\n) else cat(\nempty\n) } test(1, 1) test(1, 1, 1) I hope it helps. Best, Dimitris Thomas Roth (geb. Kaliwe) wrote: Hi, I

Re: [R] paste ( x )

2009-07-14 Thread Thomas Roth (geb. Kaliwe)
maybe this helps x = \test\ plot(1:10, main = x) #heading contains #or cat(\test\) Thomas Roth Paulo E. Cardoso schrieb: maybe a very basic question but I need to parse an SQL code into a GIS from a ODBC conn. The code includes a specific sentence OPTIONS COORDSYS(Latitude /

Re: [R] more than one mathematical annotation into a legend

2009-07-10 Thread Thomas Roth (geb. Kaliwe)
in the legend there's x but not the value of x which actually should be shown... #does not work x = 2 plot(1:10) legend(4,4, expression(t[m] == x, t[n] == x)) #legend contains x but not the value of x So this won't work Zhiliang Ma schrieb: On Thu, Jul 9, 2009 at 9:39 AM, Thomas Roth

[R] more than one mathematical annotation into a legend

2009-07-09 Thread Thomas Roth (geb. Kaliwe)
Dear members, Is there a way to put more than one mathematical annotation into a legend together with a calculated value? x = 2 plot(1:10) #Works legend(8, 8, substitute(t[m] == x)) #does not work legend(4,4, c(substitute(t[m] == x), substitute(t[n] == x))) Thanks Thomas Roth

[R] lattice wireframe within a loop ???

2009-06-24 Thread Thomas Roth (geb. Kaliwe)
Hi, I have the following problem. Calling wireframe within a loop results into an empty window(s) #generate some data temp = expand.grid(A = 1:3,B = 1:3) temp = cbind(temp, y1 = rnorm(9)) temp = cbind(temp, y2 = runif(9)) #plot y1 and y2 in two different windows for(i in 1:2) { wireframe(y1

Re: [R] lattice wireframe within a loop ??? - solved

2009-06-24 Thread Thomas Roth (geb. Kaliwe)
. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Thomas Roth (geb. Kaliwe) Verzonden: woensdag 24 juni 2009 13:08 Aan: 'r-help@r-project.org' Onderwerp: [R] lattice wireframe within a loop ??? Hi, I have the following

[R] S4 Package with definition of method 'names'

2009-06-11 Thread Thomas Roth (geb. Kaliwe)
Dear List, Is it possible to build a package with 'names' method for a S4-Class? The following works if directly pasted into R: (a simple test class with 1 attribute that is returned by invoking 'names') #class definition setClass(test, representation = representation(name = character),

Re: [R] Create Pie chart from .csv file

2009-05-05 Thread Thomas Roth (geb. Kaliwe)
Sorry for mailing to you personally... for types read.csv(file.choose()) freqTable = table(types) pie(freqTable) ##example for some data temp = data.frame(types = 1:10) pie(table(temp)) Thomas Roth PS: use barplot instead of pie DonkeyRhubarb schrieb: Hi all, I am looking to create a pie

Re: [R] Import R-output into Java

2009-03-19 Thread Thomas Roth (geb. Kaliwe)
#I used sink ?sink #Thomas Maxl18 schrieb: Hello, I want to import R-output via Rserve to Java, especially for the function ctree from the package party. Rserve is working properly. Yet, I only get the predictions with the Java code try{ RConnection c = new RConnection();

[R] S4 coerce as.data.frame for lm

2009-03-10 Thread Thomas Roth (geb. Kaliwe)
#Hi, # #For a given class test, an object of class test cannot be used as data in the lm method although as.data.frame was implemented... where's my mistake? # #Suppose i have defined a S4 class test #S4 Class test containting a slot data #which is of type data.frame setClass(Class = test,

[R] lattice: remove box around a wireframe

2009-03-04 Thread Thomas Roth (geb. Kaliwe)
#Hi, # #somebody knows how to remove the outer box around a wireframe and reduce the height # # test = data.frame(expand.grid(c(1:10), c(1:10))) z = test[,1] + test[,2] test = cbind(test, z) names(test) = c(x, y, z) require(lattice) wireframe(z ~ x*y, data = test, par.box = c(col =

Re: [R] lattice: remove box around a wireframe

2009-03-04 Thread Thomas Roth (geb. Kaliwe)
= list(col = transparent)), par.box = c(col = transparent) ) --sundar On Wed, Mar 4, 2009 at 8:17 AM, Thomas Roth (geb. Kaliwe) hamstersqu...@web.de wrote: #Hi, # #somebody knows how to remove the outer box around a wireframe and reduce the height # # test = data.frame(expand.grid(c(1:10), c(1

Re: [R] Help on BarPlot

2009-02-10 Thread Thomas Roth (geb. Kaliwe)
Hi, #There are a lot of examples for barplot if you just type example(barplot) # i altered one slightly to put the values on top of each bar mp - barplot(VADeaths) # default #tot - colMeans(VADeaths) #changed this line tot = colSums(VADeaths)#wether you need max, min, mean , colSums

Re: [R] plot Ticks

2009-01-27 Thread Thomas Roth (geb. Kaliwe)
you could set them manually, if thats what you're looking for plot(1:10, axes = F) axis(1, at = seq(1,10 , length = 3)) mau...@alice.it schrieb: Is there a way to force the number of ticks along an axis ? I read the on-line documentation and tried many combinations of all available parameters

Re: [R] Tinn-R

2009-01-26 Thread Thomas Roth (geb. Kaliwe)
First thing you need to do is, save the file with an .r ending. Tinn-R will then come up with syntax highlighting (as far as i remember). Options-Main-Application leads you to the r-configuration... HTH Thomas Tibert, Brock schrieb: Tibert, Brock schrieb: Hi Everyone, I was hoping