Re: [R] ggplot trouble when I combine a layer with group and a layer with group=1

2025-04-15 Thread Laurent Rhelp
For interested people I got an answer on this link, thank you. https://stackoverflow.com/questions/79573847/ggplot-trouble-when-i-combine-a-layer-with-group-and-a-layer-with-group-1?noredirect=1#comment140334381_79573847 Le 12/04/2025 à 17:24, Laurent Rhelp a écrit : Dear RHelp-list,   I

[R] ggplot trouble when I combine a layer with group and a layer with group=1

2025-04-12 Thread Laurent Rhelp
Dear RHelp-list,   I want to combine with ggplot2 a layer where I compare   three regressions and a layer where I just display three   new samples to evaluate their locations to the regressions lines.   (the mock data is placed at the end of the mail) # 1. comparison of the three regressions

Re: [R] slowness when I use a list comprehension

2024-06-16 Thread Laurent Rhelp
20 a 105.4257 145.2059 20 b 166.4094 233.7112 20 c Le 16/06/2024 à 20:54, Gabor Grothendieck a écrit : > This can be vectorized. Try > > ix <- seq_along(vec2) > S_diff2 <- sapply(seq_len(N1-(N2-1)*ratio_sampling), \(j) > sum((vec1[(ix-1)*ratio_sampling+j] - vec2[ix])**2)) > >

Re: [R] slowness when I use a list comprehension

2024-06-16 Thread Laurent Rhelp
e into a set of instructions in more native R. >> Just for comparison, in python, things like comprehensions for list or > dictionaries or tuples often are syntactic sugar and the interpreter may > simply rewrite them more like the first program you typed and evaluates > that. The

[R] slowness when I use a list comprehension

2024-06-16 Thread Laurent Rhelp
Dear RHelp-list,    I try to use the package comprehenr to replace a for loop by a list comprehension.  I wrote the code but I certainly miss something because it is very slower compared to the for loops. May you please explain to me why the list comprehension is slower in my case. Here

Re: [R] dplyr, group_by and selective action according to each group

2024-05-26 Thread Laurent Rhelp
p On Behalf Of Bert Gunter Sent: Friday, May 24, 2024 6:52 PM To: Laurent Rhelp Cc: r-help@r-project.org Subject: Re: [R] dplyr, group_by and selective action according to each group Laurent: As I don't use dplyr, this won't help you, but I hope you and others may find it entertaining

[R] dplyr, group_by and selective action according to each group

2024-05-24 Thread Laurent Rhelp
Dear RHelp-list,    Using dplyr and the group_by approach on a dataframe, I want to be able to apply a specific action according to the group name. The code bellow works, but I am not able to write it in a more esthetic way using dplyr. Can somebody help me to find a better solution ? Thank

Re: [R] wrtiteBin in conjunction with seek : the position in the file is not good when writing

2024-05-21 Thread Laurent Rhelp
urent Le 21/05/2024 à 12:15, Ivan Krylov a écrit : > В Tue, 21 May 2024 11:29:33 +0200 > Laurent Rhelp пишет: > >> pos <- seek(con_in,2,origin="start") >> # We have to repeat the command to return the good amount of read >> # bytes >> print(paste0(&qu

[R] wrtiteBin in conjunction with seek : the position in the file is not good when writing

2024-05-21 Thread Laurent Rhelp
Dear RHelp-list,  I want to write at a specific position in a file without reading all the file because it is very large and I cannot read it in my RAM. But I miss something about the use of the command writeBin in conjunction with seek. In the example bellow the seek commands works well with

Re: [R] cpgram: confidence band with a chirp signal

2024-04-09 Thread Laurent Rhelp
I answer to myself: I have to generate my signal up to f1 = Fs/2 in order to have a flat response over the entire frequency range. Le 09/04/2024 à 19:48, laurentRhelp a écrit : Dear RHelp-list,    I generate a swept sine signal using the signal library. I can see using the spec.pgram command

Re: [R] lattice xyplot: how to change the y-axis labels size using yscale.components.subticks on the right side and how to adapt the ticks number

