[R] how to automatically maximize the graph window (under XP) ?

2008-07-01 Thread Ptit_Bleu
Hello, I'm trying to produce graphs automatically from data stored in database. Before saving the graphs, I would like to maximize the size of the graphs. The best would be to directly open maximized windows with x11() but up to now I failed doing it. I tried different widths and heighs but I ne

[R] how to automatically maximize the graph window (under XP) ?

2008-07-03 Thread Ptit_Bleu
Hello, Thanks Leandro for your solution. But, in fact, it doesn't match what I'm trying to do ... due to the fact that I didn't clearly tell you what I'm trying to do. I tested the command jpeg() but it doesn't display the curve and I need to see it before saving it. Here is a small example of

Re: [R] Start preferred RGui

2008-07-11 Thread Ptit_Bleu
Hello Marcia, I had a similar problem when I updated Tinn-R. Under XP, in the file Document and Settings\... \Application Data\Tinn-R\ini\Tinn.ini, I replaced sPathRGui=\bin\Rgui.exe by rguiPreferred=C:\R\bin\Rgui.exe (to adjust to your path) It worked for me. I hope it will work for you. Have

Re: [R] Start preferred RGui

2008-07-11 Thread Ptit_Bleu
You are right Keith : it doesn't work. Sorry. In fact it works for a previous version but not for the new ones. Bad luck. Nice week-end anyway, Ptit Bleu. -- View this message in context: http://www.nabble.com/Start-preferred-RGui-tp18400190p18404597.html Sent from the R help mailing list archiv

[R] Newbie's question about lm

2008-07-17 Thread Ptit_Bleu
Hello, I would like to fit data with the following formula : y=V*(1+alpha*(x-25)) where y and x are my data, V is a constant and alpha is the slope I'm looking for. How to translate this into R-language ? At the moment, I only know : lm(y ~ x) Sorry for such a basic question. I thought I could

[R] Best way to select good points in a noisy signal ?

