similar to: persuade tabulate function to count NAs in a data frame

Displaying 20 results from an estimated 2000 matches similar to: "persuade tabulate function to count NAs in a data frame"

2011 Mar 17
1
calculating the occurrences of distinct observations in the subsets of a dataframe
Hello everybody, I have a data frame in R which is similar to the follows. Actually my real 'df' dataframe is much bigger than this one here but I really do not want to confuse anybody so that is why I try to simplify things as much as possible. So here's the data frame. id <-c(1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3) a
2011 Mar 21
1
recalling different data frames (the way you do in Excel VB but now) in
Hello everyone, I'd like to ask you a question again, basically focusing on referring to different objects. Let's suppose we create the following databases this way: id <-c(1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3) a <-c(3,1,3,3,1,3,3,3,3,1,3,2,1,2,1,3,3,2,1,1,1,3,1,3,3,3,2,1,1,3) b <-c(3,2,1,1,1,1,1,1,1,1,1,2,1,3,2,1,1,1,2,1,3,1,2,2,1,3,3,2,3,2) c
2011 Mar 21
1
recalling different data frames (the way you do in Excel VB)
Hello everyone, I'd like to ask you a question again, basically focusing on referring to different objects. Let's suppose we create the following databases this way: id <-c(1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3) a <-c(3,1,3,3,1,3,3,3,3,1,3,2,1,2,1,3,3,2,1,1,1,3,1,3,3,3,2,1,1,3) b <-c(3,2,1,1,1,1,1,1,1,1,1,2,1,3,2,1,1,1,2,1,3,1,2,2,1,3,3,2,3,2) c
2011 Mar 01
2
bootstrap resampling - simplified
Hello there, I have a problem concerning bootstrapping in R - especially focusing on the resampling part of it. I try to sum it up in a simplified way so that I would not confuse anybody. I have a small database consisting of 20 observations (basically numbers from 1 to 20, I mean: 1, 2, 3, 4, 5, ... 18, 19, 20). I would like to resample this database many times for the bootstrap process with
2011 Mar 17
2
changing the dimensions of a matrix in a real specific way
Hi again, I'd like to ask you a question again. I have a matrix like this: a <-matrix(c(1,2,3,4,5,6,7,8,9,10,11,12)) a [,1] [1,] 1 [2,] 2 [3,] 3 [4,] 4 [5,] 5 [6,] 6 [7,] 7 [8,] 8 [9,] 9 [10,] 10 [11,] 11 [12,] 12 Is there a proper way to change the dimensions of this matrix so that I'll get this as a result: [,1] [,2] [,3] [1,]
2011 Mar 08
1
creating additional column
Hello everybody, I have a little problem in good old R. It is basically the following. I have this small database with 3 rows and the following columns: d1, d2, d3 and Highest d value - which selects the highest value from d1, d2, d3 in each row. d1 d2 d3 Highest d value 1 51.398426 39.111721 11.6086220 51.398426 2 4.057801
2011 Mar 01
2
bootstrap resampling question
Hello there, I have a problem concerning bootstrapping in R - especially focusing on the resampling part of it. I try to sum it up in a simplified way so that I would not confuse anybody. I have a small database consisting of 20 observations (basically numbers from 1 to 20, I mean: 1, 2, 3, 4, 5, ... 18, 19, 20). I would like to resample this database many times for the bootstrap process with
2011 Feb 10
3
help - "the condition has length > 1 and only the first element will be used"
Hello there, I don't know if I'm addressing my question to the right e-mail address, I hope I do. Actually I have a little problem concerning writing a code in R. I try to briefly sum up my problem. As you can see below, I created the functions "Equation1" and "Equation2" with some conditions. Equation1 <-function(x){ if
2011 Apr 18
4
altering identity column
Hi there, I have a huge dataframe containing 70,000 observations. I have filtered this dataframe (let it's name be "transformed_dataframe") as I wanted to select only those observations which are greater than or equal to 60,001 regarding the very first identity column. So I have a transformed dataframe now including 10,000 obeservations (from 60,001 - to 70,000) and if you send
2011 Mar 11
1
changing one character in the name of dataframes repeatedly
Dear R-community, I'd like to ask you a question concerning R again. I try to keep this simple because I am not willing to confuse you at all. I have a little data frame which I have created the following way: a <-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6) b <-c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) df
2009 Jul 20
1
tabulate can accept NA values?
tabulate has .C("R_tabulate", as.integer(bin), as.integer(length(bin)), as.integer(nbins), ans = integer(nbins), PACKAGE="base")$ans The implementation of R_tabulate has if(x[i] != R_NaInt && x[i] > 0 && x[i] <= *nbin) and so copes with (silently drops) NA. Perhaps the .C could have NAOK=TRUE? This is useful in apply'ing tabulate to
2011 Mar 28
1
quantile function -> I need only the quantile value itself
Hi, I am using the quantile function currently and I have just bumped into a little problem. I have a very small data frame something like this: small_df <- c(7,3,4,7,1,10,12,1,12,4,4,8,6,11,9,10,4,13,3,9,6,5,2,10,7,14,2,7,10,10,7,8,2,11,3,10,11,3,11,14,12,7,6,11) small_df Now in the next step I would like to calculate the quantile value of the previous data frame at the probability of 95%
2011 Mar 28
2
deleting the first two characters in each row of a factorized column
Hello, I'd like to ask you something again. I have a database and it has a column which looks like this one here: small_factor <- factor(c("d_variable1","d_variable2","d_variable3")) small_factor Now the thing is that I would like to convert each element of this factorized column. Basically I want to rewrite the words in it without the first two characters:
1999 Apr 03
2
tabulate causes segmentation fault (PR#156)
Peter, I thought this one was noted and fixed, but I could be wrong. R : Copyright 1999, The R Development Core Team Version 0.63.3 (March 6, 1999) .... [Previously saved workspace restored] > tabulate(1:10, 5) Process R:1 segmentation fault at Sat Apr 3 17:48:34 1999 -- (The following contact details become official on 1 May 1999, but the email
2004 Oct 20
2
apply function
Hi all, I have a question about apply function. Is that possible to pass some non-default arguments in the function we want to apply ? For example: if "mat" is a matrix and I want to use the "tabulate" function on its row. The command apply(mat,1,tabulate) works but I have problem with this one apply(mat, 1, tabulate(nbins=4)). Any clue ? Thanks, Eric -- Eric
2017 Nov 10
0
Calculating frequencies of multiple values in 200 colomns
Hi, To clarify the default behavior that Boris is referencing below, note the definition of the 'bin' argument to the tabulate() function: bin: a numeric vector ***(of positive integers)***, or a factor. Long vectors are supported. I added the asterisks for emphasis. This is also noted in the examples used for the function in ?tabulate at the bottom of the help page. The second
2018 Nov 01
0
AD GlobalNames zone
Hi, MS AD feature the GlobalNames DNS zone. Is there the same feature in Samba AD (with bind9 DLZ)? ifeher Ez az e-mail és bármely melléklete kizárólag a címzettnek szól. A címzett személyes adatait a küldő fél a www.e77.hu oldalon ITT elérhető adatkezelési tájékoztatóban foglaltak szerint kezeli. Az ott leírtak szerint ön jogosult tiltakozni személyes adatainak kezelése ellen. A jelen
2013 Nov 19
0
[SOLVED] ibm x440 xen not boot (rootfs not found)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 All. Just in then case if anyone is using some old piece of hardware like the ibm x440, I could successfully run xen 4.2.3 on it. I have a working kernel .config and a set of xen boot parameters, along with some tuneups in the x440''s BIOS. The problem was quite complex (irq handling pci bus problems, ethtool magics, etc). Occasionally (once
2017 Nov 10
2
Calculating frequencies of multiple values in 200 colomns
|> x <- sample(0:2, 10, replace = TRUE) |> x [1] 1 0 2 1 0 2 2 0 2 1 |> tabulate(x) [1] 3 4 |> table(x) x 0 1 2 3 3 4 B. > On Nov 10, 2017, at 4:32 AM, Allaisone 1 <allaisone1 at hotmail.com> wrote: > > > > Thank you for your effort Bert.., > > > I knew what is the problem now, the values (1,2,3) were only an example. The values I have are
2013 Aug 09
1
a fast table() for the 1D case
Hi, table1D() below can be up to 60x faster than base::table() for the 1D case. Here are the detailed speedups compared to base::table(). o With a logical vector of length 5M: 11x faster (or more if 'useNA="always"') o With factor/integer/numeric/character of length 1M and 9 levels (or 9 distinct values for non-factors):