Re: [R] zoo plot: yearly marks on X-Axis

2009-09-12 Thread lanczos
On Sun, 2009-07-26 at 13:17 +0200, Poersching wrote:
> stvienna wiener schrieb:
> > Hi all,
> >
> > I am plotting a financial time series, but I need a more detailed X-Axis.
> >
> > Example:
> > x <- zoo(rnorm(1:6000), as.Date("1992-11-11")+c(1:6000))
> > plot(x)
> >
> > The X-Axis is labeled "1995", "2000" and "2005".
> > I would need either "1995", "1997", etc. or maybe yearly
> >
> >
> > I used google first, then look at "?plot.zoo" but could't get it working.
> >
> >
> > Regards,
> > Steve
> >
> > __
> > 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.
> >
> >
> Hey,
>
> try something like the following:
>
> plot(x, y, xaxt="n")
> axis.Date(1, at=seq(as.Date("1960-01-01"), max(as.Date(x)), "years"),
> labels = FALSE, tcl = -0.2)
> axis.Date(1, at=seq(as.Date("1960-01-01"), max(as.Date(x)), "5 years"),
> labels = TRUE, las=3, tcl = -0.2)
>
> Regards,
> Christian

Hello,

I'm actually struggling with the similar problem. I applied Your script
into mine like this:
-
library(Rdbi)
library(RdbiPgSQL)
conn <- dbConnect(PgSQL(), host="localhost", dbname="BVS",
user="postgres", password = "**")

query_duj_kal <- dbSendQuery(conn, "select zdroj as well, cas as date,
fe2, fe3, mn, nh4, no2, no3, o2, teplota as temperature from analystats
where zdroj like 'Dunaj Kalinkovo' order by date")
watchem_duj_kal <- dbGetResult(query_duj_kal)

date <- (watchem_duj_kal$date)
date_p <- strptime(date, "%m-%d-%Y")
no3 <- (watchem_duj_kal$no3)
nh4 <- (watchem_duj_kal$nh4)

par(mfrow=c(3,1), ylog = TRUE, yaxp = c(0.01, 100, 3))
maxy <- 100
miny <- 0.005
plot(date_p, no3,log = "y", type = "l", ylim  = c(miny, maxy), col =
"darkred", main = "Dunaj Kalinkovo", xlab = "time", ylab = "log(NO3-,NH4
+)", xaxt="n")
axis.Date(1, at=seq(as.Date("1972-01-01"),max(as.Date(date_p))),
"years"), labels = FALSE, tcl = -0.2)
axis.Date(1, at=seq(as.Date("1970-01-01"),max(as.Date(date_p))),
"5 years"), labels = TRUE, las=3, tcl = -0.2)
-

Everything goes well, except that I cannot get no tickles nor labels at
the moment and I cannot find what I did wrong.

Many thanks for any advice

Tomas

__
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] zoo plot: yearly marks on X-Axis

2009-09-13 Thread lanczos
Many thanks,

the solution is simple and elegant, as usual ;). R is a great tool, the
best I know, unfortunately I need more time to practice ...

regards

Tomas

