Not sure why you are making this so complicated. In what way is the
following not meeting your expectations?
ggplot( data=matz
, aes( x = X1
, y = value
, col=X2
, lty=X2
, shape=X2
, size=mylwd
)
) +
geom_line() +
Sys.setenv( TZ="Etc/GMT+8" )
executed before converting to POSIXct works for me, though using that string
with the tz parameter also works. You should read ?Sys.timezone. For windows,
look at the files in C:\Program Files\R\R-3.2.2\share\zoneinfo and note that
PST is not defined though PST8PDT
So in this case, "create_bins" returns a vector and I still get the same
error.
create_bins <- function(x, nBins)
{
Breaks <- unique(quantile(x$pred, probs = seq(0, 1, 1/nBins)))
bin <- cut(x$pred, breaks = Breaks, include.lowest = TRUE)
bin
}
### Using dplyr (fails)
nBins = 10
by_group
I'd recommend reading the ggplot2 book - learning more about how
scales work in ggplot2 will help you understand why this isn't
possible.
Hadley
On Thu, Oct 29, 2015 at 6:31 PM, sbihorel
wrote:
> Thank for your reply,
>
> I may accept your point about the
Thank you Jari,
It seems now that my question is morphing more into a statistical one, and
perhaps not appropriate for R-help list, so apologies. Yes we are talking
about the latest versions of the vegan and permute packages.
When there are an insufficient number of permutations available due
I should think this thread contains all you need:
http://stackoverflow.com/questions/18306362/run-r-script-from-command-line
B.
On Oct 30, 2015, at 11:07 PM, Gregory Coats wrote:
> All of the R commands that I want to issue are in a text file that concludes
> with the R
Using numeric for missing sounds like asking for trouble. But if you
must, something like
mydata$confusingWillCauseProblemsLater <-
ifelse(
is.na(mydata$sex),
0,
as.numeric(factor(mydata$sex,
levels = c("M", "F"
should do it.
Best,
Ista
On Fri, Oct 30,
All of the R commands that I want to issue are in a text file that concludes
with the R command quit (save = “yes”), and is called R_commands.txt. I can
start R, and then manually issue
source (“R_commands.txt”).
But I would prefer to issue, from the bash command line, a one line command,
Hi all,
Iam trying to change character to numeric but have probelm
mydata <- read.table(header=TRUE, text=', sep=" "
id sex
1 NA
2 NA
3 M
4 F
5 M
6 F
7 F
')
if sex is missing then sex=0;
if sex is"M" then sex=1;
if sex is"F" then
I am trying to change the mydata$sex from character to numeric
I want teh out put like
id sex
1 NA 0
2 NA 0
3 M 1
4 F 2
5 M1
6 F 2
7 F2
mydata$sex1 <- 0
if(mydata$sex =="M " ){
mydata$sex1<-1
} else {
mydata$sex1<-2
On 31/10/15 14:15, Val wrote:
Hi all,
Iam trying to change character to numeric but have probelm
mydata <- read.table(header=TRUE, text=', sep=" "
id sex
1 NA
2 NA
3 M
4 F
5 M
6 F
7 F
')
if sex is missing then sex=0;
if
I have a 5.76" x 5.75" png image which I would like to crop to some inch
size. To use as a report header (after placing some title text on it).
So how to use R to crop a nice rectangle from my image?
Thanks for your thoughts
Jim Burke
[[alternative HTML version deleted]]
Dear R users:
All textbook references that I consult say that in a nested ANOVA (e.g.,
A/B), the F statistic for factor A should be calculated as
F_A = MS_A / MS_(B within A).
But when I run this simple example:
set.seed(1)
A <- factor(rep(1:3, each=4))
B <- factor(rep(1:2, 3, each=2))
Y <-
Hi,
I am trying to do add a legend to an overplot, something like this:
ggplot() +
geom_density(data = df1, aes(x = x), fill = "green", show_guide =
FALSE) +
geom_area(data = df2, aes(x = x), fill = "yellow", show_guide = FALSE) +
scale_color_manual(values = c("green", "yellow"),
Thanks Hadley,
I will certainly read your book. Unfortunately, what you just confirmed
as the developer of ggplot means that ggplot is non-starter for what I
want to build. Too bad, I was starting to appreciate some of its
advantages over lattice.
About your book, in case I do not find a
Hi,
I was trying to increase the size of certain lines in my plot (samples 'B'
and 'D' in example below). However, when I try to modify the line size, I
seem to screw up the linetypes. Also, is there a way to reflect the line
size in the legend?
Here is some sample code for illustration:
On 31/10/15 03:32, Wagenaar, Daniel (wagenadl) wrote:
Dear R users:
All textbook references that I consult say that in a nested ANOVA
(e.g., A/B), the F statistic for factor A should be calculated as F_A =
MS_A / MS_(B within A). But when I run this simple example:
set.seed(1)
A =
The error message is not very helpful and the stack trace is pretty
inscrutable as well
> dplyr::group_by(df, models) %>% dplyr::summarize(create_bins)
Error: not a vector
> traceback()
14: stop(list(message = "not a vector", call = NULL, cppstack = NULL))
13: .Call("dplyr_summarise_impl", PACKAGE
Dear R users:
All textbook references that I consult say that in a nested ANOVA (e.g., A/B),
the F statistic for factor A should be calculated as F_A = MS_A / MS_(B within
A). But when I run this simple example:
set.seed(1)
A = factor(rep(1:3, each=4))
B = factor(rep(1:2, 3, each=2))
Y =
dplyr::mutate is probably what you want instead of dplyr::summarize:
create_bins3 <- function (xpred, nBins)
{
Breaks <- unique(quantile(xpred, probs = seq(0, 1, 1/nBins)))
bin <- cut(xpred, breaks = Breaks, include.lowest = TRUE)
bin
}
dplyr::group_by(df, models) %>%
I'm getting an "invalid first argument" error for the following. However,
con is an actual connection and is set up properly. So what does this error
actually refer to?
library(dplyr)
con <- RSQLServer::src_sqlserver("***", database = "***")
myData <- con %>%
tbl("table") %>%
group_by(
Maybe you want
summary(aov(Y ~ A + Error(A:B)))
Kevin
On Fri, Oct 30, 2015 at 9:32 AM, Wagenaar, Daniel (wagenadl) <
wagen...@ucmail.uc.edu> wrote:
> Dear R users:
>
> All textbook references that I consult say that in a nested ANOVA (e.g.,
> A/B), the F statistic for factor A should be
On 10/30/2015 11:17 AM, Mark Leeds wrote:
Daniel: Just to complete my solution, here's the code for doing the
mean. Didn't expect this to take 3 emails !!! Have a good weekend.
temp <- tapply(f$value, f$justtimes, mean)
finalDF <- data.frame(chrontimes = times(rownames(temp)), values = temp)
Bill,
Your final words, "changes in spring and fall" reminds me of a problem
I have yet to solve. Most of my data is logged in standard time (no
daylight times) but often I see the note "daylight time encountered
switching to UTC" even when I've specified "tz="PST".
I hope I've been
You need to divide and conquer... find out which step is breaking the pipe by
terminating it early at various points and if the problem is still not clear
one you know which step is broken then give us a reproducible example.
I am not familiar with RSQLServer specifically, but the version of
I have a data frame with date/times represented as charaacter strings
and and a value at that date/time. I want to get the mean value for
each time of day, across days, and then plot time of day on the x-axis
and means on the y-axis. R doesn't appear to have a built-in time of
day time type
Thank you Jari,
It seems now that my question is morphing more into a statistical one, and
perhaps not appropriate for R-help list, so apologies. Yes we are talking
about the latest versions of the vegan and permute packages.
When there are an insufficient number of permutations available due
is this what you want:
> df <- structure(list(date = structure(1:8, .Label = c("2015-10-29
00:50:00",
+ "2015-10-29 09:30:00", "2015-10-29 21:10:00", "2015-10-30 00:50:00",
+ "2015-10-30 09:30:00", "2015-10-30 21:10:00", "2015-10-31 00:50:00",
+ "2015-10-31 10:30:00"), class = "factor"), value =
You can use difftime objects to get the amount of time since the start of
the current day. E.g.,
> dateTime <- as.POSIXlt( c("2015-10-29 00:50:00",
+ "2015-10-29 09:30:00", "2015-10-29 21:10:00", "2015-10-30 00:50:00",
+ "2015-10-30 09:30:00", "2015-10-30 21:10:00", "2015-10-31 00:50:00",
I get confused by this also, but I believe your time zone is US/Pacific,
which
specifies both the offset from UTC and the dates on which we switch between
'standard' (winter) and 'daylight savings' (summer). I think you would have
to create a new time zone entry that is always UTC+8 hours, or
Hola,
Esta una forma de hacerlo.
Fíjate que por la forma que has dado los datos, tienes blancos antes y
después de cada cadena y por no cambiarlo, en vez de utilizar
"is.na(datIn$COLEGIO)"
he tenido que hacer lo que ves datIn$COLEGIO== " NA "
#-
> Lines <- "
+ | NOMBRE |
Hola a todos. Pongo esta tabla sencilla a ver si alguien puede echarme un
cable. En la columna COLEGIO salen unos NAs.
| NOMBRE | LOCALIDAD | COLEGIO |
| JUAN | SANTANDER | A |
| ALBERTO | LA RIOJA | C |
| MANUEL | MADRID | B |
| MARTA | MADRID | NA |
| IRENE | VALLADOLID | NA |
| LUCAS |
Buenas,
Quiero, usando la libreria tcltk, poder seleccionar a la vez en dos listbox,
pero s�lo me deja en uno u el otro, pero no los dos a la vez.
He probado cambiando los selectmode a sus diferentes opciones (multiple,
browse,single), pero cuando voy a seleccionar el segundo, me quita la
Era una bobaa, es añadir el
exportselection="FALSE"
Gracias igualmente
From: j.para.fernan...@hotmail.com
To: r-help-es@r-project.org
Date: Fri, 30 Oct 2015 12:22:18 +0100
Subject: [R-es] Seleccionar dos tklistbox a la vez
Buenas,
Quiero, usando la libreria tcltk, poder seleccionar a la
Buenas,
Estoy creando un paquete y me gustar�a crear un acceso directo en el escritorio
que al pulsar sobre el, abra R, cargue el paquete [ library(mipaquete) ] y
ejecute la funcion inicio()
�Es posible hacerlo?
Gracias
[[alternative HTML
35 matches
Mail list logo