2023-05-31 Thread Laurent Rhelp
ls on the right as well, you will just need to uncomment the line ans$right <- TRUE in your my_yscale.components.subticks function. -Deepayan On Tue, May 30, 2023 at 12:39 AM Laurent Rhelp wrote: Dear R-Help-list, I want to display many sensors on the same page so I have to

[R] lattice xyplot: how to change the y-axis labels size using yscale.components.subticks on the right side and how to adapt the ticks number

2023-05-29 Thread Laurent Rhelp
Dear R-Help-list,    I want to display many sensors on the same page so I have to adapt the size of the y-axis labels and I woul like to adapt the number of ticks according to the sensor. I use the yscale.components argument with the function yscale.components.subticks: see the code below. I

Re: [R] latticeExtra: how to use doubleYScale when we want to keep the groups of every lattice graph

2023-02-14 Thread Laurent Rhelp
It is great ! I had not thought to use the value 0 for the variables style1 and style2. I did not well understand when reading the documentation. Thank you Laurent Le 13/02/2023 à 19:04, Deepayan Sarkar a écrit : On Mon, Feb 13, 2023 at 3:48 AM Laurent Rhelp wrote: Dear R-Help-list, I

[R] latticeExtra: how to use doubleYScale when we want to keep the groups of every lattice graph

2023-02-12 Thread Laurent Rhelp
Dear R-Help-list,  I want to use the doubleYScale function from latticeExtra to overlap two lattice graphs (cf. code below). The overlapping works but I lose the groups of every lattice, there are only two colors. Reading the documentation, the arguments style1 and style2 give me the impression

Re: [R] lattice xyplot: trouble about the use of yscale.components to start the yscale from zero

2023-01-24 Thread Laurent Rhelp
labels do not appear on the y-axis if I keep ylim = c(0,max(lim)). But nevermind because your solution to use prepanel works very well and I will think next time to use prepanel. Best regards L. Le 22/01/2023 à 18:43, Deepayan Sarkar a écrit : > > > On Sun, Jan 22, 2023 at 6:48 PM Laur

[R] lattice xyplot: trouble about the use of yscale.components to start the yscale from zero

2023-01-22 Thread Laurent Rhelp
Dear RHelp-list,  I want to choice my scale for every panel in a lattice graph according to  the ylim range of every panel, with 10 ticks and with a start from 0. Also I want to plot a grid   according to the y ticks (I did that in the panel argument with the panel.abline function) .  So I

Re: [R] lattice: how to use a log scale on the x-axis with the bwplot function

2022-12-11 Thread Laurent Rhelp
Thank you very much Deepayan, I will see the help of panel.bwplot. Best regards L. Le 11/12/2022 à 18:53, Deepayan Sarkar a écrit : On Sun, Dec 11, 2022 at 11:05 PM Laurent Rhelp wrote: Excellent, it works. But, may you please explain me how xyplot knows that it has to apply panel.bwplot on

Re: [R] lattice: how to use a log scale on the x-axis with the bwplot function

2022-12-11 Thread Laurent Rhelp
. Le 11/12/2022 à 17:48, Deepayan Sarkar a écrit : On Sun, Dec 11, 2022 at 2:33 PM Laurent Rhelp wrote: I understand the idea but I did not succeed. Here is what I tried: ## 1.middles of classes calculation m <- tapply(DF$x, groups, mean) ## 2. create a new factor columns with

Re: [R] lattice: how to use a log scale on the x-axis with the bwplot function

2022-12-11 Thread Laurent Rhelp
om >         , y = list(log=T, tck = c(1,0)) >         , x = list(at = 1:5, tck = 1) >         ) > > If this is not what you meant, you'll need to clarify ... or just move on. > > -- Bert > > On Sun, Dec 11, 2022 at 1:06 AM Laurent Rhelp > wrote: > >

Re: [R] lattice: how to use a log scale on the x-axis with the bwplot function