On Sat, 2009-09-12 at 22:52 -0400, Gabor Grothendieck wrote:
> Try this:
>
> library(zoo)
> x <- zoo(rnorm(1:6000), as.Date("1992-11-11")+c(1:6000))
> plot(x, xaxt = "n")
> # cut time into years, remove duplicate years and convert back to Date
yy <- as.Date(unique(cut(time(x), "year")))
> axis(1, yy, format(yy, "%y"))
>
> There are a number of examples of custom X axes in the
> examples section of ?plot.zoo
>
> On Sat, Sep 12, 2009 at 10:33 PM,   wrote:
> > On Sun, 2009-07-26 at 13:17 +0200, Poersching wrote:
> >> stvienna wiener schrieb:
> >> > Hi all,
> >> >
> >> > I am plotting a financial time series, but I need a more detailed
X-Axis.
> >> >
> >> > Example:
> >> > x <- zoo(rnorm(1:6000), as.Date("1992-11-11")+c(1:6000))
> >> > plot(x)
> >> >
> >> > The X-Axis is labeled "1995", "2000" and "2005".
> >> > I would need either "1995", "1997", etc. or maybe yearly
> >> >
> >> >
> >> > I used google first, then look at "?plot.zoo" but could't get it
working.
> >> >
> >> >
> >> > Regards,
> >> > Steve
> >> >
> >> > __
> >> > 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.
> >> >
> >> >
> >> Hey,
> >>
> >> try something like the following:
> >>
> >> plot(x, y, xaxt="n")
> >> axis.Date(1, at=seq(as.Date("1960-01-01"), max(as.Date(x)), "years"),
labels = FALSE, tcl = -0.2)
> >> axis.Date(1, at=seq(as.Date("1960-01-01"), max(as.Date(x)), "5
years"),
> >> labels = TRUE, las=3, tcl = -0.2)
> >>
> >> Regards,
> >> Christian
> >
> > Hello,
> >
> > I'm actually struggling with the similar problem. I applied Your
script
> > into mine like this:
> > -
> > library(Rdbi)
> > library(RdbiPgSQL)
> > conn <- dbConnect(PgSQL(), host="localhost", dbname="BVS",
> > user="postgres", password = "**")
> >
> > query_duj_kal <- dbSendQuery(conn, "select zdroj as well, cas as date,
fe2, fe3, mn, nh4, no2, no3, o2, teplota as temperature from
analystats
> > where zdroj like 'Dunaj Kalinkovo' order by date")
> > watchem_duj_kal <- dbGetResult(query_duj_kal)
> >
> > date <- (watchem_duj_kal$date)
> > date_p <- strptime(date, "%m-%d-%Y")
> > no3 <- (watchem_duj_kal$no3)
> > nh4 <- (watchem_duj_kal$nh4)
> >
> > par(mfrow=c(3,1), ylog = TRUE, yaxp = c(0.01, 100, 3))
> > maxy <- 100
> > miny <- 0.005
> > plot(date_p, no3,log = "y", type = "l", ylim  = c(miny, maxy), col =
"darkred", main = "Dunaj Kalinkovo", xlab = "time", ylab =
"log(NO3-,NH4
> > +)", xaxt="n")
> > axis.Date(1, at=seq(as.Date("1972-01-01"),max(as.Date(date_p))),
"years"), labels = FALSE, tcl = -0.2)
> > axis.Date(1, at=seq(as.Date("1970-01-01"),max(as.Date(date_p))), "5
years"), labels = TRUE, las=3, tcl = -0.2)
> > -
> >
> > Everything goes well, except that I cannot get no tickles nor labels
at
> > the moment and I cannot find what I did wrong.
> >
> > Many thanks for any advice
> >
> > Tomas
> >
> > __
> > 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.


[R] yaxp problem for more irregular time series in one plot

2009-07-25 Thread lanczos
Good day,

I'm trying to get more time series in one plot. As there are bigger
differences in values of variables I need logaritmic y axis.

The code I use is the following:

nvz_3_data <- read.csv('/home/tomas/R_outputs/nvz_3.csv')
date <- (nvz_3_data$date)
NO3 <- (nvz_3_data$NO3)
NH4 <- (nvz_3_data$NH4)
date_p <- as.POSIXct(date, "CET")
par(mfrow=c(2,1), ylog = TRUE, yaxp = c(0.01, 100, 3))
plot(date_p, NO3, log = "y", type = "l", col = "darkred", main = "NVZ-1",
xlab = "time", ylab = "NO3-" )
lines(date_p, NH4, col = "darkblue", lty = "dotted")
plot(date_p, NH4, log = "y", type = "l", col = "darkblue", main = "NVZ-1",
xlab = "time", ylab = "NH4+" )

So, as I anderstood, extreme (max and min) values on the y axis are
conntrolled byt the yaxp, but it is ignored on the plot, and the NH4
values are out of the plot (see the attached picture). Do somebody know
what I am doing wrong?

Many thanks in advance

Tomas

<>__
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] basic statistics to csv

2009-10-26 Thread lanczos
I know that my question is like a very newbie question, but at the moment
I stacked with it and I need a quick solution. I need to make an overall
statistical overview of various datasets, the summary() and numSummary()
functions are fully sufficient. My question is, how can I export results
to a spreadsheet-like file, as a .csv. For the summary() with an "x"
dataset I can use this way:

su <- summary(x)
write.csv(su, file = "summary.csv")

The problem with this is that the csv file is rather chaotic.

but when I apply the same for the numSummary(x) output like:

nsu <- numSummary(x[,c("a", "b", "c")], statistics=c("mean", "sd",
"quantiles"), quantiles=c(0,.25,.5,.75,1))


write.csv(nsu, file = "numsummary.csv")

I get the  "ERROR: cannot coerce class "numSummary" into a data.frame"
message.

Is there a more convenient way to get a spreadsheet-like output for the
basic statistics?

Many thanks for any help

Tomas

__
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] problems with RPostgreSQL compilation

2012-11-22 Thread lanczos
Hello,

I am trying to install RPostgreSQL, but without success at the moment, getting 
an errormessage - see below. 
My OS is Fedora 17, R version 2.15.2, PostgreSQL 9.2.1 with Postgis 2.0.1 
spatial extension. 

Thank You for any help, advice or hint in advance.

Regards

Tomas


> install.packages("RPostgreSQL", dependencies=TRUE)
trying URL 'http://cran.fyxm.net/src/contrib/RPostgreSQL_0.3-3.tar.gz'
Content type 'application/x-gzip' length 474570 bytes (463 Kb)
opened URL
==
downloaded 463 Kb

* installing *source* package ‘RPostgreSQL’ ...
** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for pg_config... /usr/bin/pg_config
checking for "/usr/include/libpq-fe.h"... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
-I/usr/local/include-fpic  -g -O2  -c RS-DBI.c -o RS-DBI.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
-I/usr/local/include-fpic  -g -O2  -c RS-PQescape.c -o RS-PQescape.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
-I/usr/local/include-fpic  -g -O2  -c RS-PostgreSQL.c -o RS-PostgreSQL.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
-I/usr/local/include-fpic  -g -O2  -c RS-pgsql-copy.c -o RS-pgsql-copy.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
-I/usr/local/include-fpic  -g -O2  -c RS-pgsql-getResult.c -o 
RS-pgsql-getResult.o
gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
-I/usr/local/include-fpic  -g -O2  -c RS-pgsql-pqexec.c -o RS-pgsql-pqexec.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o RPostgreSQL.so RS-DBI.o 
RS-PQescape.o RS-PostgreSQL.o RS-pgsql-copy.o RS-pgsql-getResult.o 
RS-pgsql-pqexec.o -L/usr/lib -lpq
/usr/bin/ld: cannot find -lpq
collect2: error: ld returned 1 exit status
make: *** [RPostgreSQL.so] Error 1
ERROR: compilation failed for package ‘RPostgreSQL’
* removing ‘/usr/local/lib64/R/library/RPostgreSQL’

The downloaded source packages are in
‘/tmp/Rtmpv5LkJj/downloaded_packages’
Updating HTML index of packages in '.Library'
Making packages.html  ... done
Warning message:
In install.packages("RPostgreSQL", dependencies = TRUE) :
  installation of package ‘RPostgreSQL’ had non-zero exit status

--
__
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] Save data as .pdf or .JPG

