Thanks a lot - I got interested to make it work since just formatting
in lubricate as a time automatically puts the same complete date, which
was OK for me - and also provided a utility for adding days - which
apparently then needs tweaking -
Best wishes
Troels
Den 28-03-2017 kl. 20:38 sk
> On Mar 28, 2017, at 9:32 AM, Leon Lee wrote:
>
> Hi, R experts
>
> I am new to R & GAM toolbox and would like to get inputs from you all on my
> models. The question I have is as follows:
> I have 30 subjects with each subject being scanned from one to three times
> in the first year of life.
Analyzing time data as POSIXct without dates is IMO unwise (likely to give you
trouble). My approach is to always keep the date and time together or to use
numeric hours-after-midnight. Others have invented packages like chron to deal
with such data.
--
Sent from my phone. Please excuse my brev
What you are seeing when printing depends on how you do it (and it can be
confusing). Try this, type the following lines exactly (or copy and paste)
and carefully study the results. In particular, compare the results of
cat(s,'\n') with the results of strsplit(s, '"') .
s <- "{\"Q0\":\"37\",
`model.matrix` was what I was looking for.
Thanks,
Sören
> On 28.03.2017, at 16:57, peter dalgaard wrote:
>
>
>> On 28 Mar 2017, at 16:14 , Sören Vogel wrote:
>>
>> Hello
>>
>> Ho can I apply a formula to a data frame?
>
>
> That would depend on whether the formula has any special interpr
You haven't actually _defined_ what the expected range of variations of your
string are, but if I speculate wildly, I can come up with the following two
solutions that may get you started.
s <- '*"{\"Q0\":\"37\",\"Q1\":\"f\"}"*'
regmatches(s, gregexpr("([0-9]{2,}|[a-z]+)", s))[[1]]
strsplit(s, "
Hi R-help,
I would like to:
Extract the "26" and "f" from the following string (i.e. age and gender).
I've tried a bunch of strsplit, grep, etc. Please help!
*"{\"Q0\":\"37\",\"Q1\":\"f\"}"*
Thanks,
Edward
--
Edward H Patzelt | Clinical Science PhD Student
Psychology | Harvard University
*C
Hi, R experts
I am new to R & GAM toolbox and would like to get inputs from you all on my
models. The question I have is as follows:
I have 30 subjects with each subject being scanned from one to three times
in the first year of life. The brain volume from each scan was measured.
The scan time was
You have multiple problems. You do not seem to understand read.csv() or
as.Date() so you really need to read the manual pages:
?read.csv
?as.Date
> Data <- read.csv("Container.csv")
> str(Data)
'data.frame': 362 obs. of 1 variable:
$ TransitDate.Transits: Factor w/ 362 levels "1-Apr-00\t25",
Dear friend David,
Thank you for your valuable suggestion. So here is the file in .txt format.
Best of regards,
Paul
2017-03-28 9:35 GMT-05:00 David L Carlson :
> We did not get the file on the list. You need to rename your file to
> "Container.txt" or the mailing list will strip it from your
Hi Paul,
Using the example provided by Ulrik, where
> exdf1 <- data.frame(Date = c("1985-10-01", "1985-11-01", "1985-12-01”,
> "1986-01-01"), Transits = c(NA, NA, NA, NA))
> exdf2 <- data.frame(Date = c("1985-10-01", "1986-01-01"), Transits =
> c(15,20)),
You could also try the following funct
Hi Georg,
you were on the right path - it is all about scale_fill*
The 'problem' as you've discovered is that value is continuous, but
applying scale_fill_manual or others (except scale_fill_gradient) expects
discrete values.
The solution is simply to set the fill with that by using factor():
g
Dear everyone,
I have a 2x3 design (medication x stimulus type) but very few subjects (6)
and I would like to perform intra-subject stats using r's aov (I've already
run the group analysis). Is there a conceptual problem with this, as long
as I don't interpret the results as representative of the
Hi Paul,
The date format that you have supplied to R isn’t exactly right.
Instead of supplying the format “%Y-%m-%d”, it appears that the format of your
data adheres to the “%e-%B-%y” format. In this case, %e refers to Day, and
takes an integer between (0 - 31), %B refers to the 3 letter abbrev
The colors can be specified with the standard lattice "col=" argument.
likert(t(BB), ReferenceZero=0, horizontal=FALSE,
col=RColorBrewer::brewer.pal(4, "Blues"))
Most other customizations you might need are also possible. Many examples
are in the examples section of ?likert and in the dem
Hi Ulrik,
your answer is very valuable to me. If you do not know what I do, others
don't either. So I should definitely adapt my code.
The result of your code and my code is the same. Thus, I use your code
cause it is better readable.
My other question was how I can change the color palette fo
Hi Richard,
many thanks for your reply.
Your solution is not exactly what I was looking for. I would like to know
how I can change the colors of the stacked bars in my plot and not use the
default values. How can this be done?
Kind regards
Georg
Von:"Richard M. Heiberger"
An: g.m
I think you are looking for the likert function in the HH package.
>From ?likert
Diverging stacked barcharts for Likert, semantic differential, rating
scale data, and population pyramids.
This will get you started. Much more fine control is available. See
the examples and demo.
## install.pa
Dear friends - I have a series of times on successive days and would
like to convert them into a successive common time for each person (ID)
. Using lubridate and adding days(1) does as expected apart from
changing time zone to LMT from UTC and suddenly adding 9:21 (H:M) to all
times. Individua
> On 28 Mar 2017, at 16:14 , Sören Vogel wrote:
>
> Hello
>
> Ho can I apply a formula to a data frame?
That would depend on whether the formula has any special interpretation.
If if is just an elementary expression, then it would be like
eval(For1[[3]], Data, environment(For1))
but you a
We did not get the file on the list. You need to rename your file to
"Container.txt" or the mailing list will strip it from your message. The
read.csv() function returns a data frame so Data is already a data frame. The
command DataFrame<-data.frame(Data) just makes a copy of Data.
Without the
Hi Georg,
I am a little unsure of what you want to do, but maybe this:
mdf <- melt(dfr)
d_result <- mdf %>%
dplyr::group_by(variable, value) %>%
summarise(n = n())
ggplot(
d_result,
aes(variable, y = n, fill = value)) +
geom_bar(stat = "identity")
HTH
Ulrik
On Tue, 28 Mar 2017 at 15
Dear Bo Lin,
I tried doing
Containerdata$TransitDate<-as.Date(Containerdata$TransitDate, "%e-%B-%y")
but I keep getting NAs.
I also tried a solution that I saw in stackoverflow doing:
> lct<-Sys.getlocale("LC_TIME"); Sys.setlocale("LC_TIME", "C")
[1] "C"
>
> Sys.setlocale("LC_TIME", lct)
[1] "En
Dear friends Ng Bo Lin, Mark and Ulrik, thank you all for your kind and
valuable replies,
I am trying to reformat a date as follows:
Data<-read.csv("Container.csv")
DataFrame<-data.frame(Data)
DataFrame$TransitDate<-as.Date(DataFrame$TransitDate, "%Y-%m-%d")
#trying to put it in -MM-DD for
Hello
Ho can I apply a formula to a data frame?
library("formula.tools")
Data <- data.frame("v1" = rnorm(31), "v2" = runif(31), "v3" = sample(1:7, 31,
repl=T), "v4" = rlnorm(31))
For1 <- as.formula(v1 ~ .^3)
Lhs <- Data[, formula.tools::lhs.vars(formula)]
Rhs <- apply_formula_to_data_frame_and_r
Thanks much Duncan. Having someone do the work for me is even better than a
function!
The cmatrix function will be to make contrast matrices BTW.
On 03/28/2017 08:11 AM, Duncan Murdoch wrote:
On 28/03/2017 8:53 AM, Therneau, Terry M., Ph.D. wrote:
I'm thinking of adding a new "cmatrix" functi
Following these pointers given by Duncan Murdoch is the key to success,
at least on my system.
Many thanks!
olsen
On 28/03/17 13:49, Duncan Murdoch wrote:
> On 28/03/2017 6:39 AM, olsen wrote:
>> I think I found the fly in the ointment, running the same text3d() lines
>> with 'useFreeType=TRUE'
On 28/03/2017 8:53 AM, Therneau, Terry M., Ph.D. wrote:
I'm thinking of adding a new "cmatrix" function/method to the survival package
but before
I do I'd like to find out if any other packages already use this function name.
The
obvious method is to look at the NAMESPACE file for each packag
Hi All,
in my current project I have to plot a whole bunch of related variables
(item batteries, e.g. How do you rate ... a) Accelaration, b) Horse Power,
c) Color Palette, etc.) which are all rated on a scale from 1 .. 4.
I need to present the results as stacked bar charts where the variables
I'm thinking of adding a new "cmatrix" function/method to the survival package but before
I do I'd like to find out if any other packages already use this function name. The
obvious method is to look at the NAMESPACE file for each package in CRAN and read the
export list.
This is the kind of
On 28/03/2017 6:39 AM, olsen wrote:
I think I found the fly in the ointment, running the same text3d() lines
with 'useFreeType=TRUE' returns:
"FreeType not supported in this build"
You need to install FreeType and FTGL. I think this is how to do it on
Trusty. Don't know if it will work on yo
Hi Paul,
does this do what you want?
exdf1 <- data.frame(Date = c("1985-10-01", "1985-11-01", "1985-12-01",
"1986-01-01"), Transits = c(NA, NA, NA, NA))
exdf2 <- data.frame(Date = c("1985-10-01", "1986-01-01"), Transits = c(15,
20))
tmpdf <- subset(exdf1, !Date %in% exdf2$Date)
rbind(exdf2, tmp
I think I found the fly in the ointment, running the same text3d() lines
with 'useFreeType=TRUE' returns:
"FreeType not supported in this build"
On 28/03/17 11:05, olsen wrote:
> thanks, the fonts seem to be on:
>> rglFonts()
> $serif
> [1] "/usr/lib/R/site-library/rgl/fonts/FreeSerif.ttf"
> [2]
thanks, the fonts seem to be on:
> rglFonts()
$serif
[1] "/usr/lib/R/site-library/rgl/fonts/FreeSerif.ttf"
[2] "/usr/lib/R/site-library/rgl/fonts/FreeSerif.ttf"
[3] "/usr/lib/R/site-library/rgl/fonts/FreeSerif.ttf"
[4] "/usr/lib/R/site-library/rgl/fonts/FreeSerif.ttf"
$sans
[1] "/usr/lib/R/site-li
Did you follow XQuartz's advice of logging out and back in after the install?
-pd
> On 27 Mar 2017, at 22:44 , WILLIAM J HAYNES wrote:
>
> HI,
>
> I installed R on a Mac Book Pro running 10.10.5 and for some reason my
> X11.app is in a place that the R installation cannot find. How can I set
> On 27 Mar 2017, at 17:23 , Gabrielle Perron
> wrote:
>
> Hi,
>
>
> This is my first time using this mailing list. I have looked at the posting
> guide, but please do let me know if I should be doing something differently.
Avoid sending in HTML. It's not really bad here except for excessi
Hi Gabrielle,
With that number of binary predictors it would be no surprise if some
were linear combinations of others.
Jim
On Tue, Mar 28, 2017 at 2:23 AM, Gabrielle Perron
wrote:
> Hi,
>
>
> This is my first time using this mailing list. I have looked at the posting
> guide, but please do le
FAQ 7.16
Bert
On Mar 28, 2017 1:20 AM, "Luigi Marongiu" wrote:
Dear all,
I have set a function to draw some data using lattice; the drawing
works when I use lattice on its own, but if I put it into my custom
function, the final plot is empty, yet the terminal reports RStudioGD
1
as no
Hi, Luigi,
you are probably missing a call to print() around the call to
the latticeExtra plotting function useOuterStrips() you use
inside your function printer().
Hth -- Gerrit
-
Dr. Gerrit Eichner Mathem
Hi, John,
see inline.
Am 27.03.2017 um 20:47 schrieb John Murtagh:
Hi All,
I am trying to generate a cdf plot by using ggplot and have looked at some
examples online. However when I try to replicate it I get the following
error:
"arguments imply differing number of rows: 1, 0"
I made a searc
Hi Jamil,
You first need to specify 'xaxt' and 'yaxt' in your plot() call, and
then you can set the size of the labels with cex.axis:
plot(x, y, xlab=expression(vartheta), ylab="Concentration", xaxt="n",
yaxt="n")axis(1, cex.axis=3) axis(2, cex.axis=2)
HTH,
Ivan
--
Ivan Calandra, PhD
MONRE
HI,
I installed R on a Mac Book Pro running 10.10.5 and for some reason my X11.app
is in a place that the R installation cannot find. How can I set the
environmental variables so the X11 server will run. I also have Xquartx.app but
R does not seem to find that either.
Best Regards,
William “J
Dear friend Mark,
Great suggestion! Thank you for replying.
I have two dataframes, dataframe1 and dataframe2.
dataframe1 has two columns, one with the dates in -MM-DD format and the
other colum with number of transits (all of which were set to NA values).
dataframe1 starts in 1985-10-01 (oct
Hi All,
I am trying to generate a cdf plot by using ggplot and have looked at some
examples online. However when I try to replicate it I get the following
error:
"arguments imply differing number of rows: 1, 0"
I made a search and it seems from what I gather the nrows!=ncol and that
doesn't work
Hi there,
I happened to find the expression(!abc) produces !(abc) when I used
plotmath in a text annotation. Here is the mini-example.
> plot(1, type = "n")
> text(1,1, expression(!abc))
I don't find "!" in plotmath document.
By the way, how to reduce the space between two adjacent strings,
Hi,
This is my first time using this mailing list. I have looked at the posting
guide, but please do let me know if I should be doing something differently.
Here is my question, I apologize in advance for not being able to provide
example data, I am using very large tables, and what I am tryi
Dear R-users,
I would like to ask probably a silly thing. For some reason, I need x-axis
and y-axis labels to be of different size. Here is a little example where I
want "ϑ" to appear bigger than "Concentration". I have tried in the
following way, but it is not working.
x<-seq(1,10,1)
y<-seq(2,2
Dear all,
I have set a function to draw some data using lattice; the drawing
works when I use lattice on its own, but if I put it into my custom
function, the final plot is empty, yet the terminal reports RStudioGD
1
as normal.
What am I missing?
regards,
Luigi
>>>
cluster <- c(rep("A", 90
Hello All,
I am using below code to send alerts from R. However, while testing the
emails to other users The image which is used as inline in email
configuration is not showing up as it is referencing to my temp folder.
Any ideas to resolve this ? I need to have embedded image irrespective of
the
49 matches
Mail list logo