similar to: PrettyR (describe)

Displaying 20 results from an estimated 1000 matches similar to: "PrettyR (describe)"

2009 Jun 03
2
Create a time interval from a single time variable
I am trying to set up a data set for a survival analysis with time-varying covariates. The data is already in a long format, but does not have a variable to signify the stopping point for the interval. The variable DaysEnrolled is the variable I would like to use to form this interval. This is what I have now: ID Age DaysEnrolled HAZ WAZ WHZ Food onARV
2008 Apr 03
1
prettyR 25% quartile, 75% quartile
I am using the describe function in prettyR. I would like to add the 25% 75% quartiles to the summary table how do I do this I have tried describe(x.f, num.desc=c("mean", "median", "sd", "min", "max", "skewness", "quantile(x.f, na.rm=T, probs=seq(0.25, 0.75))", "valid.n")) help -- Let's not spend our time
2012 Jul 18
2
loop searching the id corresponding to the given index (timestamp)
Hello, I have the following loop for two data sets: diveData_2008 and diveData_2009. It uses two other data: diveCond_all and fishTable. The problem is at the point to identify the dive_id for the given index (index is timestamp). It keeps on saying for the1st loop Error in fishReport$dive_id[i] <- dive_id : replacement has length zero for the 2nd loop Error in fishReport$dive_id[i + j] <-
2012 Apr 19
1
SmoothTrend in OpenAir
I'm trying to plot smooth trend using smoothTrend in OpenAir but I'm having problems. I used the following code. --------------------------------------------------------------------------------- #Set my working dir to the dir with my files setwd("c:/R") #Load the openair library library(openair) #Load the data mydata <- read.table("MCNP-pH.csv", header=TRUE,
2008 Apr 29
1
merging multiple data frames with different numbers of rows
merge can only merge two objects at a time- I would like to merge more than two objects at a time. s.d <- structure(list(RiverMile = c(202L, 198L, 190L, 185L, 179L, 148L, 119L, 61L)), .Names = "RiverMile", row.names = c(NA, -8L), class = "data.frame") #s.d is all of the river miles that can occur in all of the data frames that I want to put together feb06 <-
2017 Jan 11
2
R 'base' returning 0 as sum of NAs
Dear R Team The following line returns 0 (zero) as answer: sum(c(NA_real_, NA_real_, NA_real_, NA_real_), na.rm = TRUE) One would, however, have expected it to return 'NaN', as is the case with function 'mean': > mean(c(NA_real_, NA_real_, NA_real_, NA_real_), na.rm = TRUE) [1] NaN The problem in other words: I have a vector filled with missing numbers. I run the
2008 Apr 29
1
data management (subsetting and recombining)
This is an example of two months of data from a twenty four month data set that I would like to apply this too. These data are subsets of the same stations throught time, but differing ones were included on different sampling dates. I would like to subset these data and then put them together as a big matrix with the by column being RiverMile. What is the easiest way to proceed as this is a
2009 Apr 30
2
NA_real_ <op> NaN -> NA or NaN, should we care?
On Linux when I compile R 2.10.0(devel) (src/main/arithmetic.c in particular) with gcc 3.4.5 using the flags -g -O2 I get noncommutative behavior when adding NA and NaN: > NA_real_ + NaN [1] NaN > NaN + NA_real_ [1] NA If I compile src/main/arithmetic.c without optimization (just -g) then both of those return NA. On Windows, using a precompiled R 2.8.1 from CRAN I get NA for
2023 Apr 14
1
Possible inconsistency between `as.complex(NA_real_)` and the docs
Hi all, Surprisingly (at least to me), `as.complex(NA_real_)` results in `complex(real = NA_real_, imaginary = 0)` rather than `NA_complex_`. It seems to me that this goes against the docs of `as.complex()`, which say this in the Details section: "Up to R versions 3.2.x, all forms of NA and NaN were coerced to a complex NA, i.e., the NA_complex_ constant, for which both the real and
2020 May 23
2
Should 0L * NA_integer_ be 0L?
I don't see this specific case documented anywhere (I also tried to search the r-devel archives, as well as I could); the only close reference mentions NA & FALSE = FALSE, NA | TRUE = TRUE. And there's also this snippet from R-lang: In cases where the result of the operation would be the same for all > possible values the NA could take, the operation may return this value. >
2017 May 19
2
Inconsistency in handling of numeric input with %d by sprintf
Consider #as.numeric for emphasis sprintf('%d', as.numeric(1)) # [1] "1" vs. sprintf('%d', NA_real_) > Error in sprintf("%d", NA_real_) : invalid format '%d'; use format %f, %e, %g or %a for numeric object > I understand the error is correct, but if it works for other numeric input, why doesn't R just coerce NA_real_ to NA_integer_?
2017 May 23
2
Inconsistency in handling of numeric input with %d by sprintf
I initially thought this is "documented behaviour". ?sprintf says: Numeric variables with __exactly integer__ values will be coerced to integer. (emphasis mine). Turns out this only works when the first value is numeric and not NA, as shown by the following example: > sprintf("%d", as.numeric(c(NA,1))) Error in sprintf("%d", as.numeric(c(NA, 1))) : invalid
2008 Mar 06
1
kruskal wallis post hoc test in R
Hello, I need nemenyi-test or any other post-hoc test for kruskal-wallis, but I just can't find out how to implement this in R. My data set is nitrite concentrations in four different groups which I intend to compare. The kruskal-wallis-test showed significance, but I still don't know between which groups these significances are. Can anybody help me with this? Thanks
2009 Jun 03
1
Print bug for matrix(list(NA_complex_, ...))
In R 2.8.0 on Windows (tested both under ESS and under R Console in case there was an I/O issue) There is a bug in printing val <- matrix(list(NA_complex_,NA_complex_),1). > dput(val) structure(list(NA_complex_, NA_complex_), .Dim = 1:2) > print(val) [,1] [1,] [,2] [1,] Note that a large number of spaces are printed instead of NA. Compare the unproblematic real case:
2017 May 23
2
Inconsistency in handling of numeric input with %d by sprintf
https://github.com/Rdatatable/data.table/issues/2171 The fix was easy, it's just surprising to see the behavior change almost on a whim. Just wanted to point it out in case this is unknown behavior, but Evan seems to have found this as well. On Tue, May 23, 2017 at 12:00 PM, Michael Chirico <michaelchirico4 at gmail.com > wrote: > Astute observation. And of course we should be
2019 May 31
2
[patch] add sanity checks to quantile()
The attached patch adds some sanity checks to the "type" argument of quantile(). Output from the following commands show the change of behavior with the current patch: vec <- 1:10 quantile(vec, type = c(1, 2)) quantile(vec, type = 10) quantile(vec, type = "aaa") quantile(vec, type = NA_real_) quantile(vec, type = 4.3) quantile(vec, type = -1) Current behavior
2015 Jun 01
2
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
I'm observing that base::sum(x, na.rm=FALSE) for typeof(x) == "double" is much more time consuming when there are missing values versus when there are not. I'm observing this on both Window and Linux, but it's quite surprising to me. Currently, my main suspect is settings in on how R was built. The second suspect is my brain. I hope that someone can clarify the below
2008 Apr 11
1
Vegan dataframe not acting nicely
This is what my data looks like DOC TOC TKN RM119mFeb-06 1 2 3 RM61mFeb-06 2 4 6 I have this both in a .csv and .txt I have read this in with read.csv("chemodr.csv", header=T) and this is what I get X dAmon DN.N Nitrite.N DOC OP P TKN TOC 1 RM215mFeb-06 0.000 0.1300 0.0000 2.5
2023 Nov 06
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
Hmm, it is not actually at odds with help(c), it is just that the autocoercion works different that it used to, so that as.complex(NA) == as.complex(NA_real) == NA_real_+0i) which now differs from NA_complex although both print as NA. I haven't been quite alert when this change was discussed, but it does look a bit unfortunate that usage patterns like c(NA, 0+1i) does not give complex NA
2020 Jan 01
2
New R function is.nana = is.na & !is.nan
Hello R-devel, Best wishes in the new year. I am writing to kindly request new R function so NA_real_ can be more easily detected. Currently if one wants to test for NA_real_ (but not NaN) then extra work has to be done: `is.na(x) & !is.nan(x)` Required functionality is already at C level so to address my request there is not that much to do. Kevin Ushey made a nice summary of current R C api