2010-09-04 Thread lanczos
On Sat, 2010-09-04 at 13:57 -0500, Paul Johnson wrote:
On Wed, Sep 1, 2010 at 7:56 AM, khush  
wrote:
> > Hi all ,
> >
> > I have following script to plot some data.
> >
> > plot( c(1,1100), c(0,15), type='n', xlab='', ylab='', ylim=c(0.1,25) ,
> > las=2)
> > axis (1, at = seq(0,1100,50), las =2)
> > axis (2, at = seq(0,25,1), las =2)
> >>
> > When I source("script.R"), I got the image on interface but I do not
want to
> > use screenshot option to save the image? How can save the output to
.pdf or
> > .jpg format?
> >
> > Thank you
> > Khushwant
>
> Hi!  This is one of the things that is difficult for newcomers. I've
> written down a pretty thorough answer:
>
> http://pj.freefaculty.org/R/Rtips.html#5.2
>
>
> pj
>
Very nice text, indeed. As my 2 cents I strongly recommend to use for
graphs the .png format, .jpg is primarily designed for photographs.

Have a nice time

Tomas

__
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] saving plot both as jpg and pdf

2008-07-22 Thread Tomas Lanczos
Just an advice: I recommend use the png device instead of jpeg for 
plotting purposes, it gives better results for graphs. Jpeg is better 
for photos. Off course IMHO :-)


I wish a nice day

Tomas

stephen sefick wrote:
you have to go in sequence- you are opening a pdf device then a jpeg 
device

and ploting to the jpeg device.  My suggestion would be to do
pdf()
plot(yourplot)
dev.off()

jpeg
plot(yourplot)
dev.off()

this should work

On Tue, Jul 22, 2008 at 9:50 AM, Monica Pisica <[EMAIL PROTECTED]>
wrote:

 

Hi,

I want to save a plot automatically as a pdf and jpg, and if I open 
the pdf
device first and jpeg second only the jpeg file saves correctly �. If 
I do

reverse, only the pdf file saves correctly.

pdf('E:/my_graphs/test1.pdf', bg = "white")
jpeg('E:/my_graphs/test1.jpg', quality = 100, bg = "white", res = 200,
width = 7, height = 7, units = "in")
plot(seq(1, 10), seq(1, 10))
dev.off()
dev.off()

In this case the pdf is not saved correctly and cannot be viewed by 
Adobe �
the error is "it has no pages". If the jpeg device is first open �. 
It will
save an empty page. Of course I can open one device at a time have 
the plot

saved and close that device, and open it again and do same thing, but I
think I should be able to have the plot command only once. I am 
working on a

Windows machine, R.2.7.0.

Any suggestions will be very much appreciated.

Thanks,

Monica


_


enger2_072008
__
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.



__
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] Statistics on raster pictures - asking for an advice

2008-08-06 Thread Tomas Lanczos

Hello, I need to do some basic statistics on raster images (tiff or
png). I need only an advice where to start, which package is the most
appropriate. My search attempts were without success, yet.

Many thanks

Tomas

__
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] Trying to run simple survival program in R but does not work

2008-08-07 Thread Tomas Lanczos

Trev101 wrote:

Hey,

I am just starting to learn R now and I typed in this simple survival
program:
  
   library(survival)

   t <- c(10,13,18,19,23,30,36,38,54,56,59,75,93,97,104,107,107,107)
   c <- c(1,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0)
   data <- Surv(t,c)
   km <- survfit(data)   
   summary(km)

   Call: survfit(formula = data)

but everytime I run it I get this error:
  
  Error in eval.with.vis(expr, envir, enclos) : object "Call" not found


Can someone please help me out I really have no idea wat I have done wrong.
I have installed the survival library is there maybe some other library I
need to install
  

Don't capitalise the "Call" command, use "call" instead.
Good luck!

tomas

p.s.: am I right if I suppose that You are using Windows? ;-)

__
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] problem to load the RGrace package

2008-08-08 Thread Tomas Lanczos
When I am loading the RGrace package I am getting the following 
errormessage:


Loading required package: RGtk2
Loading required package: grid
Loading required package: cairoDevice
Error in figure() : could not find function "gladeXMLNew"
Error : .onLoad failed in 'loadNamespace' for 'RGrace'
Error: package/namespace load failed for 'RGrace'

I am running R 2.7.1 on Ubuntu 8.04 Hardy Heron

I found only one reference for this prob here: 
http://www.r-project.org/nosvn/R.check/r-oldrel-macosx-ix86/RGrace-00check.txt


Is it a bug or a system specific problem? Has it any workaround?

regards and thx in advance

tomas

__
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] problem to load the RGrace package

2008-08-08 Thread Tomas Lanczos

Hello,

thank You for Your answer, I have exactly the same package versions. 
Strange ...


tomas


Prof Brian Ripley wrote:
Is your RGtk2 up to date?  That is where gladeXMLNew comes from, and 
it is in my copy (2.12.5-3).  Specifically I get



sessionInfo()

R version 2.7.1 (2008-06-20)
x86_64-unknown-linux-gnu
...
other attached packages:
[1] RGrace_0.6-6cairoDevice_2.8 RGtk2_2.12.5-3


On Fri, 8 Aug 2008, Tomas Lanczos wrote:

When I am loading the RGrace package I am getting the following 
errormessage:


Loading required package: RGtk2
Loading required package: grid
Loading required package: cairoDevice
Error in figure() : could not find function "gladeXMLNew"
Error : .onLoad failed in 'loadNamespace' for 'RGrace'
Error: package/namespace load failed for 'RGrace'

I am running R 2.7.1 on Ubuntu 8.04 Hardy Heron

I found only one reference for this prob here: 
http://www.r-project.org/nosvn/R.check/r-oldrel-macosx-ix86/RGrace-00check.txt 



Is it a bug or a system specific problem? Has it any workaround?

regards and thx in advance

tomas

__
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] problem to load the RGrace package

2008-08-12 Thread Tomas Lanczos

Hello everybody,

it looks that there is probably a problem with the libglade. I installed
the rattle package and after start I got the following errormessage:


library(rattle)

Rattle, Graphical interface for data mining using R, Version 2.3.65.
Copyright (C) 2008 Togaware Pty Ltd
Type "rattle()" to shake, rattle, and roll your data.