2022-12-11 Thread Laurent Rhelp
m). The potential problem with that is the box > widths, > which panel.bwplot() will not know how to compute. > > See if the following gives you a reasonable starting point: > > DF <- within(DF, m <- tapply(y, groups, mean)) > xyplot(

Re: [R] lattice: how to use a log scale on the x-axis with the bwplot function

2022-12-11 Thread Laurent Rhelp
in(DF, m <- tapply(y, groups, mean)) xyplot(y ~ m, DF, scales = list(log = TRUE), panel = panel.bwplot, horizontal = FALSE, box.width = .0001) Best, -Deepayan On Sat, Dec 10, 2022 at 7:46 PM Laurent Rhelp wrote: Dear R-Help list, I would like to use bwplot from the lattice

[R] lattice: how to use a log scale on the x-axis with the bwplot function

2022-12-10 Thread Laurent Rhelp
Dear R-Help list,    I would like to use bwplot from the lattice package with a log scale both on the x-axis and the y-axis but I do not know how to do that because I do not know how to change the factor x-axis in a numeric x-axis.  Here is my example: library(lattice) # the mock data y <-

Re: [R] How to create a matrix from a list without a for loop

2021-07-09 Thread Laurent Rhelp
Very effective solution, I hope I remember that for the nex time. Thank you Le 09/07/2021 à 19:50, David Winsemius a écrit : On 7/9/21 10:40 AM, Laurent Rhelp wrote: Dear R-Help-list,   I have a list init_l containing 16 dataframes and I want to create a matrix 4 x 4 from this list with

Re: [R] How to create a matrix from a list without a for loop

2021-07-09 Thread Laurent Rhelp
,"X2","X3","X4"))) > It doesn't give exactly what your code does, but your code introduces > an extra level of "list", which you may not want. > > -Bill > > On Fri, Jul 9, 2021 at 10:40 AM Laurent Rhelp <mailto:laurentrh...@fre

[R] How to create a matrix from a list without a for loop

2021-07-09 Thread Laurent Rhelp
Dear R-Help-list,   I have a list init_l containing 16 dataframes and I want to create a matrix 4 x 4 from this list with a dataframe in every cell of the matrix. I succeeded to do that but my loop is very uggly (cf. below). Could somebody help me to write nice R code to do this loop ? Thank

Re: [R] Some difficulties to use the apply command on an array

2021-07-05 Thread Laurent Rhelp
It is good trick and we have to know that R arrays use the 'column major mode' to store the value. Thank you Laurent Le 05/07/2021 à 19:03, David Winsemius a écrit : On Jul 5, 2021, at 7:56 AM, Laurent Rhelp wrote: Dear R-Help, I have an array x made up of three matrices of 5

Re: [R] Some difficulties to use the apply command on an array

2021-07-05 Thread Laurent Rhelp
[i,,])$d )) HTH, Eric On Mon, Jul 5, 2021 at 5:56 PM Laurent Rhelp wrote: Dear R-Help, I have an array x made up of three matrices of 5 rows and 3 columns of complex numbers (the complex numbers are not the problem) ## my array x <- structure(c(5.6196790161893828+0i, 5.7565523942393364

Re: [R] Some difficulties to use the apply command on an array

2021-07-05 Thread Laurent Rhelp
ope this helps! > > On Mon, Jul 5, 2021 at 10:56 AM Laurent Rhelp <mailto:laurentrh...@free.fr>> wrote: > > Dear R-Help, > > I have an array x made up of three matrices of 5 rows and 3 > columns of > complex numbers (the complex numbers are not the prob

Re: [R] Some difficulties to use the apply command on an array

2021-07-05 Thread Laurent Rhelp
= FALSE) > > seems to work well for me. I hope this helps! > > On Mon, Jul 5, 2021 at 10:56 AM Laurent Rhelp <mailto:laurentrh...@free.fr>> wrote: > > Dear R-Help, > > I have an array x made up of three matrices of 5 rows and 3 > columns of

Re: [R] Some difficulties to use the apply command on an array

