ast.object()', too.
Von: Deepayan Sarkar
Gesendet: Mittwoch, 23. März 2022 12:05
An: Ivan Krylov
Cc: Garbade, Sven via R-help; Garbade, Sven
Betreff: Re: [R] panel.rect and log scale in lattice plot
On Wed, Mar 23, 2022 at 4:08 PM Ivan Krylov wrote:
>
;lightgray", border="lightgray", alpha=.6)
panel.xyplot(x,y,...)
},
scales=list(y=list(log=FALSE))
)
However, when log=TRUE, the rectangle disappears.
Are there any ideas? Thanks, Sven
<https://mail.med.uni-heidelberg.de/questions/tag
Hi Karim,
you should learn ?Map to iterate along the list and supply mutliple list
arguments (there is also parallel:::mcMap for multicore).
The magic of the color code generation you figure out yourself, I guess...
Here 'i' intends to be the value, 'n' the name, e.g.
# returns color by charact
ot;, a)
sb = gsub("[^A-Za-z0-9]", "", b)
a==b
# [1] FALSE
sa==sb
# [1] TRUE
Take care of the extra space in a after the '-', so also replace spaces...
Best,
Sven.
On 20 April 2015 at 16:05, Dimitri Liakhovitski <
dimitri.liakhovit...@gmail.com> wrote:
> I thin
In '?rep' find out about the 'each' argument.
Also there is the function 'gl' which creates a factor and offers a shorter
syntax for your problem.
If n equals 5 use one of:
rep(seq(5), each = 4)
gl(5,4)
On 19 April 2015 at 15:44, John Sorkin wrote:
> Windows 7 64-bit
> R 3.1.3
> RStudio 0.98.1
es=r), n))
}
empty.frame()
empty.frame(, seq(3))
empty.frame(8, c("foo", "bar"))
I could not put it in one line either, without retyping at least one
argument (n in this case).
So I suggest a function is the way to go for a simplified syntax ...
Thanks to all for the ideas!
Sve
On 30 March 2015 at 17:50, Sarah Goslee wrote:
> On Mon, Mar 30, 2015 at 11:43 AM, Sven E. Templer
> wrote:
> >
> >
> > On 30 March 2015 at 17:31, Bert Gunter wrote:
> >>
> >> Sarah's statement is correct.
> >>
> >> So is yours.
y not wisdom."
> Clifford Stoll
>
>
>
>
> On Mon, Mar 30, 2015 at 7:56 AM, Sven E. Templer
> wrote:
> > On 30 March 2015 at 16:47, Sarah Goslee wrote:
> >
> >> colnames(e) <- paste0('pop',1:12)
> >>
> >> isn't a fun
ct (the data.frames) with each rowSums
output.
So, use cbind within your first lapply.
p.s. Is it a standard convention to always copy the reply to the last
> person who responded?
>
I guess it depends on which answer you refer to.
>
> On Mon, Mar 30, 2015 at 10:56 AM, S
On 30 March 2015 at 16:47, Sarah Goslee wrote:
> colnames(e) <- paste0('pop',1:12)
>
> isn't a function and doesn't return anything.
>
But
function(e){colnames(e) <- paste0('pop', 1:2)}
is a function and it returns something (the last evaluated expression! -
here the paste0 return):
> mylist2 <
> Q3: any other recommendations?
You might be interested in the very easy to use R markdown, see:
http://rmarkdown.rstudio.com/
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://st
Hi,
you didn't specify values in A, and you first wanted to compare bi
with Aij, but then also which bi is less/equal to zero.
For the first case, with
A <- matrix(0:3,2)
b <- seq(-1,5)
and a comparison function for bi less/equal to Aij like
f <- function (bi) {as.integer(bi<=A)}
you can iter
Without (example) code it is hard to follow... use ?dput to present
some data (subset).
But if it is data.frames you are dealing with (for sure with read.csv,
but not so sure at all with raster maps), give this a try:
?merge
On 19 February 2015 at 17:44, Simon Tarr wrote:
> Hello everyone,
>
> I
Make use of the plyr and reshape2 package (both on CRAN):
library(plyr)
d<-adply(ArrayDiseaseCor, 1:2)
# adply calls function identity by default
d<-melt(d)
d<-subset(d,value>.5)
head(d)
You will have to rename columns, or adjust arguments in melt/adply.
Note: use set.seed before sampling for rep
see inline
On 12 February 2015 at 09:10, Sven E. Templer wrote:
> Make use of the plyr and reshape2 package (both on CRAN):
>
I forgot:
library(reshape2)
> library(plyr)
> d<-adply(ArrayDiseaseCor, 1:2)
> # adply calls function identity by default
> d<-melt(d)
> d&l
Maybe this is due to the usage of rep() in ifelse():
f.rep <- function(ans){ans <- rep(ans,1);return(ans)}
f <- function(ans){return(ans)}
f(a <- 123) # no print here
f.rep(a <- 123) # prints:
# [1] 123
On 27 January 2015 at 11:54, Bert Gunter wrote:
> Huh??
>
>> ifelse(TRUE, a <- 2L, a <- 3L)
you can also define 'na.rm' in sum() by 'NA state' of x (where x is
your vector holding the data):
sum(x, na.rm=!all(is.na(x)))
On 26 January 2015 at 13:45, Martin Maechler
wrote:
>> Jim Lemon
>> on Mon, 26 Jan 2015 11:21:03 +1100 writes:
>
> > Hi Allen, How about this:
>
>
Another solution:
CaseID <- c("1015285", "1005317", "1012281", "1015285", "1015285", "1007183",
"1008833", "1015315", "1015322", "1015285")
Primary.Viol.Type <- c("AS.Age", "HS.Hours", "HS.Hours", "HS.Hours",
"RK.Records_CL",
"OT.Overtime", "OT.Overtime", "OT.Overtime", "V.Poster_Other",
"V.Poster
# fixed formula part:
f <- dat ~ a0 * exp(-S*(x - 250)) + K
# convert to character
f <- as.character(f)
# component:
C <- "(p0*exp(-0.5*((x-p1)/p2)^2))"
# number of components (defined randomly):
n <- sample(1:3, 1)
C <- rep(C, n)
# collapse:
C <- paste(C, collapse = "+")
# combine
f <- paste(f[2],
seems like a transpose, so use
?t
t(your.data.frame)
On 22 October 2014 11:34, Matthias Weber wrote:
> Hello together,
>
> i have a little problem. Maybe anyone can help me.
>
> I have a data. frame which look like this one:
> 1000 1001 10021003
> 15 6 12
lt;- melt(df1,"area",2:4)
# then repeat each row by 'counts'
d <- d[rep(seq(nrow(d)), times=d$value),]
# then order (if order of id's is not arbitrary), and add ids
d <- d[order(d$area,d$variable),]
d$value <- seq(nrow(d))
# compare
cbind(df2,"---",d)
Best
> On Oct 22, 2014 12:33 AM, "Sven E. Templer" wrote:
>>
>> Hi.
>>
>> You can't.
>>
>> But using a second file where you first write your header and then
>> append the original file is a solution. ?cat and ?write.table with a
>> focus
the second, if
desired.
Best, Sven.
On 22 October 2014 02:32, YIHSU CHEN wrote:
> Hi guys;
>
> I want to write some text at the first line of an output file. The output
> file will be used for other software. In particular, the following text
> "ampl.tab 2 1" needs to be
;
[4] " Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>"
[5] " Everyone is permitted to copy and distribute verbatim copies"
[6] " of this license document, but changing it is not allowed."
On 15 October 2014 10:51, wrote:
> On 2014-10
Prevent graphic menues with:
options(menu.graphics = FALSE)
or and define repositories:
options(repos = c(CRAN = "http://cran.r-project.org";))
On 14 October 2014 17:00, wrote:
> Subscribers,
>
> A version of R is installed in a virtual machine, which has complete
> internet access via the host.
use:
which(p<=.05)
this will not yield logical, but integer indices without NA
On 14 October 2014 11:51, Rainer M Krug wrote:
> Hi
>
> I want to evaluate NA and NaN to FALSE (for indexing) so I would like to
> have the result as indicated here:
>
> ,
> | > p <- c(1:10/100, NA, NaN)
> | > p
follow instructions on
https://stat.ethz.ch/mailman/listinfo/r-help
at
"To unsubscribe from R-help, get a password reminder, or change your
subscription options enter your subscription email address: "
...
On 10 October 2014 16:16, Tasnuva Tabassum wrote:
> I want to get rid of this thread. what
Dear Barry,
some thoughts:
1) e in your function status_fnc is a vector when applied on a matrix
like object, but you index it as a matrix (e[,i] should be e[i]).
2) You can simplify the if statement by using the function any
(replacing all the OR statements) on the vector, so use any(e=='Y')
her
elp='utils') to open the utils package
index (as in the example above). Setting options(text_mode="html") and
options(browser="firefox") does not affect this behaviour. Also in
?help.start and ?help (or ?"?") I found no clues.
Thank you for any hints,
Sven
in ?which read about arr.ind
following jims assumption (column instead of row indices is what you
want) this also works:
m <- matrix(1:20,4)
unique(which(m>11, arr.ind = T)[,"col"])
On 27 September 2014 12:23, Jim Lemon wrote:
> On Fri, 26 Sep 2014 10:15:14 PM Fix Ace wrote:
>> Hello, there,
>>
see inline for another vectorized example.
On 25 September 2014 23:05, David L Carlson wrote:
> Another approach
>
> fun <- function(i, dat=x) {
> grp <- rep(1:(nrow(dat)/i), each=i)
> aggregate(dat[1:length(grp),]~grp, FUN=sum)
> }
>
> lapply(2:6, fun, dat=TT)
>
>
> ---
block.
Other workarounds are here, which you find when using a search engine:
http://stackoverflow.com/questions/1231195/multiline-comment-workarounds
Hope this helps.
@Duncan: sorry sending the mail to you twice.
Sven
On 9 September 2014 13:43, Duncan Murdoch wrote:
> On 08/09/2014, 11:14 PM, J
here. Try typingto proceed.
If that doesn't work, type X to quit.
Has anyone a clue what the problem might be?
Thanks
Sven
--
View this message in context: http://r.789695.n4.nabble.com/knitr-tp4641843.html
Sent from the R help mailing list archive at
You need to code a function which returns either a 1 for long and a 0 for flat
based on any conditions like, so something like
MASig <- function(MA1, MA2, MA3){
k <- 0
if((MA1 > MA2) && (MA2 > MA3)){k <- 1}
return(k)
}
you then use this in your signalfunction in quantstrat.
dont nail me for th
LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] inline_0.3.8 Rcpp_0.9.10 plyr_1.7.1
loaded via a namespace (and not attached):
[1] tools_2.15.0
Thanks for the replies,
1st, installing the BLAS library indeed worked out, and I was able to load
the packages.
2nd, I was trying to build from repository directly. But even worse, I
cannot tell you if i touched the BLAS linker flags, BUT there seem to be
more problems of a similar nature, ie.
Hello,
I am going through Zhao's RDataMining PDF, and to redo all the graphics on
my computer, I need several packages, 'coin' and 'party' to name two.
I get the following error:
> install.packages("coin")
Installing package(s) into ‘/home/sven/R/i686-p
Would like to see this at the top again, as I think it did not get pick up
when I posted it initially.
Apologies, last try.
--
View this message in context:
http://r.789695.n4.nabble.com/Help-with-this-web-scrape-function-tp4632137p4632169.html
Sent from the R help mailing list archive at Nab
lues the page would return
MessageBox containg an error.
So the function basically returns the original page with the Forms being
selected to the right values, but it doesnt take the next step to return the
final result. Is it possible that I might have to pack the function
retSubmit into a postForm
the webpage, if I am not mistaken, this
involves javascript. I am trying the same on a different page, but
couldnt get help either.
If you get the solution from somewhere, please let me know.
Sven
__
R-help@r-project.org mailing list
https://stat.et
Form going though.
Anybody ANY experience with these RCurl functions, please help. ANY input is
appreciated. The example functions in the package dont seem to work at all
for postForm() I think all pages are outdated, I also couldnt find any plain
documentation on omegahat.org, cant load the html
th the above parameters,
but it did not show any success. So I THINK the problem is that the
webapplication is returning the table on a different URL as the one above,
please have a quick try with the webapplication. How can I come by this
problem?
Best, and thanks
Sven
--
View this messa
Thanks Michael, thanks Arun,
silly enough, I actually had to restart the whole thing. And the function
now performs pretty well.
Many thanks
Sven
--
View this message in context:
http://r.789695.n4.nabble.com/Problem-with-readHTMLTable-tp4631439p4631498.html
Sent from the R help mailing
xts_0.8-2
zoo_1.7-6
loaded via a namespace (and not attached):
[1] grid_2.14.1IBrokers_0.9-3 lattice_0.20-0 tools_2.14.1
Many thanks
Sven
--
View this message in context:
http://r.789695.n4.nabble.com/Problem-with-readHTMLTable-tp4631439.ht
-Inf -Inf -Inf -Inf
-Inf -Inf
[31] -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf
-Inf -Inf
[46] -Inf -Inf -Inf
same with A = 500
So try to find a better model, or more sensible starting values.
Regards, Sven
On 05/04/2012 03:41 PM, Silvano wrote:
> Hi,
>
> I need fi
RMySQL_0.9-3
DBI_0.2-5
[6] mapdata_2.2-1 maps_2.2-5 xtable_1.7-0
loaded via a namespace (and not attached):
[1] grid_2.14.2 tools_2.14.2
Any ideas what goes wrong?
Thanks, Sven
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mail
te step:
collecting: vector=append(vector,i)
x=x[-vector,]
cheers,
sven
--
View this message in context:
http://r.789695.n4.nabble.com/Delete-row-takes-ages-alternative-tp3656949p3661979.html
Sent from the R help mailing list archive at Nabble.com.
__
x = x[-i,] --> deletes row i
etc...
This takes ages for some reason. Isnt there a quicker way to do this?!
Cheers,
Sven
--
View this message in context:
http://r.789695.n4.nabble.com/Delete-row-takes-ages-alternative-tp3656949p3656949.html
Sent from the R help mailing list archive a
ff_first" # case 2, f is turned into sub-text
sani <- function(x) gsub("_", "_", x)
@
\title{MyTitle: \\ \Sexpr{sani(mytitlevar)} }
\begin{document}
\maketitle
\end{document}
Regards, Sven
2010/11/16 Ralf B :
> I am using \Sexpr to include a variable in a title of a Sw
Hallo list,
I'm wondering if there is a way to extract the path to terminal nodes
in a BinaryTree object, e.g. ctree, like the function path.rpart in
package rpart.
Thanks, Sven
__
R-help@r-project.org mailing list
https://stat.ethz.ch/ma
You can try ctree in package party, but anyway: what is the deeper
sense in a binary split for a variable with more than 32 levels?
Regards, Sven
2010/11/10 Erik Iverson :
> Well, the error message seems relatively straightforward.
>
> When you run str(x) (you did not provide the data
Maybe you want somelthing like a PL with R, eg. PL/R
http://www.joeconway.com/plr/? Can you migrate to PostgreSQL?
Regards, Sven
2010/11/10 James Evans :
> We would like to call R functions from within MS SQL Server queries. Any
> advice on this would be appreciated.
>
"?
Many Thanks, Sven
__
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.
Thanks, but your suggestions don't solve the problem. Though, the plot is
storable via the rgl.postscript command, but this increases computation time
and memory requirements.
--
View this message in context:
http://r.789695.n4.nabble.com/RGL-and-Windows-7-tp2844487p2910131.html
Sent from the R
l_perf.png ).
What can I do? (Reinstalling Windows XP is no alternative. :-) )
Thanks, Sven
--
View this message in context:
http://r.789695.n4.nabble.com/RGL-and-Windows-7-tp2844487p2844487.html
Sent from the R help mailing list archive at Nabble.com.
_
Sorry, I was too vague in my initial question. To make it clearer I
included the following example:
tmp <- data.frame(y=runif(10), x=gl(2,5), class=gl(2,5))
p <- ggplot(data = tmp)
p <- p + geom_point(aes(y=y, x=x))
p <- p + facet_wrap(~ class, scales = "free")
p <- p + ylim(0, 1)
p
This code
uld I do it?
On 11 Sep 2010, at 23:37, Jonathan Christensen wrote:
> Swen,
>
> facet_grid forces the scale for plots along an axis to be shared.
> Try facet_wrap instead.
>
> Jonathan
>
>
> On Sat, Sep 11, 2010 at 2:21 PM, Sven Laur wrote:
> Faceting in ggpl
Faceting in ggplot2 seems to permit different scales for different
facets, but I fail
to see how one could control ylim and xlim ranges for each facet
separately.
For instance, I would like to set the ylim = c(0,10) for facet "A"
and ylim = c(42,102) for facet "B". Since the data is out of th
Great, thanks, Sveb
2010/5/20 Duncan Murdoch :
> Sven Garbade wrote:
>>
>> Hi list,
>>
>> I need to process a Rnw file and and a csv file (both are encoded in
>> UTF-8) under Windows XP (R Version 2.11.0, i386, mingw32).
>>
>
> Take a look at this po
ere any ideas to get Sweave working? I would be nice when the
file encoding can be left in UTF-8.
Thanks, Sven
__
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.
Hi list,
can anybody point me to the trick how glm is computing the dispersion
parameter in quasi-poisson regression, eg.
glm(...,family="quasipoisson")?
Thanks ®ards, Sven
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/
lt;- khat(as.points(cases), coor,s=0:1000)
I do not know if there is a problem using multiple polygons that way or if khat
produces then only results for the "first" polygon or even completely wrong
results.
Does anyone know the answer?
Thanks a lot,
Sven Schmiedel
PhD student a
mpling dates are independent of each other,
but they aren't (since I measured the CO2 15 times on exactly the same
spot).
So, that's why my question is how can I combine the paired (or nested)
design with the repeated measurements in one model???
Thank you for any help
S
. It seems bizarre...
System is
Mac OS X 10.5.8 (PowerPC)
R 2.9.1 GUI 1.28 Tiger build 32-bit (5444)
R version 2.9.1 (2009-06-26)
Minimal amount of code to get the behaviour is
if(!isGeneric("print")) {setGeneric("print",useAsDefault=print)}
What is the
")
In the single models coxph.fit0 and coxph.fit1 I can use a robust variance
estimation.
It seems that the function anova don't use a robust estimation for the analysis
of deviance.
My question is, how can I use robust estimation for the analysis of deviance?
With kind regards,
Sven Knüppe
;
> Many thanks,
>
> Marlene.
Hi Marlene,
if you just want to calculate the mean of the non-infinite values, you can use
this statement:
mean(x[!is.infinite(x)])
Sven
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/
Sorry for sending my email twice, first I used
"[EMAIL PROTECTED]" and thought this was wrong. R version is
2.6.1 (2007-11-26).
Thanks, Sven
On Fri, 2008-01-11 at 10:16 +0100, Martin Maechler wrote:
> >>>>> "SG" == Sven Garbade <[EMAIL PROTECTED]>
&g
GB RAM, kernel version 2.6.22. R was installed with
deb-Packages from CRAN. "memtest86+" (Version 3.3-2) doesn't find
corrupted RAM.
Any suggestions? Thanks, Sven
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo
2 GB RAM. R was installed with deb-Packages from CRAN.
"memtest86+" (Version 3.3-2) doesn't find corrupted RAM.
Any suggestions? Thanks, Sven
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do re
of the constraint
it seems that they are not designed to deal with the second part (or I do not
see how to specify this second constraint).
Is there an existing function for this sort of problem in R?
Regards,
Sven
Sven Lautenbach
UFZ Centre for Environmental Research in the Helmholtz Assoc
On Tue, 2007-11-06 at 08:03 -0600, Dirk Eddelbuettel wrote:
> On Tue, Nov 06, 2007 at 01:08:40PM +0100, Sven Garbade wrote:
> > Dear list,
> >
> > I cannot load the tcltk library:
> >
> > > library(tcltk)
> > Loading Tcl/Tk interface ... Error in fun(.
tk8.4.so
$ ldconfig -p | grep libtcl
libtcl8.5.so.0 (libc6) => /usr/lib/libtcl8.5.so.0
libtcl8.4.so.0 (libc6) => /usr/lib/libtcl8.4.so.0
libtcl8.4.so (libc6) => /usr/lib/libtcl8.4.so
Anything wrong with my Tcl/Tk installation?
Thanks, Sven
72 matches
Mail list logo