rattle()

Error in rattle() :
 The RGtk2 package did not find libglade installed. Please install it.

In the case of the RGrace it did not find the gladeXMLNew funktion which
also is a part the libglade. Now the question (maybe a stupid one) is,
where exactly the problem is, whether is it a libglade2 library or the
libglade belonging to the RGtk2 is not correctly installed... Does have
somebody an idea what should I do?

tomas

Tomas Lanczos wrote:

Hello,

thank You for Your answer, I have exactly the same package versions. 
Strange ...


tomas


Prof Brian Ripley wrote:
Is your RGtk2 up to date?  That is where gladeXMLNew comes from, and 
it is in my copy (2.12.5-3).  Specifically I get



sessionInfo()

R version 2.7.1 (2008-06-20)
x86_64-unknown-linux-gnu
...
other attached packages:
[1] RGrace_0.6-6cairoDevice_2.8 RGtk2_2.12.5-3


On Fri, 8 Aug 2008, Tomas Lanczos wrote:

When I am loading the RGrace package I am getting the following 
errormessage:


Loading required package: RGtk2
Loading required package: grid
Loading required package: cairoDevice
Error in figure() : could not find function "gladeXMLNew"
Error : .onLoad failed in 'loadNamespace' for 'RGrace'
Error: package/namespace load failed for 'RGrace'

I am running R 2.7.1 on Ubuntu 8.04 Hardy Heron

I found only one reference for this prob here: 
http://www.r-project.org/nosvn/R.check/r-oldrel-macosx-ix86/RGrace-00check.txt 



Is it a bug or a system specific problem? Has it any workaround?

regards and thx in advance

tomas

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



__
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] problem to load the RGrace package

2008-08-15 Thread Tomas Lanczos
If anybody is interested (maybe not :-)):  finally I found a workaround: 
reinstalling R (in my case building R-devel from source) and then run 
update.packages(). But what exactly was the problem remain mystery (for me).


Have a nice day folks

tomas


Tomas Lanczos wrote:

Hello everybody,

it looks that there is probably a problem with the libglade. I installed
the rattle package and after start I got the following errormessage:


library(rattle)

Rattle, Graphical interface for data mining using R, Version 2.3.65.
Copyright (C) 2008 Togaware Pty Ltd
Type "rattle()" to shake, rattle, and roll your data.

rattle()

Error in rattle() :
 The RGtk2 package did not find libglade installed. Please install it.

In the case of the RGrace it did not find the gladeXMLNew funktion which
also is a part the libglade. Now the question (maybe a stupid one) is,
where exactly the problem is, whether is it a libglade2 library or the
libglade belonging to the RGtk2 is not correctly installed... Does have
somebody an idea what should I do?

tomas

Tomas Lanczos wrote:

Hello,

thank You for Your answer, I have exactly the same package versions. 
Strange ...


tomas


Prof Brian Ripley wrote:
Is your RGtk2 up to date?  That is where gladeXMLNew comes from, and 
it is in my copy (2.12.5-3).  Specifically I get



sessionInfo()

R version 2.7.1 (2008-06-20)
x86_64-unknown-linux-gnu
...
other attached packages:
[1] RGrace_0.6-6cairoDevice_2.8 RGtk2_2.12.5-3


On Fri, 8 Aug 2008, Tomas Lanczos wrote:

When I am loading the RGrace package I am getting the following 
errormessage:


Loading required package: RGtk2
Loading required package: grid
Loading required package: cairoDevice
Error in figure() : could not find function "gladeXMLNew"
Error : .onLoad failed in 'loadNamespace' for 'RGrace'
Error: package/namespace load failed for 'RGrace'

I am running R 2.7.1 on Ubuntu 8.04 Hardy Heron

I found only one reference for this prob here: 
http://www.r-project.org/nosvn/R.check/r-oldrel-macosx-ix86/RGrace-00check.txt 



Is it a bug or a system specific problem? Has it any workaround?

regards and thx in advance

tomas

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



__
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] How to learn R language?

2008-08-28 Thread Tomas Lanczos

Bert Gunter wrote:
 


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Robert Baer
Sent: Wednesday, August 27, 2008 3:42 PM
To: r-help@r-project.org
Subject: Re: [R] How to learn R language?

but I doubt you'll ever be done 
learning because the project is so comprehensive ;-)



-- which is a good thing for us old geezers who need to keep our neurons
firing as much as possible...

Cheers,
Bert
  

How true!!!
:-)

Tomas

__
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] format (?) problems with data imported from postgres

2009-09-11 Thread Tomas Lanczos
Good day,

I read some data from a PostgreSQL database by a following script:

library(Rdbi)
library(RdbiPgSQL)
# conn becomes an object which contains the DB connection:
conn <- dbConnect(PgSQL(), host="localhost", dbname="BVS",
user="postgres", password = "***")

query_duj_kal <- dbSendQuery(conn, "select zdroj as well, cas as date,
fe2, fe3, mn, nh4, no2, no3, o2, teplota as temperature from analystats
where zdroj like 'Dunaj Kalinkovo'")
watchem_duj_kal <- dbGetResult(query_duj_kal)

My intention with the data is to create a time series by a following
script:

date <- (watchem_duj_kal$date)
NO3 <- (watchem_duj_kal$no3)
NH4 <- (watchem_duj_kal$nh4)
maxy<-max(NO3,NH4)   
miny<-min(NO3[NO3>0],NH4[NH4>0]) 
date_p <- as.POSIXct(date, "CET")
par(mfrow=c(2,1), ylog = TRUE, yaxp = c(0.01, 100, 3))
plot(date_p, NO3,log = "y", type = "l", col = "darkred",
 main = "NVZ-1", xlab = "time", ylab = "NO3-" )
lines(date_p, NH4, col = "darkblue", lty = "dotted")
plot(date_p, NH4, log = "y", type = "l", col = "darkblue", main =
"NVZ-1",
xlab = "time", ylab = "NH4+" )

The first problems comes with the definition maxy and miny (following a
previous advice od Christian Poersching through this mailing list) what
worked pretty well with data imported from a csv file by a read.table()
function, but in this case I got NA output 

The next problem comes with the unambiguous format od the "date" field,
which is in the database defined as -MM-DD, but in the resulting
"watchem_duj_kal" dataset is strangely converted to DD-MM-, what is
unambiguous for the as.POSIXct() function expecting -MM-DD. A
function converting the format of the date should help, but I could not
find untill now. 

I appreciate every advice/suggestion/help.

Best regards

Tomas

__
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] format (?) problems with data imported from postgres