2021-07-05 Thread Laurent Rhelp
( svd(x[i,,])$d )) > > HTH, > Eric > > On Mon, Jul 5, 2021 at 5:56 PM Laurent Rhelp <mailto:laurentrh...@free.fr>> wrote: > > Dear R-Help, > > I have an array x made up of three matrices of 5 rows and 3 > columns of > complex numbers (the complex

[R] Some difficulties to use the apply command on an array

2021-07-05 Thread Laurent Rhelp
Dear R-Help, I have an array x made up of three matrices of 5 rows and 3 columns of complex numbers (the complex numbers are not the problem) ## my array x <- structure(c(5.6196790161893828+0i, 5.7565523942393364+0i, 8.5242834298729342+0i,   10.304766710160479+0i, 11.4129670101082

Re: [R] xyplot.zoo trouble with the index when I use microseconds (type POSIXct)

2021-02-22 Thread Laurent Rhelp
.w) <- as.POSIXlt(time(DF.w))$sec # now run plot or xyplot as before On Mon, Feb 22, 2021 at 11:56 AM Gabor Grothendieck wrote: I assume that this is a lattice problem. Replacing xyplot with plot and using all the same arguments there is no error. On Mon, Feb 22, 2021 at 11:26 AM Laurent Rhe

Re: [R] xyplot.zoo trouble with the index when I use microseconds (type POSIXct)

2021-02-22 Thread Laurent Rhelp
o suppress the X axis and then issue an axis command. plot.zoo has examples. On Mon, Feb 22, 2021 at 12:14 PM Laurent Rhelp wrote: You are right, if I replace xyplot by plot there is no error message but the POSIXct format is not taken into account for the labels on the x-axis. Do I have to wri

Re: [R] xyplot.zoo trouble with the index when I use microseconds (type POSIXct)

2021-02-22 Thread Laurent Rhelp
Le 22/02/2021 à 18:01, Deepayan Sarkar a écrit : On Mon, Feb 22, 2021 at 9:56 PM Laurent Rhelp wrote: Dear R-Help-List, I have to process time series with a sampling frequency of 1 MHz. I use the POSIXct format for the date-times with microsecond in a zoo object and the xyplot.zoo

[R] xyplot.zoo trouble with the index when I use microseconds (type POSIXct)

2021-02-22 Thread Laurent Rhelp
Dear R-Help-List,    I have to process time series with a sampling frequency of 1 MHz. I use the POSIXct format for the date-times with microsecond in a zoo object and the xyplot.zoo function to do the graphs. As I show in the below example I had a trouble to plot the labels on the x-axis with

Re: [R] iterators : checkFunc with ireadLines

2020-06-03 Thread Laurent Rhelp
;,"","","","","","",""), flush=TRUE, multi.line=FALSE, skip=nextElem(iter_index1)-1, nlines=1, quiet=TRUE)) [1] "N163" "-0.054023" "-0.049345" "-0.037158" "-0.04112" "-0.044612&quo

Re: [R] iterators : checkFunc with ireadLines

2020-05-27 Thread Laurent Rhelp
| こんにちは | مرحبا | Привет /, :v ).put;' hello_7lang.txt", intern = TRUE, ignore.stderr = FALSE)) [1] """""" "你好 Chinese" [5] "こんにちは Japanese" "مرحبا Arabic""Привет Rus

Re: [R] iterators : checkFunc with ireadLines

2020-05-22 Thread Laurent Rhelp
Laurent Rhelp wrote: # sensors to keep sensors <-  c("N053", "N163") # filter on the beginning of the line i <- pipe("grep -E '^(N053|N163)' test.txt") # or: # filter on the beginning of the given column # (use $2 for the second column, etc.) i <- pi

Re: [R] iterators : checkFunc with ireadLines

2020-05-19 Thread Laurent Rhelp
;,"","","","","","",""), flush=TRUE, multi.line=FALSE, skip=nextElem(iter_index1)-1, nlines=1, quiet=TRUE)) [1] "N163" "-0.054023" "-0.049345" "-0.037158" "-0.04112" "-0.044612&quo

Re: [R] iterators : checkFunc with ireadLines

