similar to: Filling matrix elements with a function

Displaying 20 results from an estimated 9000 matches similar to: "Filling matrix elements with a function"

2013 Mar 13
1
saving vector output as numeric
Hi everybody, I'm trying to create a numerical data frame on which to perform PRCC. So far I have created a data frame that consists of function/vector output that displays in numerical form, but when I try and run PRCC (from epiR package) I get the following error message: "Error in solve.default(C) : Lapack routine dgesv: system is exactly singular" It appears this is because
2012 Jan 08
0
Adding a migration element to a deterministic spatial model
Hi all, I've been working with a friend's model that is a spatial model consisting of 4 patches. She uses the code found below to add migration between the patches for the three species of concern. When I run a script incorporating this code, all four patches run independently without migration occuring. When I type m1[1,2] into the workspace to see if it will return a figure, it returns,
2013 Feb 19
1
latin hypercube sampling
Hi all, I am attempting to use latin hypercube sampling to sample different variable functions in a series of simultaneous differential equations. There is very little code online about lhs or clhs, so from different other help threads I have seen, it seems I need to create a probability density function for each variable function, and then use latin hypercube sampling on this pdf. So far, I
2013 Mar 14
0
Error with epiR and sensitivity
Hi everyone, I emailed yesterday thinking I had a problem with reading matrix information as numerical output into epiR. After working on the data frame today, I realise it's a problem with the data itself rather than the syntax. An original data frame of min max T1 1.500000e+01 3.999954e+01 SE1 0.000000e+00 1.000000e+00 PRE
2005 Jun 22
2
r programming help
Dear list, Is there anyway i can make the following formula short by r-programming? CYCLE.n<-c(NA, WET[1]*DRY[1], WET[1]*DRY[2]+WET[2]*DRY[1], WET[1]*DRY[3]+WET[2]*DRY[2]+WET[3]*DRY[1], WET[1]*DRY[4]+WET[2]*DRY[3]+WET[3]*DRY[2]+WET[4]*DRY[1], WET[1]*DRY[5]+WET[2]*DRY[4]+WET[3]*DRY[3]+WET[4]*DRY[2]+WET[5]*DRY[1],
2009 Jul 21
2
Split plot analysis problems
Hello, I would be very grateful if someone could give me a hand with my split plot design problems. So here is my design : I am studying the crossed-effects of water (wet/dry) and mowing (mowed/not-mowed = nm) on plant height (PH) within 2 types of plant communities (Xerobromion and Mesobromion) : - Within each type of communities, I have localised 4 blocks - In each block, I have defined
2009 Mar 25
1
Requesting help with lattice again
Hello, this is a request for assistance that I submitted earlier, this time with the dataset. My mistake for taking up bandwidth. I've also rephrased the question to address an additional concern. I'm working on a windows XP machine with R 2.8.1 1). I'd like a barchart (or other lattice type display) HSI ~ of the three factors (Region, Scenario and HydroState). However
2003 Aug 13
1
means comparison with seasonal time series?
Dear R list, I have a sequence of weekly observations of number of adults and larvae in various size classes from a butterfly population living in a subtropical area with pronounced wet and dry seasons. Wet and dry seasons are each defined 26 weeks long with fixed start and end dates. The data span 103 weeks (two seasons each of wet and dry) with some missing weeks. What I would like to do is
2007 Jul 05
1
cor() and cor.test() (PR#9781)
Hello, I am trying to make a correlation matrix in R using cor() and also to get the p-value for each correlation using cor.test(). I can't get these commands to work. I'm getting errors like the following: cor(Pollution, Wet.days) Error in inherits(x, "data.frame") : Object "Wet.days" not found cor("Pollution", "Wet.days") Error in
2012 Jan 26
1
lattice panels with grouped extra data as text?
I have a problem with including extra data in a lattice graphic. I am trying to put some calculated values in an extra column of a boxplot. A minimal example should show what I am trying to do: foo <- data.frame( Treatment=rnorm(1:12,2),
2002 Mar 25
2
Extreme value distributions (Long.)
This may not actually be an R/Splus problem, but it started off that way ..... ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== Executive summary: ================== Simulations involving extreme value distributions seem to ``work'' when the underlying distribution is exponential(1) or exponential(2) == chi-squared_2, but NOT when the underlying distribution is
2012 Sep 25
1
REML - quasipoisson
hi I'm puzzled as to the relation between the REML score computed by gam and the formula (4) on p.4 here: http://opus.bath.ac.uk/22707/1/Wood_JRSSB_2011_73_1_3.pdf I'm ok with this for poisson, or for quasipoisson when phi=1. However, when phi differs from 1, I'm stuck. #simulate some data library(mgcv) set.seed(1) x1<-runif(500) x2<-rnorm(500)
2007 Feb 11
3
merge words=data name
I would like to merge two parts of words to get a name of the data. First M3$N (invariable) and second is a number from 0001 to 3003 - M3$N0001,M3$N0002,...,M3$N3003. For example if I do it like this: my.data <- paste("M3$N",2456,sep="") I get > my.data [1] "M3$N2456" But I want to get something equivalent to my.data<- M3$N2456 Is there any way to do it?
2009 Aug 17
1
[Fwd: Re: R code to reproduce (while studying) Bates & Watts 1988]]]
Kevin Wright wrote: > library(nlme) > m2 <- gnls(conc ~ t1*(1-t2*exp(-k*time)), > data = df.Chloride, > start = list( > t1 = 35, > t2 = 0.91, > k = 0.22)) So my error was to use nls instead that gnls. Thanks a lot, Kevin. > summary(m2) > plot(m2) > lag.plot(resid(m2), do.lines=FALSE) >
2006 Nov 05
1
diag()<- in Matrix?
Dear all, I am trying to use the Matrix package to do some calculations on rather large and sparse matrices. An example of such a matrix is given below. mig<-0.2 side<-10 np<-side^2 mig.mat<-matrix(0,np,np) diag(mig.mat[1:(np-side),(side+1):np])<-mig/4 diag(mig.mat[(side+1):np,1:(np-side)])<-mig/4 diag(mig.mat[-np,-1])<-mig/4
2003 Jul 31
2
how as.numeric() !-> factor
Dear all, I have divided two vectors: Np.occup97.98<- as.data.frame(cbind(site = levels(sums$site), Np.occup97.98 = sums$Ant.Nptrad97.98/Ant.trad$Ant.trad97.98)) > Np.occup97.98 site Np.occup97.98 1 erken97 0.342592592592593 2 erken98 0.333333333333333 3 rormyran 0.48471615720524 4 valkror 0.286026200873362 However, at a later stage of the analysis I want >
2011 Dec 03
1
partial mantel tests in ecodist with intential NA values.
I would like to perform partial mantel tests on only within group values, with "between group" values assigned to NA. This is possible in package ncf partial.mantel.test, however this sues a different permutation to that used in ecodist.ecodist will not accept data with NA values, returning a "matrix is not square error. is it possible to perform this test in ecodist? many thanks
2007 Jul 26
3
substituting dots in the names of the columns (sub, gsub, regexpr)
Dear R users, I have the following two problems, related to the function sub, grep, regexpr and similia. The header of the file(s) I have to import is like this. c("y (m)", "BD (g/cm3)", "PR (Mpa)", "Ks (m/s)", "SP g./g.", "P (m3/m3)", "theta1 (g/g)", "theta2 (g/g)", "AWC (g/g)") To get rid of spaces and
2008 Feb 04
1
strftime fails on POSIXct objects (PR#10695)
R 2.6.1 on a Thinkpad T60 running up-to-date Gentoo: Despite the documentation, which says: 'strftime' is an alias for 'format.POSIXlt', and 'format.POSIXct' first converts to class '"POSIXlt"' by calling 'as.POSIXlt'. Note that only that conversion depends on the time zone. strftime fails on POSIXct objects: > foo <-
2011 Mar 08
1
SEM error
Dear All, I am new for R and SEM. I try to fit the model with Y (ordinal outcome), X (4 categorical data), M1-M3 (continuous), and 2 covariates (Age&sex) as a diagram. library(polycor) model.ly <-specify.model() 1: x -> m1, gam11, NA 2: x -> m2, gam12, NA 3: x -> m3, gam13, NA 4: age -> m1, gam14, NA 5: age -> m2, gam15, NA 6: age -> m3, gam16, NA 7: sex -> m1,