2009-09-11 Thread Tomas Lanczos
Being more specific:

On Fri, 2009-09-11 at 17:03 +0200, Tomas Lanczos wrote:
> Good day,
> 
> I read some data from a PostgreSQL database by a following script:
> 
> library(Rdbi)
> library(RdbiPgSQL)
> # conn becomes an object which contains the DB connection:
> conn <- dbConnect(PgSQL(), host="localhost", dbname="BVS",
> user="postgres", password = "***")
> 
> query_duj_kal <- dbSendQuery(conn, "select zdroj as well, cas as date,
> fe2, fe3, mn, nh4, no2, no3, o2, teplota as temperature from analystats
> where zdroj like 'Dunaj Kalinkovo'")
> watchem_duj_kal <- dbGetResult(query_duj_kal)
> 
> My intention with the data is to create a time series by a following
> script:
> 
> date <- (watchem_duj_kal$date)
> NO3 <- (watchem_duj_kal$no3)
> NH4 <- (watchem_duj_kal$nh4)
> maxy<-max(NO3,NH4)   
> miny<-min(NO3[NO3>0],NH4[NH4>0]) 
> date_p <- as.POSIXct(date, "CET")
> par(mfrow=c(2,1), ylog = TRUE, yaxp = c(0.01, 100, 3))
> plot(date_p, NO3,log = "y", type = "l", col = "darkred",
>  main = "NVZ-1", xlab = "time", ylab = "NO3-" )
> lines(date_p, NH4, col = "darkblue", lty = "dotted")
> plot(date_p, NH4, log = "y", type = "l", col = "darkblue", main =
> "NVZ-1",
> xlab = "time", ylab = "NH4+" )
> 
> The first problems comes with the definition maxy and miny (following a
> previous advice od Christian Poersching through this mailing list) what
> worked pretty well with data imported from a csv file by a read.table()
> function, but in this case I got NA output 
> 
> The next problem comes with the unambiguous format od the "date" field,
> which is in the database defined as -MM-DD, but in the resulting
> "watchem_duj_kal" dataset is strangely converted to DD-MM-, what is
> unambiguous for the as.POSIXct() function expecting -MM-DD. A
> function converting the format of the date should help, but I could not
> find untill now. 

the resulting "date" field is imported into the dataset as character:

> date
  [1] "03-04-1991" "07-04-1972" "10-03-1997" "02-12-1991" "04-11-1997"
  [6] "11-03-1996" "04-11-1975" "08-31-1992" "04-03-1991" "10-10-1994"
 [11] "05-10-1992" "03-28-1972" "11-30-1992" "03-20-1981" "08-26-1991"
 [16] "03-08-1992" "02-10-1991" "09-05-1995" "02-12-1975" "03-12-1990"
 [21] "06-04-1992" "01-14-1991" "09-12-1971" "06-11-1991" "02-06-1975"
 [26] "02-09-1981" "11-21-1980" "02-09-1991" "08-09-1997" "02-10-1990"
 [31] "09-09-1996" "11-19-1996" "06-08-1990" "08-11-1995" "01-25-1994"
 [36] "02-06-1992" "11-22-1994" "07-17-1995" "12-09-1994" "09-05-1994"
 [41] "03-09-1990" "04-22-1975" "03-13-1995" "11-08-1997" "01-07-1991"
 [46] "07-14-1997" "11-09-1995" "01-17-1995" "09-10-1974" "08-19-1995"
 [51] "02-14-1995" "05-27-1973" "06-21-1994" "07-15-1996" "09-23-1975"
 [56] "02-12-1997" "06-05-1991" "04-03-1992" "04-02-1975" "05-11-1990"
 [61] "12-21-1980" "05-10-1973" "08-29-1980" "03-06-1991" "03-02-1992"
 [66] "04-05-1992" "10-18-1995" "06-02-1991" "11-08-1975" "10-21-1996"
 [71] "09-17-1973" "06-01-1992" "06-07-1992" "12-04-1994" "12-08-1996"
 [76] "07-20-1981" "07-23-1973" "10-20-1980" "08-15-1994" "05-06-1995"
 [81] "06-17-1996" "02-06-1997" "06-10-1997" "03-31-1972" "04-14-1997"
 [86] "02-23-1981" "06-23-1975" "02-17-1994" "10-04-1995" "05-12-1995"
 [91] "05-15-1981" "10-16-1981" "09-04-1996" "03-12-1996" "10-02-1997"
 [96] "11-24-1981" "01-16-1996" "05-21-1996" "07-18-1994" "03-22-1994"
[101] "05-13-1997"


> I appreciate every advice/suggestion/help.
> 
> Best regards
> 
> Tomas
> 
> __
> 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.


[R] different time series in one plot

2009-10-09 Thread Tomas Lanczos
Hello,

I need to put 2 or more different time series to one plot for comparison
each other. The problem is that the time series are irregular, moreover
the time lenghts and periods are not the same. Is there a way to manage
it in R?

Many thanks for any hint and advice in advance

Tomas

__
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] Most used R editors

