similar to: Transforming list into an array

Displaying 20 results from an estimated 3000 matches similar to: "Transforming list into an array"

2010 Mar 02
2
Binding a matrix to a matrix
Hello I have a 2x10x200 matrix and I would like to bind to it another 2x10 matrix in order to end up with an 2x10x2001 matrix, which command should i use in order to do this? Thank you Felipe Parra [[alternative HTML version deleted]]
2008 Jan 29
1
for loop help
Hi, I have written the following code which works fine step<-5 numSim<-15 N<-double(numSim) A<-double(numSim) F<-double(numSim) M<-double(numSim) genx<-double(numSim) for (i in 1:numSim) { N[i]<-20 PN<-(runif(N[i], 0, 1)) A[i]<-sum(ifelse(PN>0.2, 1, 0)) PF<- runif((A[i]*0.5), 0, 1) F[i]<-sum(ifelse(PF>0.2, 1, 0)) PM<-
2011 Nov 23
2
avoiding the sample in built function
Dear all, I am currently working on a function in which I would like to avoid using the command sample(). Therefore, I am now trying to make a for loop that does the same thing as the in built function sample does: Rearranging the items of a object randomly. So, the output I want to you get is the same as sample() would give me: e.g.: data <- c(5,4,6,7,8) sample(data) > data <-
2010 Feb 23
2
Importing a file to r
Hello I am trying to import the attached file Curva LIBOR to R. I am trying to use the following commands and obtaining the following errors > res <- read.xlsx("C:\\Users\\FELIPE PARRA\\Documents\\Quantil\\Federacion\\Curva LIBOR.xlsx", 4) Error en .jcall(rowCells[[ic]], "I", "getColumnIndex") : RcallMethod: invalid object parameter > res <-
2011 May 06
1
Uniroot - error
Hi, I have tried to use uniroot to solve a value (value a in my function) that gives f=0, and I repeat this process for 10000 times(stimulations). However error occures from the 4625th stimulation - Error in uniroot(f, c(0, 2), maxiter = 1000, tol = 0.001) : f() values at end points not of opposite sign I have also tried interval of (lower=min(U), upper=max(U)) and it won't work as well.
2012 Sep 11
2
splines package
Hello all, I have been working with b-splines and noted that the splines package is not available in CRAN. Does any body know what happened with it? Or, is there any package that replaces it? Thank you Felipe Parra [[alternative HTML version deleted]]
2010 Nov 22
4
Rexcel
Hello I am new to RExcel and I would like to run a source code form the excel worksheet. I would like to run the following code source("C:\\Quantil Aplicativos\\Genercauca\\BackwardSelectionNC.r") from the excel wroksheet. Does anybody know how to do this? Thank you Felipe Parra [[alternative HTML version deleted]]
2010 Sep 26
4
Problem with unlist
Hello I want to unlist the attached element getting only the first element in each element of the list. The last element of the list looks as this: [[5065]] [[5065]]$Pluv3Meses [1] 274.4 [[5065]]$PluvMesesMedio [1] 378.2667 [[5065]]$Pluv2UltimosMeses [1] 23.33333 So I would like to get for each element of the list the element called Pluv3Meses. The whole list has 5065 elements but when I try to
2010 Sep 29
2
boxplot
Hello, does somebody know in a boxplot, what does each element in the boxplot represent? 1. lines at the extremes of the dotted lines? 2. Extremes of the boxes 3. Black line in the middle of the box? 4. notches? Thank you Felipe Parra [[alternative HTML version deleted]]
2010 Dec 15
6
Numbers in a string
Hello, I have stings which have all sort of characters (numbers, letters, punctuation marks, etc) I would like to stay only with the numbers in them, does somebody know how to do this? Thank you Felipe Parra [[alternative HTML version deleted]]
2010 May 12
3
Calling a list element
Hello, i have the following list strsplit(as.character(Elecciones$Municipios),"\\.") [[1]] [1] "ANTIOQUIA" "ABEJORRAL" [[2]] [1] "META" "ACACIAS" [[3]] [1] "CASANARE" "AGUAZUL" [[4]] and I would like to make a vector of the first element of each of the list items, in this case ANTIOQUIA, META, CASANARE, etc . Do you know how
2011 Apr 09
1
Memory allocation problem
Hello, I am runnning a program on R with a "big" number of simulations and I am getting the following error: Error: no se puede ubicar un vector de tamaƱo 443.3 Mb I don't understand why because when I check the memory status in my pc I get the following: > memory.size() [1] 676.3 > memory.size(T) [1] 1124.69 > memory.limit() [1] 4000 which should in theory allow to
2011 Mar 09
2
trunc function
Hello. I would like to know if there exists in R a function like trunc but where i can choose how many decimal places can I stay with in the number I have (sort of the same as the trunc function in excel). I would like, for example if I have the number 0.974678 and I choose to stay with 3 decimal places to have as ouput 0.974. Thank you Felipe Parra [[alternative HTML version deleted]]
2013 May 15
1
Problem with convergence in optim
Hello to all, I have been using an optim with the following call: optim(param_ini,fun_errores2,Precio_mercado=Precio,anos_pagosE2=anos_pagos,control=list(maxit=10000,reltol=1e-16)) depending on the intial values I'm getting the same solution but once I get the convergence message=10 (no convergence) and for the others I get convergence message = 0 Solution1: $par beta1
2011 Mar 28
1
portfolioBacktest in fPortfolio
Hello. I am trying to use the portfolio backtesting function in fPortfolio package, but I don't now why in my version of fPortfolio I don't have either the portfolioBactest nor the portfolioBacktesting functions. Does anybody knows what might be going on? thank you Felipe Parra [[alternative HTML version deleted]]
2010 Apr 05
1
predict.lm
Hello I am trying to use predict.lm, but I am having trouble getting out of sample predictions. I am getting the same output if I use the following three commands: predict(ModeloLineal,predictors[721:768,]) predict(ModeloLineal,predictors[1:768,]) predict(ModeloLineal) where ModeloLineal is the output from ModeloLineal<-lm(dataTS[,6] ~ predictors[1:720,]), so the first 720 observations of
2010 Sep 16
1
Problems creating a Panel
Hello, I am trying to create a panel with the attached data frame. using the following code: > PanelRio = DataRiopaila[which(duplicated(DataRiopaila$SEC_STE)==T),] > PanelRio=plm.data(PanelRio,index=c("SEC_STE","FechaSiembra")) series Pluv3Meses,PluvMes4al10,Pluv2UltimosMeses,Rad3Meses,RadMes4al10,Rad2UltimosMeses are NA and have been removed It tells me it removes
2011 Mar 24
1
Problems with predict in fGarch
Hello. I am using fGarch to estimate the following model: Call: garchFit(formula = fmla, data = X[, i], trace = F) Mean and Variance Equation: data ~ arma(1, 1) + garch(1, 1) Conditional Distribution: norm Coefficient(s): mu ar1 ma1 omega alpha1 beta1 -0.94934 1.00000 -0.23211 54.06402 0.45709 0.61738 Std. Errors: based on Hessian Error Analysis:
2011 Mar 04
1
Problems with a function warning
Hello. I have the following funtion: fechasEntrega = function(FechasEntrega,fecha){ if(length(which(FechasEntrega<fecha))>0){ tkmessageBox(title = "Error en Fecha de Valoracion",message="Hay una fecha de entrega anterior a la fecha de valoracion. Todas las fechas de entrega deben ser posteriores a la fecha de valoraciĆ³n para el correcto funcionamiento del
2011 Apr 22
2
Matching a vector with a matrix row
Hello I am trying to compare a vector with a Matrix's rows.The vector has the same length as the number of columns of the matrix, and I would like to find the row numbers where the matrix's row us the same as the given vector. What I am doing at the moment is using apply as follows: apply(Matrix,1,function(x)all(x%in%LHS)) but this isn't too fast actually. I would like to know if