similar to: writing spdiags function for R

Displaying 20 results from an estimated 1100 matches similar to: "writing spdiags function for R"

2007 Feb 26
1
2 data frames - list in one out put , matrix in another ??
I have two more or less parallel dataframes that are giving me different results on one subset of variables. I know that I assembled the 2 dataframes slightly differently but I don't see why I am getting this result because one set of variables are labelled and the other is not. Variable names are the same, etc. as far as I can acertain. The only diffference seems to be that bdata variables
2011 Feb 25
1
Accessing sub diagonals / spdiag in R ?
Hello, I'm attempting to access a specific number of sub diagonals in a MATRIX and have been accustomed to using spdiags in MATLAB or Octave. I've got a solution pieced together using for loops and it works though isn't vectorized and liable to run very slow for large matrices. As an example: A = 1 2 3 4 5 9 8 7 6 5 4 5 6 7 8 5 4 3 2 1 8 7 6 0 1 The subdiagonals are: 9,5,3,0 4,4,6
2011 Oct 26
6
sometimes removing NAs from code
Sometimes I have NA values within specific columns of a dataframe (in this example, the first two columns can have NAs). If there are NA values, I would like them to be removed. I have been using the code: y<-c(NA,5,4,2,5,6,NA) z<-c(NA,3,4,NA,1,3,7) x<-1:7 adata<-data.frame(y,z,x) adata<-adata[-which(apply(adata[,1:2],1,function(x)any(is.na(x)))),] This works well if there are NA
2010 Jul 16
3
Help with Sink Function
iterations <- 100 nvars <- 4 combined <- rbind(scaleMiceTrain, scaleMiceTest) reducedSample <- combined reducedSample <- subset(reducedSample, select = -pID50) reducedSample <- subset(reducedSample, select = -id) for (i in 1:iterations) { miceSample <- sample(combined[,-c(1,2)],nvars, replace=FALSE) miceSample$pID50 <- combined$pID50 miceTestSample <-
2011 Aug 26
1
R.oo data members / inheritance
If someone is able, can you tell me if there is a better way to do this? More specifically, do I have to rewrite all of the data members stuff and extend stuff of parent class in the child class? See below. Thanks in advance! Example 1: setConstructorS3("ClassA", function(A,x) { if(missing(A))A=15; if(missing(x))x=NA; extend(Object(), "ClassA", .size = A, .x=x
2017 Jun 23
0
Help: ifelse selection for x,y coordinates
Hi Celine, what about removing the unwanted after you made the x and y x<-x[x>0] # or x<-x[x>0&&y>0], ditto for y, x[x!=""] in your ifelse (... ,"") case if x and y will not have the same length afterwards you need to make that list thingy. cheers Peter On 23. Jun 2017, at 07:30, C?line L?scher <c-luescher at hispeed.ch<mailto:c-luescher at
2017 Jun 23
2
Help: ifelse selection for x,y coordinates
Hi Jim, Thank you very much for the answer?! The result is really better with this?? Here is the code?: > kk<- function(x.Koordinate, y.Koordinate, data=data) + { + coordx<-data$x.Koordinate[data$G==24] + coordy<-data$y.Koordinate[data$G==24] + x <- ifelse(data$x.Koordinate>coordx-51 & data$G>15,data$x.Koordinate," ") +
2003 Feb 21
1
Help Var passing in function
First thanks to the fast answer regarding the "Clustplot problem"... Regarding a new problem: for (i in 1:5) { z <- clara(adata, i) plot(z) } in the above code in the plot screen I get something like: clusplot(clara(x=adata,i)) in title in the 2nd type of plot I get silhouete plot of clara(x=adata,k=i,samples=50) How can I pass the real value to
2008 Sep 03
2
Highlighint rjs problem on a new product
Hi, Problem Summary: I have been trying to add the highlight effect to my table but everytime a new record is added the highlighting gives an rjs error. However when i click the add to cart button on a product that already exists inside the table, the highlight effect works. Is this because the partial must only have only one <tr></tr> in it and the <table> must be on the other
2013 Jun 19
1
quantile
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130619/e3d3d918/attachment.pl>
2008 Sep 01
4
action view mutiplication problem and why doesn't method work
I am trying to multiply something in view but what i get is the first parameter without the 2nd parameter being multiplied. <%= product.price*product.quantity %> only gives product.price Secondly I have put this method into the --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2003 Jul 14
1
for loop problem
Dear list, Here's a function that works fine when I assign one value to i. qx, ax and gr are vectors. ax.to.nax <- function(qx, ax, gr=c(0,1,5,10)){ px <- 1 - qx last.n <- gr[length(gr)] - gr[length(gr) - 1] all.bounds <- c(gr, gr[length(gr)] + last.n) n <- diff(all.bounds) # i <- 1 # this i should loop through the values of # gr: i=0, i=1, i=5 and i=10. # testprod
2017 Apr 16
1
Getting high precision values from qnorm in the tail
Hello All I am looking for high precision values for the normal distribution in the tail,(1e-10 and 1 - 1e-10) as the R package that I am using sets any number which is out of this range to these values and then calls the qnorm and qt function. What I have noticed is that the qnorm implementation in R is not symmetric when looking at the tails. This is quite surprising to me, as it is well known
2009 Dec 10
1
non-linear regression
I have a non-linear regression with 8 parameters to solve .... however it does not converge ... easily solves the excel ... including the initial estimates used in the R were found in the excel ... Another question is how to establish the increments of R by the parameters in the search ..
2003 Jan 24
4
new function: showcolors {base}
I propose to add a function that allows to display colors selected by a text pattern or by color vectors in a plot. Wolfram Fischer #--- showcolors.R showcolors <- function( col = "red" , index = NULL , pie = TRUE , lwd = 6 , cex = 1.0 , main = NULL , sub = NULL , ... ){ n.colors <- length( col ) if( n.colors > 1 ){ main <- deparse( substitute( col ) )
2011 Jul 20
2
Bootstrap
Hi all, I am facing difficulty on how to use bootstrap sampling and below is my example of function. Read a data , use some functions and use iteration to find the solution( ie, convergence is reached). I want to use bootstrap approach to do it several times (200 or 300 times) this whole process and see the distribution of parameter of interest. Below is a small example that resembles my
2017 Mar 19
3
"isolinux.bin missing or corrupt" when booting USB flash drive in old PC
On 03/18/2017 03:02 PM, Thomas Schmitt via Syslinux wrote: > Hi, > > David Christensen wrote: >> I use this USB flash drive for bootable installer images; I do not >> attempt to mount it. I don't know that I could, even if I wanted to: > > mkdir /mnt/iso > mount /dev/sdc /mnt/iso > > or, because partition 1 starts at block 0, you may mount it too >
2010 Jun 23
1
A question about R2Winbugs
Dear R users: I was trying to fit a HMM with mixture of Gaussian into the dataset, and I tried to implement it by R2Winbugs. But I got the following errer. * Error in FUN(X[[1L]], ...) : .C(..): 'type' must be "real" for this format* Does anybody know what's the problem? Does R2Winbugs accept some matrix as inits? I would really appreciate your help. Thank you very much.
2019 Sep 17
4
CentOS7 sometimes don't detect NIC after reboot
I have brand new PC with this components: CPU Intel? Pentium G5400, LGA1151 motherboard ASUS PRIME B360M-C 16 GB RAM HDD 2x ADATA SSD 256GB XPG GAMMIX S11, PCIe Gen3x4 M.2 2280 (RAID1) NIC Intel X550-T1 Ethernet Converged Network Adapter I installed CentOS 7 and two NICs were detected: eno1 (on motherboard) enp1s0 (Intel X550-T1) When I restart the machine sometimes enp1s0 is missing. It is not
2007 Apr 27
1
Quadratcount() plotting in R spatstat
Hello, I am trying to plot a quadratcount object over a ppp object in the spatstat package. I ultimately want to get something like this http://bg9.imslab.co.jp/Rhelp/R-2.4.0/src/library/spatstat/man/images/big_quadratcount_001.png http://bg9.imslab.co.jp/Rhelp/R-2.4.0/src/library/spatstat/man/images/big_quadratcount_001.png See