Contributed packages have copies of their vignettes on CRAN (in their
package page at /web/packages/).
Since base packages no longer have a page here, I can't find a web link to them.
I'm aware that I can find the vignette via browseVignettes() or
vignette("vignettename", package = "packagename")
> In order to do this I can use the relation between count and density, but
I
> would like to know if there is a way for me to predict it upfront.
In the code for hist.default, you'll see the line
dens <- counts/(n * diff(breaks))
> Here is an example:
>
> set.seed(242)
> LIST OF CONVENTIONS/STYLES FOR R:
>
> [1] R coding standards in the R Internals manual
> http://www.cran.r-project.org/doc/manuals/R-ints.html#R-coding-standards
>
> [2] Bioconductor coding standards
> http://wiki.fhcrc.org/bioc/Coding_Standards
>
> [3] Google R style
> [http://google-styleg
> > Does any body know how I can see the code behind qbeta function?
>
> As the code seems to be internal, you'll need to download the r-source
> code and find it in there. In my copy of R it is here:
> R-2.11.1/src/nmath/qbeta.c
An alternative is to view the source code online. The code for qbe
> x <- c(1, 2, 3)
> n <- 10
> ## so using the recycling rules, I would like to get from FUN(x, n)==1
> ## I am doing:
> xRecycled <- rep(x, length.out=n)[n]
>
> This works, but it seems to me that I am missing something really basic
here
> - is there more straightforward way of doing this?
x[n
> what do you mean by "%d-%b-%y". is it reading format or writing format.
"%d-%b-%y" is a date format - see the help page for strptime.
Example usage:
strptime("01-Jan-84", "%d-%b-%y")
strftime(Sys.time(), "%d-%b-%y")
Regards,
Richie.
Mathematical Sciences Unit
HSL
---
> I'm trying to draw the density function of a mixed normal distribution
> in the form of:
> .6*N(.4,.1)+ .4*N(.8,.1)
> At first I generate a random sample with size 200 by the below code:
> means = c(.4,.8)
> sds = sqrt(c(.1,.1))
> ind = sample(1:2, n, replace=TRUE, prob=c(.6,.4))
> x=rnorm(n,mean
the second step in my exercice is to calculate the sum of the amout for each
class et not the frequency
i have this vector
x y
1 100
2 1500
3 3250
4 6250
5 2000
6 450
i want to use the function table
> I would like to be able to plot histograms/densities on a semi-log or
> log-log scale.
> # Get a random log-normal distribution
> r <- rlnorm(1000)
>
> # Get the distribution without plotting it using tighter breaks
> h <- hist(r, plot=F, breaks=c(seq(0,max(r)+1, .1)))
>
> # Plot the distribu
> I'm new to R, and I've sent this message as a non-member, but since it's
> pretty urgent, I'm sending it again now I'm on the mailing list (Thanks
> Daniel for your suggestion nevertheless).
>
> I have calculated a regression in the form of M ~ D + O + S, and I would
> like to take this regressi
> Is there anyone know if BUGS language allows the combination of
> variables as response
> It seems doesn't work in my model. The problem is between two ##.
> > modelCompile(numChains=1)
> multiple definitions of node bm[1]
> ###
> bm[iter] <-
> I have an other problem, I have this vector signData with an alternation
of
> 1 and -1 that corrispond to the duration of two different percepts. I
> extracted the durations like this:
>
> signData<- scan("dataTR10.txt")
> dur<-rle(signData)$length
I think that last line should be
dur<-rle(si
> I have written a function in order to analyse gaze paths. It works
> with the test data but when I try to apply the function to a data
> frame that stores "the real data" in columns I receive the error
> message that the
>
> " In if (pp > 1) { :
> condition has length > 1 only the first el
> Is it possible to have variable driven csv file names? Such as:
>
> ds.name<-"bob.csv"
>
> write.table(
> distribution.data,
> file = "~//Documents/Research/Distribution Analysis/ds.name",
> sep = ",",
> col.names = FALSE,
> qmethod = "double")
Yes. You just nee
> I want to plot data such that the 3 time points(a,b,c) lie on the X-axis
and
> the values of these times points are on Y-axis for n samples (e.g.100).
>
> So, I have an object x, dim 100 4, it is a dataframe (when checked the
> class)
> x =
> name a b c
> 10.11 1.11 0.8
> I have a matrix of both negative and positive values that I would like
> to randomly sample with the following 2 conditions:
>
> 1. only sample positive values
> 2. once a cell in the matrix has been sampled the row and column of
> that cell cannot be sampled from again.
>
> #some dummy data
>
> I am interested in modeling hydrological extreme events. I found
> MSClaio2008 very interesting function. In this function four
> criterions for choosing distributions. Can we call these criterions
> as model selection techniques or goodness of fit techniques or both?
> Because goodness of fit
> I want to make a simple plot, here is my code:
http://gist.github.com/118550
> Unfortunately, the annotation of both the x- and y-axis are not correct,
as
> you can see in the following picture:
> http://www.nabble.com/file/p23739356/plot.png
> I am not an expert of R, so maybe someone can po
> this is the command i made for a normal distribution, but when i try to
plot
> the histograms, i dont know why the bars don't stick on the line...
>
> nsamples<-1000
> sampsize<-15
> Samples<-matrix(rnorm(nsamples*sampsize,0,1),nrow=nsamples)
> a<-apply(Samples,1,var)
> NC14<-a*14
> x<-0:40
>
> I am new to R. Yesterday I passed the afternoon reading the
> introduction and language reference, but I could'nt find a way to do a
> 3d plot of the density of a data table of size 2.
> I am trying with:
>
> plot(density(t(t2)))
>
> but it mixes the two columns and calculate the density like
>I am trying to parse XML file ( binary hex) but get an error.
> Code I am using is:
> xsd = xmlTreeParse(system.file("exampleData", "norel.xsd", package =
> "XML"), isSchema =TRUE) doc = xmlInternalTreeParse(system.
> file("exampleData", "LogCallSummary.bin", package = "XML")) Start
> tag ex
> One thing I find most frustrating about R is how difficult it is to use
> Google (or any other search tool) to look for answers to my R-related
> questions. With languages with even slightly more distinctive names
like
> Perl, Java, Python, Matlab, OCaml, etc., usually including the name of
th
> since some days I try to use the versions 2.35-4 of the survival
> package instead of versions 2.31, I had installed until now. Several
> changes in print.survfit, plot.survfit and seemingly in the structure
> of ratetabels effect some of my syntax files.
> Is there somewhere a documentation o
> I'm looking for algorithms that assist in spreading out crowded labels,
e.g.
> labels of points in a scatter plot, in order to obtain a nicer visual
> appearance and better legibility.
>
> I'm probably just stuck because I didn't find the right key words for a
> successful search on the R w
> When i want to do ANOSIM i get an NaN error message. What is wrong?
> > (lots of other code)
> > iwithin=rep(0,(N*(N-1)/2) )
> > r.w=sum(r*iwithin)/sum(iwithin)
iwithin is a vector of zeroes and so is its sum. r*iwithin is also a
vector of zeroes, and so is its sum. Thus r.w=sum(r*iwithin)/su
> I want generate R code to determine the real root of the polynomial
> x^3-2*x^2+3*x-5. Using an initial guess of 1 with Newton's method.
> Homework? - see your instructor! Otherwise, provide minimal
self-contained
> code and show us where you are stuck.
It gets a little suspicious when there
> I would like to have no ticks on a scale that represents a factor. The
> tick.number argument from scales does not work in such a situation, as
> the help page as well as this simple (fairly stupid) code show:
>
> require(lattice)
> fact<-gl(4,1,labels=LETTERS[1:4])
> y<-c(1,4,3,2)
> xyplot(y~fa
> As to hist,the help file says:" R's default with equi-spaced breaks
> (also the default) is to plot the counts in the cells defined by
breaks."
> I wanna know how the break is calculated by R?
>
> In other words: break = (max - min)/(number of group) but how the
> "number of group" is calcu
> I have a large data frame and I want to look at the distribution of
> each variable very quickly by plotting an individual histogram for
> each variable.
> I'd like to do so using lattice.
>
> Here is a small example using the iris data set:
>
> histogram(as.formula(paste("~",paste(colnames(i
> if i have the following function,
>
> f <- function(x) x^3-2*x^2+3*x-5
>
> i need a simple function for the derivative of this with respect to
> 'x', so that i can then sub in values to the the derivative
> function, and use Newtons method of finding a root for this.
You could take a look at
> I have some trouble with the number of decimals in R (currently R
> 2.9.0). For instance:
>
> > options()$digits
> [1] 3
>
> let me hope that I will get three digits where useful when a number is
> printed. BUT:
>
> > 44.25+31.1+50
> [1] 125
>
> No way to get the right result 125.35
>
>
It seems that the structure of your data is that you have two groups
("Real Bad Stuff" and "Other Crazy Things") which are then subdivided into
further categories. I'd be tempted to set your data up like this:
dfr <- data.frame(
score=c(23, 14, 17, 8, 43, 13),
group=rep(c("Real Bad Stuff"
> Can anyone tell me what is skip=2, skip =7
>From ?read.csv:
"skip: integer: the number of lines of the data file to skip before
beginning to read data."
> and %in% mean here?
%in% matches values; see ?'%in%', and example('%in%')
Regards,
Richie.
Mathematical Sciences Unit
HSL
--
> I have a graph with groups of variables. I have include the group
> names as variables so that I can have them positioned correctly.
> Unfortunately this means that the group names have to follow all of
> the same rules as the variables within the groups. I would rather
> have those group n
> fp is a data frame like this
>
> ,[ fp ]
> |Frequenz AmpNorm
> | 1 3322 0.0379490639
> | 2 3061 0.0476033058
> | 3 2833 0.0592954124
> | 4 2242 0.1275510204
> `
>
> i want to find the "Frequenz" where "AmpNorm" is max.
Use which.max.
fp <- data.frame(Freqe
> There are six assignments in total. It won't take you long if you were
> familiar with R. For those who are interested, please send me an email
> with your profile (your experience with R, how long and how often have
> you been using it.) I will be paying through paypal. Thanks!
Now see, you mad
> 1. How to plot several lines in a figure? Suppose I have several sets of
> points (xi,yi), where xi and yi are equal-length vector. plot(x1,y1)
will
> give a line connecting these points. Another plot(x2,y2) will erase what
> plot before and plot the new line. Can I have these lines all drawn in
> I?ve written a script to run several multivariate statistical analysis
> automatically.
> As one result a biplot and screeplot is produced.
> Now I?d like to display the name of the inputdatset as part of the title
of
> these graphics and I do not want to enter it each time I run the script.
> H
> Ive found out a way around my problem. I was trying to plaot a histogram
of
> strings, but I had to change it into integers. I ran an sql query on the
> original DB that I got the CSV file from and used COUNT to get the
number of
> each unique item in a given column. I then used these numbers t
> I am looking to create a pie chart from a given column in a .csv file.
>
> My class variables are as follows:
>
> entry_type, uniquekey, types, title,url, abstract, journal,
> author, month,
> year, howpublished
>
> So say I want to export a pie chart that groups together all entrie
> I have a following data
>
> AIS LEvel
> 1 23
> body regionA 10 15 20
> B 15 25 15
>
> Now I want to plot a barplot and in each bar (corresponding a body
re
> I hope that question will not be too redundant (sorry if it is) but
> i don't seem able to find the answer i need in the archives...
>
> I try to create a file which would have 1.several pages and 2.
> several plots by page. I know how to make a pdf file this way, but
> my problem is that the
> i have a problem with a function that i defined:
>
> the function needs to use a function which is defined outside the
function
> but
> i realised that this is not working. a friend told me that this must be
a
> problem with
> hidden parameters.
>
> a workaround works when i just define
> In general, how can I increase a vector of length m (< n) to length n
> by padding it with m - n missing values, without losing attributes?
> The two approaches I've tried, using length<- and adding missings with
> c, do not work in general:
>
> > a <- as.Date("2008-01-01")
> > c(a, NA)
> [1] "2
> > > geometric.mean1 <- function(x) prod(x)^(1/length(x))
> > > geometric.mean2 <- function(x) exp(mean(log(x)))
> > > geometric.mean1(c(-5,-4,4,5))
> > [1] 4.472136
> > > geometric.mean2(c(-5,-4,4,5))
> > [1] NaN
> > Warning message:
> > In log(x) : NaNs produced
> comp.x <- as.complex(c(-5,-4,4
> I have created two functions to compute geometric means. Method 1 can
> handle even number of negative values but not large number, vice versa
> for method 2. How can I merge both functions so that both large number
> and negative values can be handled ?
>
> > geometric.mean1 <- function(x) prod
> I have some data which needs to be plotted with lattice.
>
> library(lattice)
> cars <- c(0.1, 0.3, 0.6, 0.4, 0.9)
> trucks <- c(0.2, 0.5, 0.4, 0.5, 0.1)
> drivers<-c(121,145,167,200, 210)
> year<-c(2005,2006,2007,2008,2009)
> type<-c("local","local","foreign","foreign","foreign")
> xyplot(cars+
> Numbers like ``1239178547.653775" is inserted into a vector. I print
> the vector:
>
> > route_9_80_end
> [1] 1239178522 1239178526 1239178524 1239178524 1239178524
> 1239178523 1239178524 1239178522 1239178521 1239178565 1239178566
1239178566
> [13] 1239178565 1239178566 1239178566 123917856
> There seems to be a way for calling R from .net. However, is there anyway
> for calling .net/C# code from R? Something similar to the RJava package
for
> .net?
To the best of my knowledge, there isn't at the moment. The latest release
of MATLAB does though, so in the spirit of
lawnboy34 wrote:
>
> I am having trouble with the difference between default graphic settings
> on
> my client machine and the instance of R on our company's server. I created
> a
> script locally that output graphs, but when I run it on the server the
> output graphs have titles running past th
> I'm trying to write a loop to sum my data in the following way:
> (the second - the first) + (the third - the second) + (the fourth -
> the third) + ...
> for each column.
This is just sum(diff(x)), or even x[length(x)] - x[1].
Regards,
Richie.
Mathematical Sciences Unit
HSL
---
> Hi All,
>
>
> > act_2
> DateDtime Hour Min Second Rep
> 51 2006-02-22 14:52:18 14 52 18 useractivity_act
> 52 2006-02-22 14:52:18 14 52 18 4
> 55 2006-02-22 14:52:49 14 52 49 4
> 57 2006-02-22 14:52:51 14 52
> I generate graphs using both the grid system (with lattice) and the base
> system. I'd like to be able to identify these graphs later on with a bit
of
> identifying text (e.g. a date and some comments). Adding text to these
> graphs cannot be done using a common system if you want to save them a
> I have some time-series data and wish to plot a normal probability plot
in
> R. How do I go about this?
In R, they are known as quantile-quantile plots. Check out ?qqplot and
?qqnorm.
Regards,
Richie.
Mathematical Sciences Unit
HSL
-
> I am trying to excess the inbuit .Fortran and .C codes of R. Can any one
> help me in that. For example in kmeans clustering the algorithms are
written
> in .Fortran I want to access them and see the .Fortran syntax of the
codes.
> Can any one help me how can I do that?
Download the R source
> Using a simulation, I have to find what are the probabilities that,
> in a square region, the convex hull is a triangle, using the "chull"
> function. However, I have a hard time with the chull function, i
> did not see many examples in which the chull function is used. I
> searched a long t
> I have many files in my directory. I want to transfer each data into
> one which is readable.
> They have so many possibilities, i have collected(manually and
> visually) all possibilities and represent them as different numbers.
>
> Rep[grep('context_log',log1$Remain[1:length(log1$Date)]),]<-"
> > The best encoding depends upon which language you would like to
manipulate
> > the variable in. In R, genders are most naturally represented as
factors.
> > That means that in an external data source (like a spreadsheet of
data),
> > you should ideally have the gender recorded as human-
>can anyone tell me why an encoding of 1/2 for a dummy variable for
>two groups (e.g. gender) seems to be preferred over 0/1?
>It's been bugging me for a while, 0/1 seems more natural, but I have
>been told (without explanation) that 1/2 is better. Why?
The best encoding depends up
> Does any student, or teacher for that matter care whether Newton or
Leibntiz
> invented calculas.
Students or teachers may not care, but Newton and Leibniz themselves were
pretty bitter about who should get credit for what.
http://en.wikipedia.org/wiki/Newton_v._Leibniz_calculus_controversy
I
> Does R have a graphic command equivalent of MatLab Hold On ?
> I am trying to sabve on a pdf file a composite drawing. I first
> declare the canvas size, then I define the layout, finally I
> generate the 4 plots according to layout order. Eventually I close
> the pdf file (dev.off()).
> The r
> I do have a data set with some missing values that appear as blanks. I
want
> to fill these blanks with an NA. How can this be done? Thanks for your
help
Please help us to help you. What form are the data in? Are they in a
text file, or are they in R already? What do you mean by 'blanks'?
> I created the graph at the bottom using xyplot in the lattice package. I
> added a title using the main="Title" command in xyplot, however it is
> plotted too close to the legend for my liking. To remedy this I
increased
> the upper margin of the plot using plot(data, position = c(0,0,1,.9))
> I am having some problems using R with WinBUGS using the R2WinBUGS
> package. Specifically, when I try to run bugs() I get the following
> message.
>
> Error in FUN(X[[1L]], ...) :
> .C(..): 'type' must be "real" for this format
> >
>
> To give a little more context, my bugs() command (for
> Please consider the following "toy" data matrix example, called "x"
> for simplicity. There are 20 different individuals ("ID"), with
> information about the alleles (A,T, G, C) at six different loci
> ("Locus1" - "Locus6") for each of these 20 individuals. At any
> single locus (e.g., "Loc
> I will use the lca method in the e1071 package. But I get the following
error:
> Error in pas[j, ] <- drop(exp(rep(1, nvar) %*% log(mp))) :
> number of items to replace is not a multiple of replacement length
>
> Does anybody know this error and knows what this means?
The error means that yo
Apologies if this isn't acceptable for the general help list.
I'm running OpenBUGS model via the R2WinBUGS package interface, under
Windows. Is it possible to terminate running models, short of using the
Windows Task Manager to forcibly exit the program?
Regards,
Richie.
Mathematical Sciences
Is it possible to save plots as byte streams? For example, if I want the
bytes for a PNG plot, I could use
#Write the plot to a PNG file
png("test.png")
plot(1:10)
dev.off()
#Read the bytes back in from the file
plotbytes <- readBin("test.png", "raw", n=2000)
Ideally, I'd like to avoid having
> I'm heaving difficulties with a dataset containing gene names and
positions
> of those genes.
> Not such a big problem, but each gene has multiple exons so it's hard to
say
> where de gene starts and where it ends. I want the starting and ending
> position of each gene in my dataset.
> Attached
Hopefully an easy question. When drawing a rectangles in a lattice plot
key, how do you omit the black borders?
Here is an example adapted from one on the xyplot help page:
bar.cols <- c("red", "blue")
key.list <- list(
space="top",
rectangles=list(col=bar.cols),
text=list(c("foo", "ba
> I'm trying to estimate a tobit model with survrec function. I use
> the following code :
> reg<-survreg(Surv(crs_prod,crs_prod<=1)~SOLVA+log(AF088)
> +HHI+ACTIONNA,data=dat,dist="gaussian")
>
> I get this error message with R 2.7.2
> Error in survreg(Surv(crs_prod, crs_prod <= 1) ~ SOLVA + l
> I have a question concerning the use of lattice plots within for-loops.
> I want to create a png file containing a lattice histogram which works
out
> fine (part 1).
> When I loop the whole code, the graphic file does not contain anything
(part
> 2).
> I can fix it by wrapping the histogram fu
> I am using sink() to send the results of my analyses to a text file.
> Unfortunately my graphs do not become part of the file. Is there
> anyway that I can have both the text and graphic output of my
> analyses appear in a file?
You can create a latex document with text, graphs and R-code usin
> I hope this question is not too stupid. I would like to know how to
update
> levels after subsetting data from a data.frame.
>
> df <- data.frame(factor(c("a","a","c","b","b")), c(4,5,6,7,8),
c(9,1,2,3,4))
> names(df) <- c("X1","X2","X3")
>
> my.sub <- subset(df, X1 == "a" | X1 == "b")
> lev
> layout(matrix(c(1,2,3,4), nrow = 2, byrow = TRUE))
> plot(rnorm(100))
> plot(rnorm(200))
> plot(rnorm(300))
> plot(rnorm(400))
>
> Now, I'd like to create a legend below each plot and generate a common
title.
> How can I do that?
If you are laying plots out in grids like this then lattice grap
> a. Write a R function zerdiag.v1(m) using loop to output a square matrix
> whose diagonal elements are zero and the other elements are filled in by
> consecutive integers from 1 to m row-wise.
>
> For example,
> zerdiag.v1(6) = [0, 1, 2]
> [3, 0, 4]
>
> I have an unkown number of vectors (>=2) all of the same length. Out
> of these, I want to construct a new one as follows:
> having vectors u,v and w, the resulting vector z should have entries:
> z[1] = u[1], z[2] = v[1], z[3] = w[1]
> z[4] = u[2], z[5] = v[2], z[6] = w[2]
> ...
> i.e. go throug
> I wish to have inward-pointing ticks on my contourplot graph, but the
> colored background produced by the "region=TRUE" statement covers the
> ticks up, is there any way around this? Sample code below. --Seth
>
> library(lattice)
>
> model <- function(a,b,c,d,e, f, X1,X2) # provide
> i am looking from some insights to define own R functions. so far i
> found most basics in documentations that are around on the web. except
> for one thing:
>
> I´d like to define some function, say:
>
> #assume my data matrix contains vectors like data$myColumn1,data
> $myColumn2 etc.
Do
> Thanks, that's almost exactly what I need...theres just a slight
> difference with my requirement, in that I am looking for the actual
> index value in the alphabetical sequence, so that instead of:
>
> as.numeric(factor(unlist(strsplit("XYZ",""
> [1] 1 2 3
>
> I would expect to see
>
>
pzs wrote:
>
> Several people have suggested that I just pick up R and give it a try.
> My reluctance to do this is that I am already very familiar with my
> current working method (Python + Numpy) and I worry that without a
> course I will work in a Python-centric way, which won't be optimal
> I have some data measured with a coarsely-quantized clock. Let's say
> the real data are
>
> q<- sort(rexp(100,.5))
>
> The quantized form is floor(q), so a simple quantile plot of one
> against the other can be calculated using:
>
> plot(q,type="l"); points(floor(q),col="red")
>
> Here I have a folder with more than 50 tab-delimited files. Each
> file has a few hundreds of thousands rows/subjects, and the number
> of columns/variables of each file varies.The 1st row consists of all
> the variable names.
>
> Now I would like to merge all the files into one tab-delimited
> I figured it out. In case anyone else ever has this question -- given
the
> following output from cenmle:
>
> >fit.cen <- cenmle(obs, censored, groups)
> > fit.cen
>Value Std. Errorz p
> (Intercept) 1.19473 0.0772 15.4695 5.58e-54
> groups1 0.00208
> I’m using barplot function. I pretend to create a horizontal barplot
with
> two different information (side by side) for a species list. Well I can
> generate the graph easily, but the problem is that the labels with the
> species names are cut by device window!! I’ve tried lots of par
function
> the example below does not work. (i know it's not supposed, but it makes
it
> clear what i'm trying to achieve)
>
> par(mfrow=c(2,1))
> xyplot(y~x2|x1,data=dataframe1,pch=20)
> xyplot(y~x2|x1,data=dataframe2,pch=20)
>
> i know i could probably merge the two datasets and do something like
> xyp
> >> It works, but the for (i in ...) loop slows down the simulation a
lot.
> >>
> >> Any suggestion on how to avoid this loop? (or in general, to speed up
> >> this part of the simulation)
> Actually, I have not specified the following: i want to consider only
> the "most recent" sequence of
> > The row names on a data frame should be unique. You can try
> > as.data.frame(xx, row.names=FALSE) to convert zz to be a data frame.
If
> > you need the row name information, add it as a column in the data
frame,
> > e.g. mydataframe$rnames <- rownames(zz). (Note to R-Core: the
> > document
> I have a matrix x with repeating row names.
> zz<-matrix(0,4,4)
>
> rownames(zz)=c("a","a","b","b")
>
> data.frame(zz) (?)
The row names on a data frame should be unique. You can try
as.data.frame(xx, row.names=FALSE) to convert zz to be a data frame. If
you need the row name information
I'm presumably missing something very obvious, but how does one use the
key.opts argument in labcurve (via Ecdf)?
In this example, I want the key to be big and have a blue background, but
it isn't and doesn't.
ch <- rnorm(1000, 200, 40)
sex <- factor(sample(c('female','male'), 1000, TRUE))
Ecdf
> I played around with your suggestions to change the appearance of my
graph,
> but there is still a problem I could not fix.
> The vector, which I want to plot, contains 60 entries. After 3 bars I
want
> to have a large gap
> between the next 3 bars. But what always happens is, that R took at th
> I am building a hierarchical model on a large data set. It can take
quite
> some time to finish one fit, I was just wondering whether it is possible
to
> store the fit object (the result) to a file for later (offline)
analysis.
See ?save.
Regards,
Richie.
Mathematical Sciences Unit
HSL
--
Frank said:
> > This piece of code works, but it is very slow. We were wondering if
it's
> at
> > all possible to somehow vectorize this function. Any help would be
> greatly
> > appreciated.
Richie said:
> You can save a substantial time by calling as.matrix before the loop
Patrick said:
> On
> I've sent this question 2 days ago and got response from Sarah. Thanks
for
> that. But unfortunately, it did not really solve our problem. The main
issue
> is that we want to use our own (manipulated) covariance matrix in the
> calculation of the mahalanobis distance. Does anyone know how to
v
Michael Just wrote:
>
> Hello,
> I am trying to export the results from symnum() while maintain their
> readability. I tried using sink to text file and also copying and pasting
> but the results end up looking like this:
>
>> symnum(c5.s)
> bC bED bEN bLP bLS bPA bPD bPR p
> bbConta
k.ponting wrote:
>
> Hello all.
>
> Trying to use transparency for overlaid "histogram" plots I have come
> across an interesting inconsistency, possibly a bug when running under
> Windows. Originally noticed in R 2.7.1, it is still there in 2.8.0 beta.
>
> library(lattice)
> zz <- function(n
> with the "space" parameter it is possible to change the gap / distance
> between the bars, but is it also
> possible to change the "space" after each 6th bar?
> So for example you have bars from 1 to 6 then a large gap and then the
next
> six bars from 7 to 12
Try, for example
y <- runif(13)
y
> I am looking at the Braun/Murdoch book, " A First Course in
> Statistical Programming in R", and I have a question about a function
> there. It's on page 52, Example 4.5; the sieve of Erastosthenes.
>
> There is a line:
> primes <- c()
>
> Is there a difference between using that and
> primes
> > I have several datasets, all left-truncated at x=1, that I am
attempting
> > to fit distributions to (lognormal, weibull and exponential). I had
> > been using fitdistr in the MASS package as follows:
> A possible solution is to use the survreg() in the survival package
> without specifying
> True, I made a mistake here. Still, I have problems to visualize my data
(not
> the example code I used). I just see a flat line instead a proper
plot...
>
> Another example code with creating a strange plot:
>
> x <- rnorm(100) + 100
> maxval <- max(x)
> boxplot(x, notch=TRUE, xlim = c(0,ma
1 - 100 of 244 matches
Mail list logo