Hi Jim,
Thanks. It works. I now have more complex problems. If at each blackcell,
there are two variables such as pop and mood. For each variable, there are
daily records in one year, so 365 records for pop and 365 records for mood.
The averaged values for the redcells should be daily records too.
Hi,
I'd like to graph three lines on ggplot2 and I intend the lines to be
"solid", "dashed", and "dotted". The legend names are "name_b", "name_a",
"name_c". I'd like to legend to present in the order: the "name_b" at the
top, and "name_c" at the bottom.
As a consequence, the legend is indeed i
Dear R-experts,
I am trying to bootstrap (and average) the median squared error evaluation
metric for a robust regression. I can't get it. What is going wrong ?
Here is the reproducible example.
#
install.packages( "quantreg" )
library(quantreg)
crp <-c(12,14,13,24
Presumably this is in the package maps?? -- you need to specify such
details when referring to non-base R functionality.
In any case, you are more likely to get a helpful response if you post to
the r-sig-geo list, which specialized in such spatial statistics/graphics
questions.
Cheers,
Bert
Here is a simplified example:
dat <- data.frame(x=1:4, y1=runif(4), y2=runif(4), y3=4:1)
for (icol in 2:4) plot(dat[,1] , dat[,icol] )
(not tested, so hopefully all my parentheses are balanced, no typos, etc.)
This shows the basic principle.
An alternative is to construct each column name as a
I have been using the "map" function in R and I was wondering if there is a way
to map multi-state regions just showing the outline of the region without
interior state borders. For instance, I am calculating aggregated statistics
using 10 multi-state regions. I would like to color-code indivi
Just for completeness: there are several ways to open files for editing in
RStudio -
* Configure your computer to be able to double-click on a file and open it
in RStudio: this is OS dependent. Google for "change file associations"
to get advice.
* Drag and drop a file icon onto the RStu
I recommend instead of no border, that you use a border with the same
color as the fill.
I do this in the likert functions in the HH package.
Rich
On Mon, May 21, 2018 at 10:59 AM, Martin Batholdy via R-help
wrote:
> Dear R-users,
>
> I want to draw a barplot with beside=TRUE.
> One halve of th
What I think is the ggplot2 version of what you want. Note that I am using the
reshape2 package which is a bit old fashioned.
=library(reshape2)
library(ggplot2)
dat1 <- structure(list(N = c("I", "II", "III", "IV", "V", "VI", "VII",
As I read ?barplot, the answer is no. I suspect the same is true in ggplot
and lattice, but you would have to check. If correct, this means you would
explicitly have to use the "width" argument to narrow or widen the bars
appropriately. Or maybe try something like:
barplot(x, beside=T, border= "bl
Dear R-users,
I want to draw a barplot with beside=TRUE.
One halve of the bars are drawn with a border, while the other halve are drawn
without a border (i.e. filled bars vs. non-filled bars next to each other).
Because borders are drawn around the bars, doing this leads to one halve of the
bar
On 05/21/2018 12:06 AM, Glenn Schultz wrote:
All,
I am considering creating an S4 class whose slots (2) are both S4
classes. Since an S4 slot can be an S3 class I figure this can be done.
However, the correct syntax of which I am unsure. Reviewing the docs
I have come to the following c
> plot(1:10, xlab = expression(NO[3]^-~(mg/L)))
It's unexpected but not inexplicable.
The difficulty is that the superscript begins with a unary minus operator. It
_must_ have something (number or variable) after it to negate. Since the thing
following the '-' is not a number, plotmath has just t
See ?barplot and set the horiz argument to TRUE.
(This is in the base R plotting version. The ggplot2 and lattice systems
have other ways of doing this)
Note: if you search on e.g. "barplots in R" or similar, you should find
numerous examples with code.
Cheers,
Bert
Bert Gunter
"The trouble
Hi all,
I´m trying to plot this data
N M W
I 10 106
II 124 484
III 321 874
IV 777 1140
V 896 996
VI 1706 1250
VII 635 433
VIII 1437 654
IX 693 333
X 1343 624
XI 1221 611
XII 25 15
XIII 3
XIV 7 8
So that in de Y axis will be the level (qualitative data) and in the X axis
will be M and W variables.
Hello,
Ulrik's way is simpler therefore better. I would use it, not mine.
As for an explanation of mine, here it goes.
1) Parenthesis are meta-characters and must be escaped if you want to
match them:
\\( and \\)
2) You want to keep them so I used groups, i.e., put what you want
between
I would use
sub("\\(.*\\)", "()", s)
It is essentially the same as Rui's suggestion, but I find the purpose to
be more clear. It might also be a little more efficient.
HTH
Ulrik
On Mon, 21 May 2018, 15:38 Rui Barradas, wrote:
> Hello,
>
> Try this.
>
>
> ss1 <- "z:f(5, a=3, b=4, c='1:4', d=2)
Hello,
Try this.
ss1 <- "z:f(5, a=3, b=4, c='1:4', d=2)"
ss2 <- "f(5, a=3, b=4, c=\"1:4\", d=2)*z"
fun <- function(s) sub("(\\().*(\\))", "\\1\\2", s)
fun(ss1)
#[1] "z:f()"
fun(ss2)
#[1] "f()*z"
Hope this helps,
Rui Barradas
On 5/21/2018 2:33 PM, Vito M. R. Muggeo wrote:
dear all,
I am
dear all,
I am stuck on the following problem. Give a string like
ss1<- "z:f(5, a=3, b=4, c='1:4', d=2)"
or
ss2<- "f(5, a=3, b=4, c=\"1:4\", d=2)*z"
I would like to remove all entries within parentheses.. Namely, I aim to
obtain respectively
"z:f()" or "f()*z"
I played with sub() and gsub(
Try
plot(1:10, xlab = expression(NO[3]^{'-'}~(mg/L)))
Hope this helps,
Rui Barradas
On 5/21/2018 1:09 PM, Jinsong Zhao wrote:
hi there,
I find the following codes produce strange output.
plot(1:10, xlab = expression(NO[3]^-~(mg/L)))
you will notice that the unit, mg/L is in superscript for
FYI I see everything after the '^' as a superscript.
The '~' does act as a space. (When I omit it there is less space between
the '-' and the '('.
On Mon, May 21, 2018 at 3:09 PM, Jinsong Zhao wrote:
> hi there,
>
> I find the following codes produce strange output.
>
> plot(1:10, xlab = expre
hi there,
I find the following codes produce strange output.
plot(1:10, xlab = expression(NO[3]^-~(mg/L)))
you will notice that the unit, mg/L is in superscript format.
That means that "~" is not for space.
However, the help page of plotmath does not mention this behavior.
Best,
Jinsong
Oh fab it works! thanks v much i'd never used open file like that before Nick
> On 21 May 2018 at 12:24 Duncan Murdoch wrote:
>
>
> On 21/05/2018 7:20 AM, Nick Wray via R-help wrote:
> > Hello. I'm not sure whether this is strictly the right forum but here
> > goes... I have got a new (well reco
On 21/05/2018 7:20 AM, Nick Wray via R-help wrote:
Hello. I'm not sure whether this is strictly the right forum but here goes...
I have got a new (well reconditioned) laptop and have installed R studio on
it. That works fine if I say write a little prog directly into it or paste R
script f
Hello. I'm not sure whether this is strictly the right forum but here goes...
I have got a new (well reconditioned) laptop and have installed R studio on
it. That works fine if I say write a little prog directly into it or paste R
script from a word doc. But if I try to open an R prog (whic
As Jim says, "No data". R-help is very fussy about what files it will accept.
You might try changing the extention to txt. However the preferred way here is
to use the dput() command and paste the results into the post. See ?dput for
details.
On Monday, May 21, 2018, 1:40:59 a.m. EDT
Hi Steven,
Sad to say that your CSV file didn't make it to the list and I can't
access the data via your Dropbox account. Therefore we don't know the
structure of "mydata". If you are able to plot the data as in your
example, this might help:
genexp<-matrix(runif(360,1,2),ncol=18)
colnames(genexp)
27 matches
Mail list logo