search for: serguei

Displaying 20 results from an estimated 223 matches for "serguei".

Did you mean: sergei
2007 Nov 28
4
Replacing values job
...lues: X < -c(2,6,1,7,4,3,5) Y <- c(1,1,6,4,6,1,4,1,2,3,6,6,1,2,4,4,5,4,1,7,6,6,4,4,7,1,2) How can I replace the values in Y with the index (!) of the corresponding values in X. So 2 appears in X in the first coordinate, so all 2’s in Y should be replaced by 1, etc. Thank you for your help, Serguei ________________________________________ Austrian Institute of Economic Research (WIFO) P.O.Box 91 Tel.: +43-1-7982601-231 1103 Vienna, Austria Fax: +43-1-7989386 Mail: Serguei.Kaniovski@wifo.ac.at http://www.wifo.ac.at/Serguei.Kaniovski [[alternative HTML versio...
2006 Dec 14
3
Delete all dimnames
...1 1 0 0 1 0 0 0 0 1 0 0 0 3 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 2 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 is displayed with [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] in rows, and the same in columns. The matrix was generated using "apply" Serguei ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniov...
2005 Nov 23
2
vector of permutated products
...ld like to do without temp1 and temp2. To have something like result<-apply(permat*x-(permat-1)*x,1,prod) My problem is that permat*x does not produce permat*temp1 due to the way the element-by-element multiplication works in R. Can you help to simplify the above code? Thank you in advance, Serguei Kaniovski -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-243 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http:...
2009 Apr 18
5
Dummy (factor) based on a pair of variables
...n pairs of countries, i and j, e.g.: y,i,j 1,AUT,BEL 2,AUT,GER 3,BEL,GER I would like to create a dummy (indicator) variable for use in regression (using factor?), such that it takes the value of 1 if the country is in the pair (i.e. EITHER an i-country OR an j-country). Thank you for your help, Serguei ________________________________________ Austrian Institute of Economic Research (WIFO) P.O.Box 91                          Tel.: +43-1-7982601-231 1103 Vienna, Austria        Fax: +43-1-7989386 Mail: Serguei.Kaniovski@wifo.ac.at http://www.wifo.ac.at/Serguei.Kaniovski [[alternative HTML version...
2007 Feb 26
1
Adding duplicates by rows
Hi, I am trying to add duplicates of matrix "mat" by row. Commands subset(mat,duplicated(rownames(mat))) or mat[which(duplicated(rownames(mat))),] return only half of the required indices. How can I find the remaining ones, ie the matches, so that I can add them up? Thanks, Serguei ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski@wifo....
2006 Sep 22
3
Compiling a contingency table of counts by case
...uot;, b. the first has "x=0" - the second has "x=1", c. the first has "x=1" - the second has "x=0", d. both have "x=0", The difficulty is that the number of "names" and their identity changes from case to case. Thanks a lot for you help, Serguei Kaniovski -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http:...
2005 Dec 04
4
Construct a data.frame in a FOR-loop
Say I have a FOR-loop for computing powers (just a trivial example) for(i in 1:5) { x<-i^2 y<-i^3 } How can I create a data.frame and a 3D plot of (i,x(i),y(i)), i.e. for each iteration Thanks, Serguei Kaniovski -- ___________________________________________________________________ ??sterreichisches Institut f??r Wirtschaftsforschung (WIFO) Name: Serguei Kaniovski Postadresse: Postfach 91 Tel.: +43-1-7982601-231 A-1103 Wien Fax : +43-1-7989386...
2007 Feb 22
4
Sorting rows of a binary matrix
...-1), here from 0 to 7. But the rows are not sorted in this order. How can sort the rows the ascending order of the decimals they represent, preferably without a function which converts binaries to decimals (which I have)? Alternatively, generate a matrix that has the rows sorted that way? Thanks, Serguei [[alternative HTML version deleted]]
2007 Feb 06
1
Questions on counts by case
...same composition by people, then save each portion in a separate file, 2. compute the frequency of "1"'s in "x" for each person by group "gr". So, "mike" will have freq=2/3, as he has two "1" and one "0" in 3 groups. Thanks a lot, Serguei Kaniovski The data looks like: person;gr;x mike;gr1;1 jane;gr1;0 bill;gr1;0 jack;gr2;1 mike;gr2;1 jane;gr2;0 bill;gr2;0 alex;gr2;1 james;gr2;1 mike;gr3;0 bill;gr3;1 jane;gr3;1 ___________________________________________________________________ Austrian Institute of Economic Research...
2006 Oct 03
1
Reshape into a contingency table/Fisher's test
...that the "fisher.test" and "chisq.test" can be "applied" to the pairs of names. As as result I would like to have the original format, ie John.Mike John.Jim John.Steve Mike.Jim Mike.Steve Jim.Steve with two columns containing the p-values of the tests. Thanks a lot, Serguei -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http://www.wifo....
2020 Apr 17
2
suggestion: "." in [lsv]apply()
...osal as it is inconsistent and not general. This sounds promising for me. May be in a (new?) future, R core will come with a correct proposal for this principle? Meanwhile, to avoid substitute(), I'll look on the side of formula syntax deviation as your example x ~> i + x suggested. Best, Serguei. > Personally, I find the current syntax much clearer and readable > (defining anything by convention like . being the function variable > seems arbitrary and "dirty" to me), but if you wanted to define a > shorter syntax, you could use something like x ~> i + x. That s...
2007 Nov 28
1
Order observations in a dataframe
...der of their cumulative "weight", which wound be: country;weight;group fra;29;1 ita;29;1 gbr;29;1 bul;10;2 cze;12;2 grc;12;2 hun;12;2 prt;12;2 rom14;2 aut;10;3 bel;12;3 The first group has the largest sum of weights, the second, with the second largest, and so on. Thanks for your help, Serguei Kaniovski ________________________________________ Austrian Institute of Economic Research (WIFO) P.O.Box 91 Tel.: +43-1-7982601-231 1103 Vienna, Austria Fax: +43-1-7989386 Mail: Serguei.Kaniovski@wifo.ac.at http://www.wifo.ac.at/Serguei.Kaniovski [[alternative H...
2017 Jul 07
2
[New Patch] Fix disk corruption when writing
Duncan Murdoch has written at Thu, 6 Jul 2017 13:58:10 -0400 > On 06/07/2017 5:21 AM, Serguei Sokol wrote: >> I propose the following patch against the current >> R-devel/src/main/connection.c (cf. attached file). >> It gives (on my linux box): >> > fc=file("/dev/full", "w") >> > write.csv("a", file=fc) >> Error in w...
2007 Dec 04
3
Inserting a subsequence between values of a vector
Hallo, suppose I have a vector: x <- c(1,1,1,2,2,3,3,3,3,3,4) How can I generate a vector/sequence in which a fixed number of zeroes (say 3) is inserted between the consecutive values, so I get 1,1,1,0,0,0,2,2,0,0,0,3,3,3,3,3,0,0,0,4 thanks a lot, Serguei [[alternative HTML version deleted]]
2006 Jul 18
2
A contingency table of counts by case
...uot;1", c. the first has "0" - the second has "0", d. both have "0". There will be choose(9,2) sums, denoted s_ij for 1<=i<j<=9, where i and j are running indices for an "id"-pair. Please help, this is way beyond my knowledge of R! Thank you, Serguei Kaniovski -- ___________________________________________________________________ Austrian Institute of Economic Research (WIFO) Name: Serguei Kaniovski P.O.Box 91 Tel.: +43-1-7982601-231 Arsenal Objekt 20 Fax: +43-1-7989386 1103 Vienna, Austria Mail: Serguei.Kaniovski at wifo.ac.at http:...
2018 Jan 22
3
Inconsistent rank in qr()
...; is a synonym of min(nrow(A), ncol(A)) for any matrix but the fix to stick with commonly admitted rank definition (i.e. the number of linearly independent columns in A) is so easy. Why to discard lapack case from it (even properly documented)? > > > >> On Jan 22, 2018, at 11:21 AM, Serguei Sokol <sokol at insa-toulouse.fr> wrote: >> >> Hi, >> >> I have noticed different rank values calculated by qr() depending on >> LAPACK parameter. When it is FALSE (default) a true rank is estimated and returned. >> Unfortunately, when LAPACK is set to TRUE...
2017 Jul 06
2
[New Patch] Fix disk corruption when writing
...rent R-devel/src/main/connection.c (cf. attached file). It gives (on my linux box): > fc=file("/dev/full", "w") > write.csv("a", file=fc) Error in writeLines(paste(col.names, collapse = sep), file, sep = eol) : system call failure on writing > close(fc) Serguei. Le 05/07/2017 ? 15:33, Serguei Sokol a ?crit : > Le 05/07/2017 ? 14:46, Serguei Sokol a ?crit : >> Le 05/07/2017 ? 13:09, Duncan Murdoch a ?crit : >>> On 05/07/2017 5:26 AM, January W. wrote: >>>> I tried the newest patch, but it does not seem to work for me (on >...
2006 Dec 04
1
Count cases by indicator
...: I would like to know how often each of the 512 vectors occurs in "case". With these data, the output should be a vector with 2^9=512 coordinates, having 2,2,1,3, as, respectively, the coordinate number 129, 193, 449, 512, and zeros in all other coordinates. Thank you for your help, Serguei df<-read.delim("clipboard",sep=";") DATA: case;x 093/0188;0 093/0188;0 093/0188;1 093/0188;0 093/0188;1 093/0188;1 093/0188;1 093/0188;1 093/0188;1 093/0206;0 093/0206;0 093/0206;0 093/0206;0 093/0206;0 093/0206;0 093/0206;0 093/0206;0 093/0206;0 093/0216;0 093/0216;1 093/0...
2020 Apr 20
1
suggestion: "." in [lsv]apply()
...atch.fun(x) Such replacement would leave current usage of *apply() as is but at the same time would leave enough space for users who want to adapt *apply() to their objects like formula or whatever class that is currently not convertible to functions by match.fun() Would it be possible? Best, Serguei. > It is not specific to sapply but rather fn$ can preface most > functions. If the only free variables are the arguments to the > function then you can omit the left hand side of the formula, i.e. the > arguments to the function are implied by the free variables in the > right...
2020 Apr 16
2
suggestion: "." in [lsv]apply()
Simon, Thanks for replying. In what follows I won't try to argue (I understood that you find this a bad idea) but I would like to make clearer some of your point for me (and may be for others). Le 16/04/2020 ? 16:48, Simon Urbanek a ?crit?: > Serguei, >> On 17/04/2020, at 2:24 AM, Sokol Serguei <sokol at insa-toulouse.fr> >> wrote: Hi, I would like to make a suggestion for a small syntactic >> modification of FUN argument in the family of functions [lsv]apply(). >> The idea is to allow one-liner expressions with...