2009-06-02 Thread Tomas Lanczos
On Tue, 2009-06-02 at 07:06 +, Martial Sankar wrote:
> Hi,
> 
> I am a little lonely as R users in my group. So, I would like to know which 
> editor is the most used in the R community.
> This post is some kind of survey.
> 
> Personally, I use  Emacs with ESS, It permits to :
> 
> - open more than one R session 
> - split the emacs editor as many part as you want.
> - use a lot of keybindings.
> ...
> 
> I also tried Rkwards, Scilab (windows), JGR etc... but they are not suitable 
> for what I do.
> 
> Best,

I am quite satisfied with the R Commander (Ubuntu 8.10, 9.04), I made
most of R jobs related to my PhD work with it. Optionally I used also
the Gedit standard text editor in Gnome.

Regards

Tomas


> - Martial

__
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] Most used R editors

2009-06-02 Thread Tomas Lanczos
On Tue, 2009-06-02 at 07:06 +, Martial Sankar wrote:
> Hi,
> 
> I am a little lonely as R users in my group. So, I would like to know which 
> editor is the most used in the R community.
> This post is some kind of survey.
> 
> Personally, I use  Emacs with ESS, It permits to :
> 
> - open more than one R session 
> - split the emacs editor as many part as you want.
> - use a lot of keybindings.
> ...
> 
> I also tried Rkwards, Scilab (windows), JGR etc... but they are not suitable 
> for what I do.
> 
> Best,

I am quite satisfied with the R Commander (Ubuntu 8.10, 9.04), I made
most of R jobs related to my PhD work with it. Optionally I used also
the Gedit standard text editor in Gnome.

Regards

Tomas


> - Martial

__
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] RPostgreSQL, RS-DBI error

2014-07-03 Thread Tomas Lanczos
Hello all,



I have a problem with the connection to a Postgresql database in R.
At first, some system information:
Fedora 2.0, 
R 3.1.0 compiled from source, 
Postgresql 9.2

I installed the RPostgreSQL package in R with all the dependencies
also. 

When I'm trying to connect to the database using the following commands:

library(DBI)
library(RPostgreSQL)
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv,
dbname="Litava",host="localhost",port=1234,user="postgres",password="")

I'm getting an error message:
ERROR:
RS-DBI driver

with no other error specification. Do have somebody an idea could be
wrong with this?

Thank You in advance for any advice

Tomas




-- 
Tomáš Lánczos, PhD
Dept. Gechemistry 
Commenius University
Mlynská dolina G-235
842 15
Bratislava

__
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] RPostgreSQL, RS-DBI error

2014-07-03 Thread Tomas Lanczos



On Thu, 2014-07-03 at 11:09 -0500, John McKown wrote:
> On Thu, Jul 3, 2014 at 9:49 AM, Tomas Lanczos  wrote:
> >
> > Hello all,
> >
> > I have a problem with the connection to a Postgresql database in R.
> > At first, some system information:
> > Fedora 2.0,
> > R 3.1.0 compiled from source,
> > Postgresql 9.2
> >
> > I installed the RPostgreSQL package in R with all the dependencies
> > also.
> >
> > When I'm trying to connect to the database using the following commands:
> >
> > library(DBI)
> > library(RPostgreSQL)
> > drv <- dbDriver("PostgreSQL")
> > con <- dbConnect(drv,
> > dbname="Litava",host="localhost",port=1234,user="postgres",password="")
> >
> > I'm getting an error message:
> > ERROR:
> > RS-DBI driver
> >
> > with no other error specification. Do have somebody an idea could be
> > wrong with this?
> >
> > Thank You in advance for any advice
> >
> > Tomas
> >
> > --
> > Tomáš Lánczos, PhD
> 
> I also use PostgreSQL on Fedora 20. I don't have any problems. What
> you might want to try is removing the host= and port= arguments from
> your dbConnect
> 
> con <- dbConnect(drv,dbname="Litava",user="postgres",password="");
> 
> I let the host= and port= default. Also, at least in my version, the
> port is not "1234", but is "5432". So that may be the problem.
> 

OMG, I'm so stupid, the port is "5432" also in my version! Thank You
very much, it works now :).

Have a nice day and sorry for bothering :)

Tomas

__
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] problems with RPostgreSQL compilation

2012-11-27 Thread Tomas Lanczos
Thank You for Your answer.I have installed libpqxx 4.0.0 and its devel
tools also.

Regards

Tomas


