Displaying 20 results from an estimated 1000 matches similar to: "control axis"
2006 Sep 11
1
graphics: y limit on xyplot
I would like to set the y axis limit of an xyplot using the object 'ylimit',
but receive this error:
[1] 990
Error in extend.limits(limitlist[[i]], axs = axs) :
   improper length of lim
I get the same error if I use ylim.
library(lattice)
trellis.device(col = FALSE, theme = lattice.getOption("col.whitebg"))
name <- "Variable name"
symbols <-
2006 Sep 07
3
graphics - joining repeated measures with a line
I would like to join repeated measures for patients across two visits using
a line. The program below uses symbols to represent each patient. Basically,
I would like to join each pair of symbols.
library(lattice)
patient <- c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9)
var <-
c(826,119,168,90,572,323,122,10,42,900,250,180,120,650,400,130,12,33)
visit <- c(1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2)
2006 Oct 26
3
Read.csv
Are there ways to load a csv file without row.names by read.csv? Thanks.
	[[alternative HTML version deleted]]
2006 Oct 25
1
density plot text
Is there any way of adding text to a density plot? I have had a go using the
text() function but I think the error is because this function doesn't work
with densityplot().
Alternatively, I understand I can achieve pretty much the same result if I
plot a density kernel estimate using plot() (which allows text()), but I do
prefer densityplot().
Also, is it possible to specify the dimensions
2007 Jul 23
1
maths characters in labels & ylab padding
I have checked out the help files, but cannot find details on how to use
maths characters in ylab. Instead of m^2, I would like the 2 in superscript,
if possible. I would also like to place more padding on the label so that
the label is not obscured by the horizontal numbers.
y <- 1:10
x <- rnorm(10,50000,2000)
plot(x ~ y,
    ylab = 'Y Label (m^2)',
    las = 1,
    type =
2007 Oct 10
1
global object in user defined function
I need an object created in a user defined function to be accessible to
another user defined function. I am fairly certain the object is correctly
created as it prints when I use the return() function, however the 2nd
function seems unable to use it.
I am guessing objects created in functions are not globally accessible, is
this correct?
What is an appropriate way to pass the object to the
2006 Nov 17
2
s.e. on interaction plots
Is it possible to add standard error bars to the means on interaction plots?
Thanks
Murray
-- 
Murray Pung
Statistician, Datapharm Australia Pty Ltd
0404 273 283
	[[alternative HTML version deleted]]
2007 May 31
1
cox goodness of fit
Is there an implementation of the Cox-Snell residuals / Nelson-Aalen plot
for goodness of fit?
Or otherwise is there an appropriate Goodness of Fit diagnostic?
Thanks
Murray
-- 
Murray Pung
Statistician, Datapharm Australia Pty Ltd
0404 273 283
	[[alternative HTML version deleted]]
2007 May 15
1
differentiate groups on barplot
To differentiate between groups on the barplot, I guessed that col =
colr[test$group] would have worked. How can I do this?
Many Thanks
Murray
test <-
structure(list(patient = 1:20, score = c(100, 95, 80, 75,
64, 43, 42, 40, 37, 35, 30, 29, 27, 26, 23, 22, 19,
18, 17, 16), group = c(1, 0, 1, 0, 1, 0, 1, 0, 1,
0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0)), .Names = c("patient",
2007 May 16
2
log rank test p value
How can I get the Log - Rank p value to be output?
The chi square value can be output, so I was thinking if I can also have the
degrees of freedom output I could generate the p value, but can't see how to
find df either.
> (survtest <- survdiff(Surv(time, cens) ~ group, data = surv,rho=0))
Call:
survdiff(formula = Surv(time, cens) ~ group, data = surv, rho = 0)
         N Observed
2006 Nov 27
1
x axis on sciplot
Is it possible to format the x axis, so that days are spaced
proportionately?
i.e. a larger space between 50 & 100, than 0 and 5?
Have not had any luck with axis.POSIXct().
Many thanks
Murray
try <-
structure(list(visit = structure(as.integer(c(1, 2, 3, 4, 5,
1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1,
2, 3, 4, 5)), .Label = c("Screening", "0",
2007 May 30
3
sizing and saving graphics in R
Dear R wizards,
I am seeking advice on graphics in R.  Specifically, how to manipulate  
the size and save a plot I have produced using the LDheatmap library.   
I confess I am relatively new to graphics in R, but I would greatly  
appreciate any suggestions you may have.
LDheatmap produces a coloured triangular matrix of pairwise  
associations between 600 genetic markers in my dataset. 
2007 Apr 12
3
Random Sequence
Dear Friends,
I'm trying to generate a sequence of 100 observations
with either a 1 or -1. In other words the sequence
should look something like this.
y = 1 1 -1 1 -1 -1 -1 1 1 ......
Can somebody please give me some direction on how I
can do this in R.
Thanks
Anup
       
____________________________________________________________________________________
Don't get soaked.  Take a
2007 Apr 18
2
Data Manipulation using R
Dear Friends,
I have data set with around 220,000 rows and 17 columns. One of the columns is an id variable which is grouped from 1000 through 9000. I need to perform the following operations. 
1) Remove all the observations with id's between 6000 and 6999
I tried using this method. 
remdat1 <- subset(data, ID<6000)
remdat2 <- subset(data, ID>=7000)
donedat <- rbind(remdat1,
2007 Jul 06
1
row index
Dear Friends,
Suppose I have a vector as follows
RI  Value
1     10
2     11
3      8
4      4
6     12
I would like a function which returns the"row index number" for the minimum value of VALUE. Can somebody please give me some direction on how I can do this. In effect I'm trying to find a comparable function for the GAUSS command "minindc"
>From the GAUSS Manual
2007 Jul 24
1
Passing equations as arguments
Friends,
I'm trying to pass an equation as an argument to a function. The idea is as follows. Let us say i write an independent function 
Ideal Situation:
ifunc <- function(x)
{
return((x*x)-2)
}
mainfunc <- function(a,b)
{
evala <- ifunc(a)
evalb <- ifunc(b)
if (evala>evalb){return(evala)}
else
return(evalb)
}
Now I want to try and write this entire program in a single
2007 Sep 08
1
Problem with the aggregate command
Dear friends,
I have a data set with 23 columns and 38000 rows. It is a panel running from the years 1991 through 2005. I want to aggregate the data and get the medians of each of the 23 columns for each of the years. In other words my output should be like this
Year     Median
1991        123
1992        145
1993        132
etc.
The sample lines of code to do this operation is
set1 <-
2007 Aug 19
1
Creating a data set within a function
Dear Friends,
I'm trying to find if there is a way to automate creation of the design matrix. Suppose we are interested in say running an autoregressive model. The user inputs the following data
myfunAR <- function(y, order)
{.....
......
}
now here y is the data series and order represents the level of the process. In other words if order=2 then we have an AR (2) process. Now it is easy
2007 Jun 04
1
Help with conditional lagging of data
Dear Friends,
I have some data with three columns named ID, Year and Measure X. I need to create a column which gives me a lag for each ID (note not a continous lag), but a lag conditional on the id and the given year. Please find below a sample of the data
Input file sample
ID     Year     X
AB12   2000    100
AB12   2001    120
AB12   2002    140
AB12   2003    80
BL14   2000    180
BL14  
2010 Dec 07
1
Help on loops
Dear R-helpers,
I have a basic question on using loops. 
I have a panel data set with different variables measured for "n" firms over "t" time periods. A snapshot of the data is given below
id    t    X1    X2
1    1     4    3
1    2    9    2
1    3    7    3
1    4    6    6
2    1    6    4
2    2    5    3
2    3    1    1
3    1    9    6
3    2    5    5
thus total