similar to: lapply-related question

Displaying 20 results from an estimated 10000 matches similar to: "lapply-related question"

2007 Oct 17
1
R CMD build and et_EE.UTF-8 locale -> invalid files (PR#10351)
Full_Name: Ott Toomet Version: 2.6.0, 2.5.x OS: debian etch, lenny Submission from: (NULL) (80.235.63.243) When building a package with 'R CMD build name_of_directory" using "et_EE.UTF-8" locale, I get the following: siim at tancredi:~/tyyq/econ/micEcon$ R CMD build trunk * checking for file 'trunk/DESCRIPTION' ... OK * preparing 'trunk': * checking
2001 Sep 20
3
indexing an array
Dear everybody, I have a following problem. I have a 3D array lambda <- array( dim=c(N,M,M-1)) where I have to extract the elements as follows: lambda[ 1, state[1], 1] lambda[ 1, state[1], 2] ... lambda[ 1, state[1], M-1] lambda[ 2, state[2], 1] ... lambda[ 2, state[2], M-1] ... lambda[ N, state[N], M-1] i.e. the result should be a 2D array, where the second index follows the first one
2007 Oct 30
2
Splitting up the micEcon package?
Dear R Users: The functions of our "micEcon" package [1,2] can be subdivided into three categories: - microeconomic demand and firm models - sample selection models (mainly selection()) - routines for (likelihood) maximisation (e.g. maxLik(), maxNR(), maxBHHH()) (mainly used for ML estimation of sample selection models) Although sample selection models are often used in
2002 Aug 10
2
package for saving large datasets in ASCII
Hi, I have made a tiny package for saving dataframes in ASCII format. The package contains functions save.table() and save.delim(), the first mimics (not completely) write.table() and the second uses just different default values, suitable for read.delim(). The reason I have written the functions is that I have had problems with saving large dataframes in ASCII form. write.table() essentially
2002 May 13
3
Histograms rotated, side-by-side
Hi there, I am wanting to create 8 side-by-side histograms which have been rotated 90 degrees clockwise from how they usually sit.. all with the same scales. Is someone able to help me out? Thanks so much, Rachel Cunliffe -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2010 May 10
2
Robust SE & Heteroskedasticity-consistent estimation
Hi, I'm using maxlik with functions specified (L, his gradient & hessian). Now I would like determine some robust standard errors of my estimators. So I 'm try to use vcovHC, or hccm or robcov for example but in use one of them with my result of maxlik, I've a the following error message : Erreur dans terms.default(object) : no terms component Is there some attributes
2002 Jan 25
2
problem with read.table -- example
Hi, I have not get much response for my question about read.table for couple of days ago. As I said, the problem is that read.delim() do not want to read more than 51 lines of data, with longer file it reads the first column as row names, although I have not noticed any special binary symbols around line 51 either. This problem seems to happen with this particular file, I could easily read in a
2006 Sep 18
1
ISO8601 week-of-year to date
Hi, are there any way to convert ISO8601 weeks to gregorian dates? Something like coverttodate(year=2006, week=38, day=1) # Sept 18, 2006 Thanks in advance, Ott
2002 Jun 20
2
cat output To data.frame.rows ?
Hi, is there a possibilty to get my function output with "cat " as data.frame.rows with variables ? Var1---------------- 8 15 1 3 Var2---------------- 0.170 0.319 0.0213 0.0638 Var3---------------- 83.8 88.6 90 75 Var4---------------- 84.3 84.3 100 83.3 Var5---------------- 62.5 56 20 53.3 function(data.frame) { .... ....
2009 Aug 28
1
problems with strsplit using a split of ' \\\ ' : a regex problem
I have a vector of gene symbols, some of which have multiple aliases. In the case of an alias, they are separated by ' \\\ '. Here is a real world example, which would represent one element of my vector: Eif4g2 /// Eif4g2-ps1 /// LOC678831 What I would like to do is input the vector into a function and output a vector with just the first alias of each element (or, if there are no aliases,
2007 Feb 10
1
how to eval subset?
Hi, I have problems with subset when calling a function from inside a function from inside a function. Here is a small example to be called as 'f1()'. 'eval()' in f3 fails with error message Error in eval(expr, envir, enclos) : object "subs" not found Is it possible to supplement subset to data, to be calculated in a different environment than the data itself? Thanks
2001 Oct 09
1
bug in paste?
Dear all, I have strange problems with paste. Actually I suggest it is a bug (I send a associated bug report for some days ago too). I have a vector ce0, a character vector m and I paste them together: > ce0 [1] "1985" "9" "2" "2" "1" "A" "1" "" "NA" "5" [11]
2005 Aug 31
5
"best" c++ matrix library?
Hi folks, I am planning to write some more time-consuming matrix manipulations in c++. What is the experience with the existing c++ matrix libraries? Do you have some recommendations? Are some libraries more compatible with R than the others? All suggestions welcome! Best, Ott
2003 Aug 26
3
plot empirical pdf
Hi, are there any function to plot the empirical probability distribution function? I just don't want to reinvent the wheel... Best wishes, Ott -- Ott Toomet PhD Student Dept. of Economics ?rhus University Building 322 Universitetsparken 8000 ?rhus C Denmark otoomet (a) econ au dk ph: (+45) 89 42 20 27 ------------------------------------------- (o_ (*_ (O_
2006 Aug 21
2
polychor error
Hi. Does anyone know whether the following error is a result of a bug or a feature? I can eliminate the error by making ML=F, but I would like to see the values of the cut-points and their variance. tmp.vec<-c(0, 0, 0 , 0 ,0 , 1, 0, 2, 0 , 0, 5 ,5 ,3 ,1, 0 , 1, 5, 10, 27, 20, 9, 0, 1, 1, 12, 29, 57, 34, 0, 0, 1, 2, 11, 31, 32) tmp.mat<-matrix(tmp.vec, nrow=7)
2011 Oct 03
2
Parsing variable-length delimited strings into a matrix
I'm struggling to find a way of parsing a vector of data in this sort of form: A,B,C B,B A,AA,C A,B,BB,BBB,B,B into a matrix (or data frame). The catch is that I don't know a priori how many entries there will be in each element, nor how many characters there will be. strsplit(vec,",") gets me a list, but I can't find a way of turning the list into a matrix. unlistlst)
2011 Feb 16
1
confused by lapply
Description: 'lapply' returns a list of the same length as 'X', each element of which is the result of applying 'FUN' to the corresponding element of 'X'. I expect that when I do > lapply(vec,f) f would be called _once_ for each component of vec. this is not what I see: parse.num <- function (s) { cat("parse.num1\n"); str(s) s
2015 Aug 21
1
sequence divided by data.frame
Can anyone explain me the following behavior: > 1:2/1 [1] 1 2 -- makes sense > 1:2/matrix(1,1,1) [1] 1 2 -- makes sense > 1:2/data.frame(a=1) a 1 1 -- why is this different? Best, Ott -- Ott Toomet Visiting Researcher School of Information Mary Gates Hall, Suite 095 University of Washington Seattle, WA 98195 [[alternative HTML version deleted]]
2016 Sep 22
1
as.character.factor and S4 object containing factor
Do I mess up something or is this a bug? If I define an S4 object that contains "factor", all the tests indicate that it is a factor but as.character.factor() complains of it being a non-factor... > setClass("Foo", contains="factor") > a <- new("Foo", factor(1:3)) > a Object of class "Foo" [1] 1 2 3 Levels: 1 2 3 > class(a) [1]
2004 Jan 13
2
R killed on Solaris
Hello, I am running a preliminary data-processing job on solaris. Basically, the program reads a large number of ascii-lines (about 1M) by blocks (size 25000 lines), selects suitable observations (around 5000) and writes the results into a dataframe for latter processing. The problem is that when I run the job interactively (in emacs/ESS), everything works fine. If I try to run it from shell