On Thu, 2012-11-22 at 19:32 +0900, Pascal Oettli wrote:
> Hello,
> 
> Do you have the shared libraries required by PostgreSQL installed on 
> your machine (libpq)?
> 
> Regards,
> Pascal
> 
> Le 22/11/2012 18:45, lanc...@t-zones.sk a écrit :
> > Hello,
> >
> > I am trying to install RPostgreSQL, but without success at the moment, 
> > getting an errormessage - see below.
> > My OS is Fedora 17, R version 2.15.2, PostgreSQL 9.2.1 with Postgis 2.0.1 
> > spatial extension.
> >
> > Thank You for any help, advice or hint in advance.
> >
> > Regards
> >
> > Tomas
> >
> >
> >> install.packages("RPostgreSQL", dependencies=TRUE)
> > trying URL 'http://cran.fyxm.net/src/contrib/RPostgreSQL_0.3-3.tar.gz'
> > Content type 'application/x-gzip' length 474570 bytes (463 Kb)
> > opened URL
> > ==
> > downloaded 463 Kb
> >
> > * installing *source* package ‘RPostgreSQL’ ...
> > ** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked
> > checking for gcc... gcc
> > checking for C compiler default output file name... a.out
> > checking whether the C compiler works... yes
> > checking whether we are cross compiling... no
> > checking for suffix of executables...
> > checking for suffix of object files... o
> > checking whether we are using the GNU C compiler... yes
> > checking whether gcc accepts -g... yes
> > checking for gcc option to accept ISO C89... none needed
> > checking build system type... x86_64-unknown-linux-gnu
> > checking host system type... x86_64-unknown-linux-gnu
> > checking target system type... x86_64-unknown-linux-gnu
> > checking for pg_config... /usr/bin/pg_config
> > checking for "/usr/include/libpq-fe.h"... yes
> > configure: creating ./config.status
> > config.status: creating src/Makevars
> > ** libs
> > gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
> > -I/usr/local/include-fpic  -g -O2  -c RS-DBI.c -o RS-DBI.o
> > gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
> > -I/usr/local/include-fpic  -g -O2  -c RS-PQescape.c -o RS-PQescape.o
> > gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
> > -I/usr/local/include-fpic  -g -O2  -c RS-PostgreSQL.c -o RS-PostgreSQL.o
> > gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
> > -I/usr/local/include-fpic  -g -O2  -c RS-pgsql-copy.c -o RS-pgsql-copy.o
> > gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
> > -I/usr/local/include-fpic  -g -O2  -c RS-pgsql-getResult.c -o 
> > RS-pgsql-getResult.o
> > gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I/usr/include 
> > -I/usr/local/include-fpic  -g -O2  -c RS-pgsql-pqexec.c -o 
> > RS-pgsql-pqexec.o
> > gcc -std=gnu99 -shared -L/usr/local/lib64 -o RPostgreSQL.so RS-DBI.o 
> > RS-PQescape.o RS-PostgreSQL.o RS-pgsql-copy.o RS-pgsql-getResult.o 
> > RS-pgsql-pqexec.o -L/usr/lib -lpq
> > /usr/bin/ld: cannot find -lpq
> > collect2: error: ld returned 1 exit status
> > make: *** [RPostgreSQL.so] Error 1
> > ERROR: compilation failed for package ‘RPostgreSQL’
> > * removing ‘/usr/local/lib64/R/library/RPostgreSQL’
> >
> > The downloaded source packages are in
> > ‘/tmp/Rtmpv5LkJj/downloaded_packages’
> > Updating HTML index of packages in '.Library'
> > Making packages.html  ... done
> > Warning message:
> > In install.packages("RPostgreSQL", dependencies = TRUE) :
> >installation of package ‘RPostgreSQL’ had non-zero exit status
> >
> > --
> >
> >
> >
> > __
> > 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.

__
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] Change legend in the 'hydrogeo' package

2008-07-08 Thread Tomas Lanczos

At first sorry for the possibly dumb question of a newbie.

I am using the hydrogeo package to visualize approx. 300 data within the 
Piper-Hill diagrams. The package is using a dataframe with 6 columns, 
first of them is containing the row.names, next four with the data 
itself. The last column contains "WaterTypes" dividing data to several 
categories. The diagram is created by the piper function, assigning 
different symbols following the row.names (I don't need id, however I 
can assign one symbol for the whole dataset using pch ) and assigmning 
colours following WaterTypes. Untill now it's working very well, what I 
need however is to change the legend, as it is showing all the 300 rows, 
even I assigned only one symbol. For me it is more appropriate to show 
the categories from the "WaterTypes" columns assigned to the colours.


Could somebody give me a hint how to change the code to give me an 
appropriate result? The answer is probably in the help assigned to the 
"legend" of the graphics package, but it's quite unclear to me.


Many thanks in advance

Tomas

The piece of code from the hydrogeo package creating the legend is here:

 ylegend <- X
plotlegend <- function(dd, X, ...) {
xid <- c(X + p)
yid <- c(ylegend - (X/30) * 1:nrow(dd))
text(xid, yid, labels = row.names(dd), vfont = c("serif",
"plain"), cex = 0.7)
if (is.character(dd$pch)) {
text(xid - (X/15), yid, labels = c(1:nrow(dd)), vfont = 
c("serif",

"plain"), cex = 0.7)
}
else {
points(rep(xid - (X/15), length(yid)), yid, pch = dd$pch,
col = dd$col)
}
return(min(yid))
}

__
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] 3D scatter, groups, RdbiPgSQL...

2008-10-03 Thread Tomas Lanczos

hello,

I wish to create some 3d scatter diagrams visualising different grouped 
data set by a given field in the database. I tried the scatterplot3d 
package, as well as the plot3d and scatter3d functions (both within the 
rgl resp. Rcmdr package). My first question is, whether is it possibe to 
group data in the scatterplot3d and plot3d, because I did not succeed to 
use the groups = ... function.


The scatter3d behaves a bit wierdly with the groups function: it works 
well with data imported from a CSV file, but when I tried to apply it to 
a data imported from a PostgreSQL database (using the Rdbi and RdbiPgSQL 
packages) it gives me this error message:


ERROR:
  groups variable must be a factor.

To be more clear here is a command I used with the scatter3d (exactly 
the same for the both datasets):


scatter3d(br_scatter$cl, br_scatter$br, br_scatter$hco3, fit="linear", 
residuals=TRUE, bg="white", axis.scales=TRUE, grid=TRUE, 
ellipsoid=FALSE, xlab="cl", ylab="br", zlab="hco3", groups = 
br_scatter$stratigraphy)


the dataset I used is here (the same is the data imported from the CSV 
file and from a PostgreSQL table) looks like this (a part of it):


stratigraphy   brhco3  cl
1 sarmat 0.2327793352  507.006513  262.781114
2 sarmat 0.3741990388 1021.788317  214.254486
3  baden 0.3354024830 1268.847582  253.639356
4 sarmat 0.0938626352   46.514244   38.995620
5 sarmat 0.1163896676   18.300686   72.984568
6 sarmat 0.2090008010   77.777917  131.989947
7 sarmat 0.2815879055   53.802018  146.804052
8  panon 0.0450540649   81.590560  274.980467
9  baden 0.5619243092   61.752316  275.978980
10karpat 0.4655586704   16.019351  179.537807
11mezozoikum 0.6244993993  133.442504  152.986938
12 panon 0.1539347217  132.679975   65.994974
13sarmat 0.0375450541   19.825743   24.996686
14sarmat 0.0375450541   20.588272   26.280086
15 baden 0.0463055667   19.063215   26.494456
16 baden 0.1864737685   40.414016   93.992841
17sarmat 0.9236083300   90.740903  597.954458
18 panon 0.8022126552   57.189645  499.961921
19 panon 0.4830796956   68.627574  280.001241
20 panon 0.1163896676   73.202745   53.995887

