similar to: c(), rbind and cbind functions - why type of resulting object is double

Displaying 20 results from an estimated 10000 matches similar to: "c(), rbind and cbind functions - why type of resulting object is double"

2010 May 11
1
functions sample() and S.SI()
Hello, I need to select a sample from a small population using simple random sampling without replacement. I've found two possibilities in R, the function sample() and the function S.SI() in the package TeachingSampling, but I don't know which one is better. Can someone help me? Thank you -- Lourdes Molera Peris M?todos Cuantitativos para la Econom?a y la Empresa Facultad de Econom?a
2008 Jun 26
2
stuck on making a line graph across time, with 4 categories
I can't seem to find just what I'm looking for in R help, Everitt and Hothorn HSAUR, Murrell's book, or the R graphics gallery at http://addictedtor.free.fr/graphiques/. Probably not looking efficiently, but anyway, If my data look like this: > head(data) cat startyear studentid 1 other 2001 12 2 UHS 2001 17 3 Lourdes 2001 10 4
2004 Mar 12
1
double vs. list
Hi all I've got trouble with getting a "list" object and not being able to change that: Lets say x is a simple matrix and I want to remove all elements <3 to get 3 5 7 > x <- matrix(c(1,2,3,5,1,7), nrow=2, ncol=3, byrow=T) > x [,1] [,2] [,3] [1,] 1 2 3 [2,] 5 1 7 > typeof(x) [1] "double" > y <- sapply(c(1,2), function(i)
2005 Apr 13
1
Why is 1 a double?
Based on examples in R books and the syntax of other programming languages, I expected that n <- 10 assigns the integer 10 to n, but typeof(n) is actually a double. The subscripting expression x[1] is valid, but sprintf("\n %d",1) is not, giving the error Error in sprintf("\n %d", 1) : use format %f, %e or %g for numeric objects One must use instead sprintf("\n
2019 Sep 29
2
typeof(getOption("warn")) is "integer" instead of "double" in R unstable (2019-09-27 r77229)? Reproducible?
Hi, I have a failing unit test in my package tryCatchLog on the CRAN build infrastructure (https://cran.r-project.org/web/checks/check_results_tryCatchLog.html) with "R Under development (unstable) (2019-09-27 r77229)" and the unit tests just ensures consistent behaviour of R (not of my package) as a precondition: The failing unit test is caused by >
2010 May 16
1
improvement
Hi, if i just want a vector filled with names which has length(index) > 0. For example if nombreC <- c("Juan", "Carlos", "Ana", "Mar?a") nombreL <- c("Juan Campo", "Carlos Gallardo", "Ana Iglesias", "Mar?a Bacaldi", "Juan Grondona", "Dario Grandineti", "Jaime Acosta",
2019 Sep 29
2
typeof(getOption("warn")) is "integer" instead of "double" in R unstable (2019-09-27 r77229)? Reproducible?
Thanks a lot for pointing out the reason (and yes, I am testing quite to stringent in this case - it's my old testing disease ;-) For other readers: The R-devel NEWS is a good source to find possible change reasons: https://stat.ethz.ch/R-manual/R-devel/doc/html/NEWS.html On Sun, 2019-09-29 at 08:33 -0400, Duncan Murdoch wrote: > On 29/09/2019 7:55 a.m., nospam at altfeld-im.de wrote:
2012 May 22
2
how to remove the 'promise' attribute of an R object (.Random.seed)?
Hi, The problem arises when I lazyLoad() the .Random.seed from a previously saved database. To simplify the process of reproducing the problem, see the example below: ## this assignment may not really make sense, but illustrates the problem delayedAssign('.Random.seed', 1L) typeof(.Random.seed) # [1] "integer" rnorm(1) # Error in rnorm(1) : # .Random.seed is not an integer
2012 May 22
2
how to remove the 'promise' attribute of an R object (.Random.seed)?
Hi, The problem arises when I lazyLoad() the .Random.seed from a previously saved database. To simplify the process of reproducing the problem, see the example below: ## this assignment may not really make sense, but illustrates the problem delayedAssign('.Random.seed', 1L) typeof(.Random.seed) # [1] "integer" rnorm(1) # Error in rnorm(1) : # .Random.seed is not an integer
2011 Feb 02
3
Applying multiple functions to one object
Dear list members, I recall seeing a convenience function for applying multiple functions to one object (i.e., almost the opposite of 'mapply?) somewhere. Example: If the function was named ?fun? the output of fun(3.14, mode, typeof, class) would be identical to the output of c(mode(3.14), typeof(3.14), class(3.14)) Is my memory failing me, or does such a function already exists in a
2007 Sep 21
0
(PR#9917) rbind.data.frame converts character column to
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --27464147-159404577-1190380210=:1425 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Please do read the documentation, which says The 'rbind' data frame method first drops all zero-column
2014 Apr 02
3
Typeof for character vector in dataframe returns integer
Hi , I want to know is this behavior expected and why is that ? Need some help gender <- c("F", "M", "M", "F", "F", "M", "F", "F") > age <- c(23, 25, 27, 29, 31, 33, 35, 37) > df<- data.frame(gender,age) > typeof(df[[1]]) [1] "integer"
2020 Jun 30
2
[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y
On Tue, Jun 30, 2020 at 7:39 PM Will Deacon <will at kernel.org> wrote: > +#define __READ_ONCE(x) \ > +({ \ > + int atomic = 1; \ > + union { __unqual_scalar_typeof(x) __val; char __c[1]; } __u; \ > +
2020 Jun 30
2
[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y
On Tue, Jun 30, 2020 at 7:39 PM Will Deacon <will at kernel.org> wrote: > +#define __READ_ONCE(x) \ > +({ \ > + int atomic = 1; \ > + union { __unqual_scalar_typeof(x) __val; char __c[1]; } __u; \ > +
2004 Sep 08
4
factor always have type integer
typeof applied to a factor always seems to return "integer", independently of the type of the levels. This has a strange side effect. When a variable is "imported" into a data frame, its type changes. character variables automatically are converted to factors when imported into data frames. Here is an example: > v1<-1:3 >
2011 Aug 07
2
[PATCH] kinit minor checkpatch cleanup
coding style fixes. FIXME: check that compiled bin the same1!! --- usr/kinit/initrd.c | 3 ++- usr/kinit/kinit.c | 12 ++++-------- usr/kinit/kinit.h | 20 ++++++++++---------- usr/kinit/name_to_dev.c | 6 +++--- usr/kinit/nfsroot.c | 5 ++--- 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/usr/kinit/initrd.c b/usr/kinit/initrd.c index
2009 Mar 30
1
what is R equivalent of Fortran DOUBLE PRECISION ?
I noticed taht R cannot understand certain Fortran real constant formats. For instance: c14 <- as.double( 7.785205408500864D-02) Error: unexpected symbol in " c14 <- as.double( 7.785205408500864D" The above "D" is used in Fortran language to indicate the memory starage mode. That is for instructing Fortran compiler to store such a REAL constant in DOUBLE
2019 May 23
4
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On Thu, 23 May 2019 08:10:44 -0700 Linus Torvalds <torvalds at linux-foundation.org> wrote: > On Thu, May 23, 2019 at 7:00 AM Steven Rostedt <rostedt at goodmis.org> wrote: > > > > +# define roundup_64(x, y) ( \ > > +{ \ > > + typeof(y) __y = y;
2010 Feb 10
3
What is the difference between typeof and storage.mode?
S Programming by Venables and Ripley (2000) says on page 8, "R objects have another way to give information using the function \tttext{typeof}, which often gives the same information as \tttext{storage.mode}." It implies that there are some differences between typeof and storage.mode. However, according to ?typeof and ?storage.mode, it doesn't seem to be so. Could somebody let me
2013 Mar 22
1
Why does typeof() modify an object's "named" field?
Hello, Doing typeof() on an object appears to reset the "named" field in its sxpinfo header to 2, which can change the way that subsequent subassignment operations are carried out: X <- 1:5e7 .Internal(inspect(X)) # @4eeb0008 13 INTSXP g0c7 [NAM(1)] (len=50000000, tl=0) 1,2,3,4,5,... system.time(X[1] <- 9L) # user system elapsed # 0 0 0 typeof(X)