Displaying 20 results from an estimated 10000 matches similar to: "R function writing question"
2000 Oct 06
1
Formulae with factors that have missing values
Hi All,
I have a formula which has a factor with NAs in it. I wish to keep
these in the model matrix, but the NA information is currently lost (the
rows are kept but the NA gets converted to 0). Any ideas as to how
I can keep NAs in?
e.g.
junk <-
2000 Nov 08
3
R for windows read.table()
Just wondering if there was a reason why when I use the read.table() command the R console window shrinks in size?
--------------------------------------------------------------------------------
Rachel Merriman
Department of Statistics
University of Auckland
(wk) 373 7599 x 8797
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2012 Mar 23
3
Using MuMIn - error message
Hello,
I hope that you can bare with me. I am new to models, but I think I have a
pretty godd understanding of how to run them now, including how to use AICc
and Anova. The issue is that I have many factors that I wish to compare so
doing each one at a time would take forever.
I came across the MuMIn package and I was so excited, however I am getting
an error message and i don't know why.
2012 Mar 27
1
two lmer questions - formula with related variables and output interpretation
Hello,
I have been attempting to set up a lme and have looked at numerous posts
including 'R's lmer cheat-sheet' as well as reading a number of papers and
other resources including R help, but I am still a little confused on how to
write my model (I thought I had it).
I have asked a number of questions on different forums; most of which have
been resolved.
My main concern right now
2001 Aug 12
1
Creating a Model Matrix - keeping NAs
I am wanting to create a model matrix and keep the NAs.
stratmat <- model.matrix(myformula,mydata)
Is there any way to do this? model.matrix doesn't have na.action as a
parameter. Elsewhere I have made use of na.keep <- function(x){x}.
Many thanks,
Rachel Cunliffe
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2006 Jan 25
16
Slideshow beta
Ok,
I finally got the slideshow code to a state worth showing it
off. The site is a very rough cut of a site I''m building for my wife''s
photography, so ignore the unfinished design for now :)
http://rachel.kathihill.com/
To see the ajax version, go to:
http://rachel.kathihill.com/?ajax=1
To randomize the order the images show:
http://rachel.kathihill.com/?random=1
To change
2023 Jul 06
1
Plotting factors in graph panel
Hi John:
Thanks! Below is the data using your suggestion. I used "ggplot" to make a
graph. I am not too happy with it. I am looking for something simpler and
cleaner. Plot is attached.
I also tried "lattice" package, but nothing got plotted with "xyplot"
command, because it is looking for a numeric variable on x-axis.
ggplot(TrialData4, aes(x=Income, y=Percent,
2023 Jul 06
1
Plotting factors in graph panel
Btw, I think "lattice" graphics will provide a better solution than
"ggplot", because it puts appropriate (space saving) markers on the axes
and does axes labels well. However, I cannot figure out how to do it in
"lattice".
On Thu, 6 Jul 2023 at 15:11, Anupam Tyagi <anuptyagi at gmail.com> wrote:
> Hi John:
>
> Thanks! Below is the data using your
2023 Jul 06
2
Plotting factors in graph panel
On Thu, 6 Jul 2023 at 15:21, Anupam Tyagi <anuptyagi at gmail.com> wrote:
>
> Btw, I think "lattice" graphics will provide a better solution than
> "ggplot", because it puts appropriate (space saving) markers on the axes
> and does axes labels well. However, I cannot figure out how to do it in
> "lattice".
You will need to convert Income to a
2023 Jul 07
1
Plotting factors in graph panel
Hallo Anupam
I do not see much difference in ggplot or lattice, they seems to me provide almost identical results when removing theme part from ggplot.
library(ggplot2)
library(lattice)
ggplot(TrialData4, aes(x=Income, y=Percent, group=Measure)) + geom_point() +
geom_line() + facet_wrap(~Measure)
xyplot(Percent ~ Income | Measure, TrialData4,
type = "o", pch = 16, as.table =
2023 Jul 07
1
Plotting factors in graph panel
Thanks! You are correct, the graphs look very similar, except ggplot is
scaling the text font to make it more readable. Is there a way to scale
down the x-axis labels, so they are readable?
On Fri, 7 Jul 2023 at 12:02, PIKAL Petr <petr.pikal at precheza.cz> wrote:
> Hallo Anupam
>
> I do not see much difference in ggplot or lattice, they seems to me
> provide almost identical
2009 Nov 13
2
help sample from large dataset - misleading error?
Hi All,
I want to take a simple random sample from a large dataset, gly, but I'm
getting an error message. Any help?
dim(gly)
[1] 112371 37
> s1 <- sample(gly,100)
Error in `[.data.frame`(x, .Internal(sample(length(x), size, replace, :
cannot take a sample larger than the population when 'replace = FALSE'
Thanks,
Rachel
[[alternative HTML version
2023 Jun 29
1
Plotting factors in graph panel
Anupa,
I think your best bet with your data would be to tidy it up in Excel, read
it into R using something like the readxl package and then supply some
sample data is the dput() function.
In the case of a large dataset something like dput(head(mydata, 100))
should supply the data we need. Just do dput(mydata) where *mydata* is your
data. Copy the output and paste it here.
On Thu, 29 Jun 2023
2006 Jun 04
2
Can anyone help?
Quick question please....A user logs into windowsXP and tries to create a folder/document and the ownership on the new file/folder defaults to nobody:nobody. I have the user set up in samba on the IRIX machine. All other users have no problem. Anyone have any suggestions?
Thanks
Rachel
2009 Jul 09
3
Stratified data summaries
Hi All,
I'm trying to automate a data summary using summary or describe from the
HMisc package. I want to stratify my data set by patient_type. I was
hoping to do something like:
Describe(myDataFrame ~ patient_type)
I can create data subsets and run the describe function one at a time,
but there's got to be a better way. Any suggestions?
Rachel
[[alternative HTML
2001 Aug 09
2
Pulling columns out of a data.frame
Hi there
Probably a very simple solution to this problem.
I have a character vector eg c("name1","name2","name3") and I want to pull
out these columns from a data.frame, converting each of these columns into
factors also.
Many thanks
Rachel
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2009 Apr 28
3
creating a vector of sums
Hi,
I am trying to create a function for a goodness-of-fit test for the Pareto Distribution for some loss data that I have.
So far I have the following:
function(X=OTOL)
{
n <- length(X)-1 #calculated the number of values (extra as 0 included)
i <- 2:640 #values of i
j <- 1:639 #values of i-1
Y <- (n-j+1)*((X[i])-(X[j])) #First part of GoF model
Y
}
Where OTOL is the ordered loss
2010 Jun 22
1
subset dataset using factor levels instead of factor names
Hi All,
I have a factor variable with 52 levels -with long, annoying names. I want to keep only rows with some variables. I can do this using this code:
test1 <- subset(nih2009,ic_name %in% c('NATIONAL EYE INSTITUTE','Veterans Affairs'))
dim(test1)
[1] 2396 38
But this doesn't work:
t1 <- subset(nih2009, ic_name %in% c(27,51))
dim(t1)
[1] 0 38
I know
2005 Sep 19
2
Problem with tick marks in lines.survfit (package survival)
I have attempted to follow posting guidelines but I have failed to find out
what I am doing wrong here.
I am trying to use lines.survfit to plot a second curve onto a survival
curve produced by plot.survfit. In my case this is to be a progression free
survival curve superimposed upon an overall survival curve, but I will
illustrate my problem using the example given in the help for
2005 Oct 12
1
Windows XP client changes not being saved via Samba
[global]
workgroup = IIG
netbios name = TUX
server string = Samba Server
interfaces = 192.168.0.10/24
update encrypted = Yes
logon path = \\TUX\profile\%u
logon drive = H:
domain logons = Yes
os level = 65
preferred master = Yes
domain master = Yes
wins server = 127.0.0.1
wins support = Yes