2020-05-18 Thread Laurent Rhelp
;","","","","",""), flush=TRUE, multi.line=FALSE, skip=nextElem(iter_index1)-1, nlines=1, quiet=TRUE)) [1] "N163" "-0.054023" "-0.049345" "-0.037158" "-0.04112" "-0.044612" &quo

Re: [R] iterators : checkFunc with ireadLines

2020-05-18 Thread Laurent Rhelp
15094 -0.012104 5 N163 -0.054023 -0.049345 -0.037158 -0.041120 -0.044612 -0.036953 -0.036061 -0.044516 -0.046436 Best, Bill. W. Michels, Ph.D. On Sun, May 17, 2020 at 5:43 PM Laurent Rhelp wrote: Dear R-Help List, I would like to use an iterator to read a file filtering some selected lin

Re: [R] iterators : checkFunc with ireadLines

2020-05-18 Thread Laurent Rhelp
15094 -0.012104 5 N163 -0.054023 -0.049345 -0.037158 -0.041120 -0.044612 -0.036953 -0.036061 -0.044516 -0.046436 Best, Bill. W. Michels, Ph.D. On Sun, May 17, 2020 at 5:43 PM Laurent Rhelp wrote: Dear R-Help List, I would like to use an iterator to read a file filtering some selected lin

[R] iterators : checkFunc with ireadLines

2020-05-17 Thread Laurent Rhelp
Dear R-Help List,    I would like to use an iterator to read a file filtering some selected lines according to the line name in order to use after a foreach loop. I wanted to use the checkFunc argument as the following example found on internet to select only prime numbers : |

[R] Package for: Instrumental variables with spatial error and lags for cross-sectional data?

2016-02-15 Thread cpblpublic+rhelp
I have a spatial cross-sectional dataset. I think I have an instrument for my dependent variable, but there's reason to suspect I need a spatial lag with spatial error model. The dataset has about 100,000 observations. I am looking for a package which will estimate my model in R (or Stata or P

[R] rgl WebGL export

2014-12-01 Thread rhelp
Dear List members, I would be glad to get some tips on the following topic. I use rgl package to generate a 3D-cube with labeled dots at certain coordinates. After that I try to export the scene as a WebGL application. For this I use the syntax from rgl documentation "writeWebGL" mentioned in

[R] draw piecharts or histograms at the points of a scatterplot

2014-09-28 Thread rhelp
Hi, I?m fairly new to R and have a problem mentioned in the subject ... I want to draw a scatterplot in 3d - either with scatterplot3d or - preferably - with the rgl package - but instead of points or text (text3d command of rgl) I would like to draw either histograms or pie charts to visualiz

Re: [R] lattice : superpose symbols with a great many points

2014-06-23 Thread Laurent Rhelp
= ... code to each plot, but I didn't try it.) If the legend is irrelevant to you, then this should be fine. HTH, Dennis On Sun, Jun 22, 2014 at 2:09 PM, Laurent Rhelp wrote: Le 20/06/2014 21:50, Christoph Scherber a écrit : Dear Laurent for numeric x variables, you could try jitter: xy

Re: [R] lattice : superpose symbols with a great many points

2014-06-22 Thread Laurent Rhelp
Le 20/06/2014 21:50, Christoph Scherber a écrit : Dear Laurent for numeric x variables, you could try jitter: xyplot(y~jitter(x,0.5)) Cheers Christoph Am 20.06.2014 21:45, schrieb Laurent Rhelp: Hi, I like to use with xyplot (package lattice) the groups argument and superpose.symbol to

[R] lattice : superpose symbols with a great many points

2014-06-20 Thread Laurent Rhelp
Hi, I like to use with xyplot (package lattice) the groups argument and superpose.symbol to compare several curves. But, when there are a great many points, the symbols are very close and the graph becomes unreadable. Would there be an argument or a tip not to draw all the symbols, for exa

[R] trouble with accentuated characters in \title tag in Rd file

2013-01-12 Thread Laurent Rhelp
Hi, I have a weird issue when creating a package with latin1 encoding. All works fine except the fact that I can't put non-ASCII characters in the title tag. There is NA in the place of the title in the pdf file of the documentation. I can put non-ASCII characters in the other tags (desc