2008-08-01 Thread Ptit_Bleu
Hello, When I plot y=f(x) from the file xy.txt ( http://www.nabble.com/file/p18773387/xy.txt xy.txt ), I can clearly see a trend. Is there a function or a package able to take the median value of y for an interval of x (x +/- a defined value) to plot nice graph (at least a better one) ? Thanks

[R] Question about panel.points

2008-09-17 Thread Ptit_Bleu
Hello, I'm trying to plot graphs using lattice with this script : xyplot(Y ~ X | factmod, panel = function(x, y) { panel.grid(h=-1, v=-1, col="gray") panel.xyplot(x, y, type="p", pch=20) panel.points(50,Idata, data=devdata, col="red") -> this

[R] How to improve a function converting year, day of year, decimal hour into date ?

2007-11-20 Thread Ptit_Bleu
Hi, I would like to "build" a date from a year, a day of the year and a decimal hour. Ex : reconst_date(2007,324,12.50) gives "2007-11-20 12:30:0" The following function is doing this job but I would like to know if there is a function which directly converts the decimal hours into hours:minutes

Re: [R] How to improve a function converting year, day of year, decimal hour into date ?

2007-11-20 Thread Ptit_Bleu
Thank you Gabor for your fast answer (received as I was reading R News 4/1) Ptit Bleu. library(chron) chron(paste("1/1/", year, sep = "")) + julday + hour/24 That produces a chron, i.e. dates/times class datetime. If you want it as a string use format(...above expression...)See the help de

[R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-20 Thread Ptit_Bleu
Thanks to your help, I managed to link R and a Mysql Database, send queries, plot the results and put everything in a pdf document (with Sweave). My co-workers find the job not bad but they would like to have a friendly interface to send queries and see the graphs (the pdf document is not necessa

Re: [R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-23 Thread Ptit_Bleu
Dear Gabor, Thanks for the links. I found a a tcl script (see below ; from http://wiki.tcl.tk/15977) which could be a good starting point but I'm not able to translate it into R. Could you help me ? In particularly, what is the command corresponding to append_float_dialog_item ? I looked in ?tclt

Re: [R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-23 Thread Ptit_Bleu
I found the file tkttest.r in the directory tcltk/demo. >From this I hope I will be able to do what I want to. Again thank you for your help, Ptit Bleu. -- View this message in context: http://www.nabble.com/Friendly-way-to--link-R---MySQL-and-non-%28R-and-Mysql%29-users---tf4844081.html#a13911

Re: [R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-23 Thread Ptit_Bleu
Hi Peter, In fact, just the beginning of the script is interesting to me. I'm just looking for a simple example : a single box with 3 entries and 3 labels before. Something like the example below but with a label before each entry. I know it is obvious but I don't manage to combine all the examp

Re: [R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-23 Thread Ptit_Bleu
It's me again (the last message for today - promised). The following script can be very helpful to me (from http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/editboxes.html) but I' like to enter several parameters and have a single 'ok' box to validate all the entered paramaters. Anyone can h

[R] Sweave : change value in rnw file to generate multiple "single" reports ?

2007-12-10 Thread Ptit_Bleu
Hello, I'm still trying to make the life of my colleagues easier. Nice, isn't it ? At the moment, I'm looking for a way to generate multiple "single report". In fact I have a .rnw file which send a query to a MySQL database (rs<-dbSendQuery(con, statement="select * from treatdata where name='Devi

Re: [R] Sweave : change value in rnw file to generate multiple "single" reports ?

2007-12-11 Thread Ptit_Bleu
Thanks everybody for your help (and sorry to be silent : no network today morning), I think I will first try the solution of Greg Snow-2 or the one of Thierry (because they gave examples of script - as a newbye it is very important to me). I'm also interested in the solutions proposed by Uwe and

Re: [R] Sweave : change value in rnw file to generate multiple "single" reports ?

2007-12-11 Thread Ptit_Bleu
Dear Uwe, Could you please give me the name of the function to open, to modify and to save a r script ? Just the name and I will look for the way to use them. And if you have a link explaining how to use user customized variables from an environment variable, it will be very helpful (as it is co

Re: [R] Sweave : change value in rnw file to generate multiple "single" reports ?

2007-12-11 Thread Ptit_Bleu
Greg wrote : Hope this helps, Sure it will ! Thanks again, Have a nice day, Ptit Bleu. -- View this message in context: http://www.nabble.com/Sweave-%3A-change-value-in-rnw-file-to-generate-multiple-%22single%22-reports---tp14256204p14290306.html Sent from the R help mailing list archive at N

[R] Must be obvious but not to me : problem with regular expression

2007-12-17 Thread Ptit_Bleu
Hi, I have a vector called nfichiers of 138 names of file whose extension is .P0 or P1 ... to P8. The script is not the same when the extension is P0 or P(1 to 8). Examples of file names : [128] "Output0.P0" [129] "Output0.P1" [130] "Output0.P2" [131] "Output01102007.P0" [13

[R] TAF/METAR decoder

2008-01-24 Thread Ptit_Bleu
Hi, I'm looking for a script to translate TAF/METAR code into comprehensive text that I can include in a R-script (METAR is the international standard code format for hourly surface weather observations). I haven't seen anything in the libraries. Do you think such a thing exists for R ? Thanks

[R] xyplot sorted by date

2008-12-10 Thread Ptit_Bleu
Hello I have a dataframe with 3 columns C1, C2 and C3. C1 and C2 are numerical data and C3 is the date of the data (format : %Y-%m-%d %H:%M:%S") With the lattice package, I would like to plot C1 as function of C2 sorted by the dates, that is something like : xyplot(C1 ~ C2 | as.Date(C3)) It plo

[R] Problem between panel.abline and log scales (lattice)

2009-01-12 Thread Ptit_Bleu
Hello and Happy New Year to all R-Users !!! I would like to plot a lattice graph with a logarthmic y axis and add two reference lines that is : ref<-c(0.0070, 0.0096) graph1<-xyplot(data$y1 ~ as.numeric(strptime(data$x1, format="%Y-%m-%d %H:%M:%S")) | as.character(data$Code), list(y = list(log

[R] how to plot image() without painting a map (the background)

2008-02-18 Thread Ptit_Bleu
Hello, I'm trying to plot dayly evolution of the temperature over France from Global Forecast System files ("I'm trying" is the right expression...). akilonlat03 is the temperature for different latitudes and longitudes à 3 o'clock. akilonlat06 is the temperature for different latitudes and long

Re: [R] how to plot image() without painting a map (the background)

2008-02-20 Thread Ptit_Bleu
Hello, In fact I would like to make something like a "movie" : to keep the map as background and to display successively the temperatures pictures. At the moment I create the picture of the temperature with R from latitude, longitude, temperature data. I read that it can be done with image() so

Re: [R] how to plot image() without painting a map (the background)

2008-03-04 Thread Ptit_Bleu
Hi, Thanks to ggplot2 (and to Hadley Wickham) I managed to plot some nice graphs (not as fast as in a movie but it is ok). One thing I am still looking for is a way to add the values on the contour lines (like with the contour function). I read the stat.contour help page but I haven't found my

Re: [R] how to plot image() without painting a map (the background)

2008-03-04 Thread Ptit_Bleu
Thanks for the fast answer (even negative) and for your help (ggplot is a very nice tool !!!). Have a nice evening (well, we are close to in France), Ptit Bleu. hadley wrote: > > On Tue, Mar 4, 2008 at 9:15 AM, Ptit_Bleu <[EMAIL PROTECTED]> wrote: >> >> Hi, >>

[R] ggplots - how to increase the number of levels

2008-03-31 Thread Ptit_Bleu
Hi, Thanks to Hadley Wickham, I am now able to plot some nice "weather" graphs (see http://www.nabble.com/how-to-plot-image%28%29-without-painting-a-map-%28the-background%29-td15546906.html#a15584405 How to plot a graph on a map ). For some parameters, I would like to increase the number of leve

[R] [solved] sapply and median, possible or not ?

2008-11-07 Thread Ptit_Bleu
Thanks a lot Keith : your function does the job (but I don't understand the trick) ! Have a nice week-end (Thanks to you, I can have a good one :-)), Ptit Bleu. - median.data.frame <- function(x, ...) sapply(x, median, ...) I haven't tried it, but it might work hth Keith

Re: [R] sapply and median, possible or not ?

2008-11-07 Thread Ptit_Bleu
Unfortunately, I have the same error message. lapply(rowsplit, function(x)mean(x[,sapply(x, is.numeric)])) works but not with median. Strange, isn't it? Any other idea? Thanks in advance, Ptit Bleu. Henrique Dallazuanna wrote: > > Try this: > > lapply(l, function(x)median(x[,sapply(x, is.num

[R] sapply and median, possible or not ?

2008-11-07 Thread Ptit_Bleu
Hello, I have a list of data.frame rowsplit : List of 15 $ (0,0.025] :'data.frame': 169 obs. of 7 variables: $ (0.025,0.05]:'data.frame': 174 obs. of 7 variables: $ (0.05,0.075]:'data.frame': 92 obs. of 7 variables: $ (0.075,0.1] :'data.frame': 76 obs. of 7 variables: $ (0.1,0.

[R] [solved] Re: I can't do it again on an other PC : R+RMySQL ->error loading dll

2007-09-11 Thread Ptit_Bleu
Hi, just to say that I "solved" my problem. I wrote "solved" because all I did was to uninstall R and the DBI and RMySQL libraries and then install everything again. The only change is that I used another RMySQL.zip file found at this address : http://www.bioconductor.org/packages/2.0/extra/bin/w

Re: [R] [solved] Re: I can't do it again on an other PC : R+RMySQL ->error loading dll

2007-09-11 Thread Ptit_Bleu
Hi Peter, I really have no idea about your comment. I was so happy to be able to connect to my database ... In fact I found the address in the following post : https://stat.ethz.ch/pipermail/r-help/2007-August/138142.html Do you think I can't use it freely ? :( Thanks for your comments, Ptit

Re: [R] [solved] Re: I can't do it again on an other PC : R+RMySQL ->error loading dll

2007-09-12 Thread Ptit_Bleu
working. > > Switching to RODBC was almost without pain, since function names were > quite similar. > I simply replaced dbGetQuery with sqlGetQuery in my script and voilia. > > However, you need to install the MySQL ODBC driver and set up a data > source in the Windows Control

Re: [R] [solved] Re: I can't do it again on an other PC : R+RMySQL ->error loading dll

2007-09-12 Thread Ptit_Bleu
ured to allow connections. > > RODBC also contains the file with the comprehensive instructions > (R_HOME/Library/RODBC/Readme). > > > Ptit_Bleu wrote: >> >> Hi Vladimir, >> >> In fact, at the beginning, I tried to install RODBC and the MySQL driver >&

[R] Must be easy, but haven't found the function (numerical integration)

2007-09-17 Thread Ptit_Bleu
Hi, I have a data frame of 2 columns with the following types : data$day char data$value num And I plot my data with : plot(strptime(donnees$day,format="%Y-%m-%d %H:%M:%S"),donnees$value, type="l") And I'd just like to get the numerical value of the integration of this graph. I looked at ?integ

Re: [R] RE : Must be easy, but haven't found the function (numerical integration)

2007-09-18 Thread Ptit_Bleu
ntegral > > or: > > library(caTools) > ?trapz > > David Gouache > Arvalis - Institut du Végétal > Station de La Minière > 78280 Guyancourt > Tel: 01.30.12.96.22 / Port: 06.86.08.94.32 > > > -Message d'origine- > De : Ptit_Bleu [mailto:[EMAIL

Re: [R] RE : Must be easy, but haven't found the function (numerical integration)

2007-09-20 Thread Ptit_Bleu
> ---- > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On > Behalf Of Ptit_Bleu > Sent: Tuesday, September 18, 2007 11:24 AM > To: r-help@r-project.org > Subject: Re: [R] RE : Must be easy, but

[R] It works but I don't know how (nice scientific notation with Lattice)

2007-09-20 Thread Ptit_Bleu
Hi, I had problems to display my results in a nice way (according to me). Thanks to posts of people of this forum, I solved my problems (ticks with a scientific notation and how to write nicely "V/m2" in the label of the x-axis) but ... I don't understand the script. Can somebody explain me how

Re: [R] Creating nice looking lists: how?

2007-09-28 Thread Ptit_Bleu
Hi, I don't know if it will help you but to retrieve the slope of lm(y~x), I use : coefficients(lm(y~x))[2] ([1] for the intercept) I should not tell this but It took me a long time to find this obvious thing. Have a nice week-end, Ptit Bleu. ---

[R] How to avoid saving the row index of a data.frame into MySQL ?

2007-10-11 Thread Ptit_Bleu
Hello everybody, I have data in a data.frame "data" whose structure is given below. I would like to save them into a MySQL database. It works quite well with dbWriteTable but with this function, it also save the number of the rows (see what I get from MySQL below the data.frame structure. Is the

[R] How to find the zero (only the real solution) with the package polynom ?

2007-11-06 Thread Ptit_Bleu
Hello, I have 3 columns : a, b and a*b I would like to find the pair (a,b) so that a*b is the minimum but not from the points I measured but from the fit of the curve (I have more points that the ones given below but I fit only on this part because I know that the minimum a*b is in this interval

Re: [R] How to find the zero (only the real solution) with the package polynom ?

2007-11-06 Thread Ptit_Bleu
but I think it must be quite easy (am I right ?). I don't delete my post as it maybe be helpful to someone else but if the Administrator wants to delete it, it is ok to me. See you, Ptit Bleu. --- Ptit_Bleu wrote: > > Hello, > > I have 3 columns : a, b and

Re: [R] Can I replace NA by 0 (if yes, how) ?

2007-11-07 Thread Ptit_Bleu
I found this solution but it must another one much more "R-friendly" ? for (a in 1:9) { if (is.na(pfit$coefficients[[a]])) (pfit$coefficients[[a]]<-0) } Again thank you in advance for explainations concerning NA, Ptit Bleu. -- View this message in context: http://www.nabble.com/Can-I-replace-N

[R] Can I replace NA by 0 (if yes, how) ?

2007-11-07 Thread Ptit_Bleu
Hello, I'm trying to fit some points with a 8-degrees polynom (result of lm is stored in pfit). In most of the case, it is ok but for some others, some coefficients are "NA". I don't really understand the meaning of these "NA". And the problem is that I can't perform a derivation (pderiv<-as.fun

[R] Can I replace NA by 0 (if yes, how) ?

2007-11-07 Thread Ptit_Bleu
Hello, I'm trying to fit some points with a 8-degrees polynom (result of lm is stored in pfit). In most of the case, it is ok but for some others, some coefficients are "NA". I don't really understand the meaning of these "NA". And the problem is that I can't perform a derivation (pderiv<-as.fun

[R] [Solved] Can I replace NA by 0 (if yes, how) ?

2007-11-08 Thread Ptit_Bleu
> this e-mail is strictly prohibited. > > > -----Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Ptit_Bleu > Sent: Wednesday, November 07, 2007 11:28 AM > To: r-help@r-project.org > Subject: Re: [R] Can I replace NA by 0 (if ye

[R] nice way to find or not a value (problem with numeric(0))

2009-03-04 Thread Ptit_Bleu
Hello, I have a data.frame called spec containing data about samples. But I don't have these data for all my samples. So if I have data (that is code of the sample is in spec$Code), I would like to assign data1 to the variable m. If I don't have this data, I would like to assign 1 to m. I tried

Re: [R] Odp: nice way to find or not a value (problem with numeric(0))

2009-03-05 Thread Ptit_Bleu
Hello Petr, In fact spec is data.frame with a column called code (containing numerical values) and some other columns called data1, data2, ... containing data for each equipment (that is for each code). But I don't have the data for all my devices. It means that some 'code' are not in spec$Code.

[R] How to combine xtable and minipage with Sweave ?

2009-03-13 Thread Ptit_Bleu
Hello, I'm trying to put a dynamic table and a dynamic graph side by side in a pdf document using Sweave. The data.frame used to generate the table is called rg (rg.txt): "Date"; "Code"; "Data1"; "Data2" "2009-03-10";"1";1958;147 "2009-03-10";"2";302;144 "2009-03-10";"3";4;141 "2009-03-10";"4";4

Re: [R] How to combine xtable and minipage with Sweave ?

2009-03-13 Thread Ptit_Bleu
Hello Dieter, And thank you for the corrections. Concerning the point 3, I'm a bit lost. Is it a problem of place to put the table and the graph side by side (my english is quite as low as my skills in Latex) ? I tried with \begin{minipage}{0.45\textwidth} instead of 0.7 and I put "//tiny" but no

Re: [R] How to combine xtable and minipage with Sweave ?

2009-03-13 Thread Ptit_Bleu
Thanks Dieter for the link. In fact it may be a problem with R. The .tex created with R for the table put \begin{table}[ht] and \end{table}\ between \begin{minipage} and \end{minipage} (see below) If I manually change these positions, according to your link, there is no more error ... but the ta

Re: [R] How to combine xtable and minipage with Sweave ?

2009-03-16 Thread Ptit_Bleu
Dear Duncan, Thanks for the tips, but I haven't found a way to modify your solution so that I can include a table and not a graph (includegraphics works for graphs, I need an 'includetable', I think). I found scripts like yours explaining how to include graphs into table but this is not my case:

Re: [R] How to combine xtable and minipage with Sweave ?

2009-03-16 Thread Ptit_Bleu
Dear Duncan, Thanks for the tips, but I haven't found a way to modify your solution so that I can include a table and not a graph (includegraphics works for graphs, I need an 'includetable', I think). I found scripts like yours explaining how to include graphs into table but this is not my case:

[R] [solved] How to combine xtable and minipage with Sweave ?

2009-03-16 Thread Ptit_Bleu
Thanks to you all (and a bit to some websites dedicated to latex), I finally managed to have a table and a graph side-by-side !!! I'm not sure it will interested people, but here is the script working for me (before the graph was below the table only because I have an empty line between the 2 mi

[R] Re sults sometimes in seconds with difftime unit=mins

2009-03-27 Thread Ptit_Bleu
Hello, I'm trying to calculate an integration and x-axis is a time (format : %Y-%m-%d %H:%M:%S"). I use diff(date, units="mins") in a loop for but sometimes the results stay in seconds (95% is ok). Examples for 2 sets of data are given below (first result stays in seconds whereas the second in m

[R] find a sequence of characters in a vector

2009-06-05 Thread Ptit_Bleu
Hello, I'm just looking for an easy way to find the positions of a complete sequence in a bigger vector. For example : c("a","z","e") in c("a","z","e","r","t","a","z","a","z","e","c") and the result should be 1 8 that is the positions of the beginning of the complete sequence. I tried with %in%,

[R] looking for a function to plot the distribution of values (not sure of the name)

2009-08-06 Thread Ptit_Bleu
Hello, I have a dataframe of two columns : A (with values A1, A2, ..., Ai, ... A2) and B (with values B1, B2, ..., Bi, ... B2) and I would like to plot a graph like this : X=A Y= (the density of B as a function of A) * (the value of B as a function of A) I think it must already exis