So why the exactly same "stratigraphy" field is a factor in the dataset 
imported from a CSV file and why is not a factor in the dataset imported 
from a PostgreSQL table


Many thanks in advance

Tomas

__
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] 3D scatter, groups, RdbiPgSQL...

2008-10-03 Thread Tomas Lanczos

Thank You for Your answer, Duncan,

Duncan Murdoch wrote:

On 03/10/2008 4:33 AM, Tomas Lanczos wrote:

hello,

I wish to create some 3d scatter diagrams visualising different 
grouped data set by a given field in the database. I tried the 
scatterplot3d package, as well as the plot3d and scatter3d functions 
(both within the rgl resp. Rcmdr package). My first question is, 
whether is it possibe to group data in the scatterplot3d and plot3d, 
because I did not succeed to use the groups = ... function.


There is no groups argument to plot3d, but you can set characteristics 
of each point separately.  So if you can calculate a colour for each 
point yourself, you can do something like


plot3d(br_scatter[,c("cl", "br", "hco3")], col=colour)
I see, but it is something new for me. So, if I understood You well, You 
advice to prepare another column containing colour codes (colour names?) 
for each point?




If you want different sizes for each point, you have to plot each 
group separately; the size= attribute can't be a vector.  You could 
also use text3d to plot character labels, e.g.


plot3d(br_scatter[,c("cl", "br", "hco3")], type="n")
text3d(br_scatter[,c("cl", "br", "hco3")], text=br_scatter$stratigraphy)
In some cases it should be nice, but I have hundreds of points, no space 
left for labels, but I can use it later.


Tomas

Duncan Murdoch



The scatter3d behaves a bit wierdly with the groups function: it 
works well with data imported from a CSV file, but when I tried to 
apply it to a data imported from a PostgreSQL database (using the 
Rdbi and RdbiPgSQL packages) it gives me this error message:


ERROR:
   groups variable must be a factor.

To be more clear here is a command I used with the scatter3d (exactly 
the same for the both datasets):


scatter3d(br_scatter$cl, br_scatter$br, br_scatter$hco3, 
fit="linear", residuals=TRUE, bg="white", axis.scales=TRUE, 
grid=TRUE, ellipsoid=FALSE, xlab="cl", ylab="br", zlab="hco3", groups 
= br_scatter$stratigraphy)


the dataset I used is here (the same is the data imported from the 
CSV file and from a PostgreSQL table) looks like this (a part of it):


 stratigraphy   brhco3  cl
1 sarmat 0.2327793352  507.006513  262.781114
2 sarmat 0.3741990388 1021.788317  214.254486
3  baden 0.3354024830 1268.847582  253.639356
4 sarmat 0.0938626352   46.514244   38.995620
5 sarmat 0.1163896676   18.300686   72.984568
6 sarmat 0.2090008010   77.777917  131.989947
7 sarmat 0.2815879055   53.802018  146.804052
8  panon 0.0450540649   81.590560  274.980467
9  baden 0.5619243092   61.752316  275.978980
10karpat 0.4655586704   16.019351  179.537807
11mezozoikum 0.6244993993  133.442504  152.986938
12 panon 0.1539347217  132.679975   65.994974
13sarmat 0.0375450541   19.825743   24.996686
14sarmat 0.0375450541   20.588272   26.280086
15 baden 0.0463055667   19.063215   26.494456
16 baden 0.1864737685   40.414016   93.992841
17sarmat 0.9236083300   90.740903  597.954458
18 panon 0.8022126552   57.189645  499.961921
19 panon 0.4830796956   68.627574  280.001241
20 panon 0.1163896676   73.202745   53.995887

So why the exactly same "stratigraphy" field is a factor in the 
dataset imported from a CSV file and why is not a factor in the 
dataset imported from a PostgreSQL table


Many thanks in advance

Tomas

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



__
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] plot3d - could not find function "xlim"

2008-10-05 Thread Tomas Lanczos
when I tried to apply xlim, ylim, zlim functions to the 
plot3d/decorate3d, inspite all the help documentation I got this 
errormessage:


ERROR: could not find function "xlim"

Is it a bug or possibly my fault?

regards

tomas

__
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] plot3d - could not find function "xlim"

2008-10-05 Thread Tomas Lanczos
Hello,

thank You for Your reply.  You are absolutely right, I am a bit tired, 
forgot to attach the code. I am very sorry about that, as well as I did 
not recognize that the error message came as a consequence of misstyping 
the code, my fault again (a real guru maybe recognize this as a misstype 
error as the error message is mentioning xlim as a function and not an 
**argument*, *I am apparently far to be a guru ... yet* *;-)).

Have a nice day

tomas

jim holtman wrote:
> Seems to work fine for me:
>
> plot3d(x, y, z, col=rainbow(1000), size=2, xlim=c(-5,5))
>
>
> It would help if you "read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code."
>
> Since you did not post your code, I assume that there is an unknown error in 
> it.
>
> On Sun, Oct 5, 2008 at 1:32 PM, Tomas Lanczos <[EMAIL PROTECTED]> wrote:
>   
>> when I tried to apply xlim, ylim, zlim functions to the plot3d/decorate3d,
>> inspite all the help documentation I got this errormessage:
>>
>> ERROR: could not find function "xlim"
>>
>> Is it a bug or possibly my fault?
>>
>> regards
>>
>> tomas
>>
>> __
>> 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.
>>
>> 
>
>
>
>   


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