Re: [R] Compiling RMySQL on Win7 64bits RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in

2012-04-24 Thread Ben Rhelp
ards, Ben > > From: Uwe Ligges >To: Ben Rhelp >Cc: "r-help@r-project.org" >Sent: Tuesday, 24 April 2012, 19:30 >Subject: Re: [R] Compiling RMySQL on Win7 64bits RS-DBI.c:1:0: sorry, >unimplemented: 64-bit mode not compiled in >

Re: [R] Compiling RMySQL on Win7 64bits RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in

2012-04-24 Thread Ben Rhelp
Save\TempFolder\RtmpS8df20\downloaded_packages’ Warning messages: 1: running command 'D:/BenSave/R/R-2.15.0/bin/i386/R CMD INSTALL -l "D:/BenSave/R/R-2.15.0/library"   C:\Users\BenSave\TempFolder\RtmpS8df20/downloaded_packages/RMySQL_0.9-3.tar.gz' had status 1 2: In install.packages("RMySQL", type = &quo

[R] Compiling RMySQL on Win7 64bits RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in

2012-04-24 Thread Ben Rhelp
Hi, On a Win7 64 bit, I have installed: *R-15.0 and I am running it in 64bits *Rtools215.exe*MySQL 5.5.23 64bits My PATH start with D:\BenSave\Rtools\bin;D:\BenSave\Rtools\MinGW64\bin;D:\BenSave\R\R-2.15.0\bin;D:\BenSave\Rtools\MinGW\bin;D:\BenSave\Rtools\gcc-4.6.3\bin; Note that I place MinGW

Re: [R] Porting "unmaintained" packages to post R 2.10.0 era

2011-06-17 Thread Ben Rhelp
Hi Prof Brian, Thank you for your email and for writing MASS. This book is brilliant. - Original Message > From: Prof Brian Ripley > To: Ben Rhelp > Cc: r-help@r-project.org > Sent: Thu, 16 June, 2011 14:48:00 > Subject: Re: [R] Porting "unmaintained" pack

Re: [R] Porting "unmaintained" packages to post R 2.10.0 era

2011-06-17 Thread Ben Rhelp
- Original Message > From: Uwe Ligges > To: Ben Rhelp > Cc: r-help@r-project.org > Sent: Thu, 16 June, 2011 14:38:12 > Subject: Re: [R] Porting "unmaintained" packages to post R 2.10.0 era > [...] > > > > What about "--binary is deprecate

[R] Porting "unmaintained" packages to post R 2.10.0 era

2011-06-16 Thread Ben Rhelp
Hi all, I am trying to re-compile some "unmaintained" (it seems) packages, namely rSoNIA and dynamicnetwork from: http://csde.washington.edu/~skyebend/rsonia/rsoniaDemo/ These packages predates R 2.10.0 so they need to be recompile. After split the single big file in /man in each packages into

Re: [R] plotting confidence bands from predict.nls

2011-05-08 Thread Laurent Rhelp
Le 07/05/2011 06:17, Penny Bilton a écrit : I am trying to find a confidence band for a fitted non-linear curve. I see that the predict.nls function has an interval argument, but a previous post indicates that this argument has not been implemented. Is this still true? I have tried various way

Re: [R] Compiling Rgraphiz on Windows 7 64bit with R-2.13.0

2011-05-07 Thread Ben Rhelp
Hi Martin, Thanks a lot for your help. this was spot on. With your instructions, I manage to successfully compile Rgraphiz. thanks again. regards, Ben - Original Message > From: Martin Morgan > To: Ben Rhelp > Cc: r-help@r-project.org > Sent: Wed, 4 May, 2011 1:01:

[R] Compiling Rgraphiz on Windows 7 64bit with R-2.13.0

2011-05-03 Thread Ben Rhelp
Hi all, I am trying to compile Rgraphiz on Windows 7 64bit with R-2.13.0. I have installed Rtools213.exe from [1]. The 64bit packages in [2] provided me with the 64 bit version of graphviz. After intalling the binary version Rgraphviz 1.30 (in 32bit) it complains (as expected) that: > libra

[R] Nnet and AIC: selection of a parsimonious parameterisation

2011-01-05 Thread Ben Rhelp
Hi All, I am trying to use a neural network for my work, but I am not sure about my approach to select a parsimonious model. In R with nnet, the IAC has not been defined for a feed-forward neural network with a single hidden layer. Is this because it does not make sens mathematically in this cas

[R] Package install error: undefined symbol: _intel_fast_memcpy

2010-12-07 Thread rhelp . 20 . trevva
Hi, I am trying to install the "ncdf" package on my Ubuntu 8.04 (Karmic) box in the basement. I have installed the most recent distribution of R, 2.12.0 without too many problems. However, when it comes to install the "ncdf" netcdf package, I unfortunately get the following error: Error in dyn.lo

Re: [R] Is there an equivalent to predict(..., type="linear") of a Proportional hazard model for a Cox model instead?

2010-11-26 Thread Ben Rhelp
Hi Terry, David, and Thomas, Thank you for all your emails and the time you to took to clarify my misunderstanding on survival analysis. I will need a bit of time to digest all this information and to do some more reading. Best regards, Ben > From: Terry Therneau > > 1. survreg() does N

Re: [R] Is there an equivalent to predict(..., type="linear") of a Proportional hazard model for a Cox model instead?

2010-11-25 Thread Ben Rhelp
Hi David, Thank you for your reply. See below for more information. > From: David Winsemius > > On Nov 25, 2010, at 7:27 AM, Ben Rhelp wrote: > > > I manage to achieve similar results with a Cox model as follows but I don't > > really understand why we ha

Re: [R] Is there an equivalent to predict(..., type="linear") of a Proportional hazard model for a Cox model instead?

2010-11-25 Thread Ben Rhelp
I manage to achieve similar results with a Cox model as follows but I don't really understand why we have to take the inverse of the linear prediction with the Cox model and why we do not need to divide by the number of days in the year anymore? Am I getting a similar result out of pure luck?

[R] Is there an equivalent to predict(..., type="linear") of a Proportional hazard model for a Cox model instead?

2010-11-24 Thread Ben Rhelp
Hi all, Is there an equivalent to predict(...,type="linear") of a Proportional hazard model for a Cox model instead? For example, the Figure 13.12 in MASS (p384) is produced by: (aids.ps <- survreg(Surv(survtime + 0.9, status) ~ state + T.categ + pspline(age, df=6), data = Aidsp)) zz <- predi

[R] Modelling survival with time-dependent covariates

2010-07-01 Thread Ben Rhelp
Hi all, I am looking at the tutorial/appendix from John Fox on “Cox Proportional-Hazards Regression for Survival Data” available here: http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf I am particularly interested in modelling survival with time-dependent covariates

[R] odfWeave accented chars in a plot iconv

2010-06-21 Thread Laurent Rhelp
Dear R-List, I try to use accented chars in a plot using odfWeave (see the example below). I found the solution using the iconv command to write the accented char "é". But, is somebody know another solution not to have to use iconv command every time ? Thanks Example : <>= par(mfrow=c(1,

Re: [R] RODBC : reading binary data from a TXT field belonging to a PostgeSQL table

2010-03-27 Thread Laurent Rhelp
Le 25/03/2010 20:28, Laurent Rhelp a écrit : Dear R-List, I am working with binary data that I want to store in a PostgreSQL DataBase. I decided to use a TXT field. I read my binary file with readBin function, I succeed in my data storage in the database but I have some trouble to extract

[R] RODBC : reading binary data from a TXT field belonging to a PostgeSQL table

2010-03-25 Thread Laurent Rhelp
Dear R-List, I am working with binary data that I want to store in a PostgreSQL DataBase. I decided to use a TXT field. I read my binary file with readBin function, I succeed in my data storage in the database but I have some trouble to extract the data : the correct amount of bytes is sto

Re: [R] time serie : question about date time class

2010-02-06 Thread Laurent Rhelp
of 0 secs y <- x+.01 # 1 us identical(x,y) [1] FALSE y <- x+.001 # 0.1 us identical(x,y) [1] TRUE On Sat, Feb 6, 2010 at 9:41 AM, Laurent Rhelp wrote: Gabor Grothendieck a écrit : zoo is independent of time and date class so it does not restrict y

Re: [R] time serie : question about date time class

2010-02-06 Thread Laurent Rhelp
, 2010 at 8:25 AM, Laurent Rhelp wrote: Dear R-List, I have the habit of using R for my data processing and I like to use the power of the lattice package. Presently, I have to manage time series. So, in order to work properly I want to discover the zoo package and the related methods (since

[R] time serie : question about date time class

2010-02-06 Thread Laurent Rhelp
Dear R-List, I have the habit of using R for my data processing and I like to use the power of the lattice package. Presently, I have to manage time series. So, in order to work properly I want to discover the zoo package and the related methods (since lattice can work with zoo class). But m

[R] sp package coordinates and gridded problems with as.list()

2010-01-26 Thread Rhelp wanted
Dear All I hope that someone can help. I am working with sp pakage and akima library("akima") library(sp) imagine lots of different dataframes, of row = 100 columns = 3 of x and y coordinates with z values I will call these data frames for the sake of this example akima akima<-as.list(1:100)

Re: [R] parsing pdf files

2010-01-09 Thread Laurent Rhelp
David Kane a écrit : I have a pdf file that I would like to parse into R: http://www.williams.edu/Registrar/geninfo/faculty.pdf For now, I open the file in Acrobat by hand, then save it "as text" and then use readLines(). That works fine but a) I am concerned that some information may be lost

Re: [R] AKIMA: z values at a set coordinate

2009-11-22 Thread Rhelp wanted
the x axis corresponds to row > number and the y axis to column number, with column 1 at the > bottom, i.e. a 90 degree counter-clockwise rotation of the > conventional printed layout of a matrix. > > [2] http://wiki.r-project.org/rwiki/doku.php?id=tips:spatial-data > > Rhelp wanted wrote:

[R] AKIMA: z values at a set coordinate

2009-11-20 Thread Rhelp wanted
Dear all. I am using the akima function to produce 3d contour plots using interp based on irregular data. using the eg in the akima manual library("akima") data(akima) plot(y ~ x, data = akima, main = "akima example data") with(akima, text(x, y, formatC(z,dig=2), adj = -0.1)) ## linear interpola

[R] Unexpected behavior in friedman.test and ks.test

2009-09-08 Thread atconsta-rhelp
I have to start by saying that I am new to R, so I might miss something crucial here. It seems to me that the results of friedman.test and ks.test are "wrong". Now, obviously, the first thing which crossed my mind was "it can't be, this is a package used by so many, someone should have observed"

[R] Optim stripping attributes from relistable objects

2008-08-17 Thread rhelp . 20 . trevva
Dear all, The following code is inspired by the help file for the relist() function (see?relist), which explicitly details how you can use a relistable object in conjunction with optim to pass and reconstruct complex parameter structures/groupings. The idea is that the optim() function can only wo

Re: [R] Parameter names in nls

2008-07-22 Thread rhelp . 20 . trevva
Kiaora Rolf, Thanks for the reply. The syntax that I am using is based on examples from ?optim, where a very similar system is setup with the rosenbrook banana function. Given that nls() is basically a wrapper for optim(), it seems reasonable that the logic should carry across. Furthermore, the fo

[R] Parameter names in nls

2008-07-21 Thread rhelp . 20 . trevva
Dear R-help, Could you please examine the following code, and see if I have discovered a bug or not, or am just doing something silly. I am trying to create a package to do fish stock assessment using the nls() function to fit the modelled stock size to the various pieces of information that w

[R] Plotting a legend outside the figure - units

2008-02-18 Thread rhelp . 20 . trevva
Dear R gurus, I am trying to plot a legend in the margins of a figure. The basic idea is to have two (or more) plots on the same figure, but then to have a common legend at the bottom of the plot. The approach that I have taken is to setup the figures, then do a "dummy" plot of the legend to de