similar to: head with non integer n returns confusing output

Displaying 20 results from an estimated 10000 matches similar to: "head with non integer n returns confusing output"

2008 Oct 09
1
YALAQ - Yet Another LApply Question
Hello, Two lapply questions (system info and sample data below): 1) Why does the first form of command1 add the name of y _after_ the str() output rather than before as does the second (preferred) form? # command1 version1 invisible(lapply(ls(pattern='bn'), function(y) cat(y, "\n", str(get(y)), "\n") )) # command1 version2 (preferred output)
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
2017 Oct 13
0
Populate one data frame with values from another dataframe for rows that match
Hello, Try the following. myDF1$studyno <- as.character(myDF1$studyno) myDF2$studyno <- as.character(myDF2$studyno) i1 <- which(names(myDF1) == "pf_mcl") merge(myDF1[-i1], myDF2, by = "studyno") Hope this helps, Rui Barradas Em 13-10-2017 20:09, Kevin Wamae escreveu: > I'm trying to populate the column ?pf_mcl? in myDF1 with values from myDF2, where rows
2017 Oct 13
0
Populate one data frame with values from another dataframe for rows that match
?merge Bert On Oct 13, 2017 12:09 PM, "Kevin Wamae" <KWamae at kemri-wellcome.org> wrote: > I'm trying to populate the column ?pf_mcl? in myDF1 with values from > myDF2, where rows match based on column "studyno" but the solutions I have > found so far don't seem to be giving me the desired output. > > Below is a snapshot of the data.frames. >
2017 Oct 13
4
Populate one data frame with values from another dataframe for rows that match
I'm trying to populate the column ?pf_mcl? in myDF1 with values from myDF2, where rows match based on column "studyno" but the solutions I have found so far don't seem to be giving me the desired output. Below is a snapshot of the data.frames. myDF1 <- structure(list(studyno = c("J1000/9", "J1000/9", "J1000/9", "J1000/9",
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
Identified as root cause of a bug in data.table: https://github.com/Rdatatable/data.table/issues/3267 On my machine, strtoi("", base = 2L) produces NA_integer_ (which seems consistent with ?strtoi: "Values which cannot be interpreted as integers or would overflow are returned as NA_integer_"). But on all the other machines I've seen, 0L is returned. This seems to be
2017 Oct 14
0
Populate one data frame with values from another dataframe for rows that match
Hi Kevin, I think there are issues with Rui's proposed solution. For example, if there are rows in myDF1 which have a studyno which does not match any row in myDF2, then you will lose those rows. In your original request you said that you wanted to keep those rows. To demonstrate my point I need to modify your sample data. Specifically, I changed some studyno settings in myDF1, and also the
2017 Oct 14
0
Populate one data frame with values from another dataframe for rows that match
Your example used one distinct studyno in DF1 and one distinct pf_mcl in DF2. I think that makes it hard to see what is going on, but maybe I completely misunderstand the problem. In any case, let's redefine myDF1 and myDF2. Note that myDF1 contains a studyno not in myDF2 and vice versa. myDF1 <- structure(list(studyno = c("J1000/9", "J895/7", "J931/6",
2019 Jan 11
2
strtoi output of empty string inconsistent across platforms
>>>>> Martin Maechler >>>>> on Fri, 11 Jan 2019 09:44:14 +0100 writes: >>>>> Michael Chirico >>>>> on Fri, 11 Jan 2019 14:36:17 +0800 writes: >> Identified as root cause of a bug in data.table: >> https://github.com/Rdatatable/data.table/issues/3267 >> On my machine, strtoi("", base =
2019 Jan 11
0
strtoi output of empty string inconsistent across platforms
>>>>> Michael Chirico >>>>> on Fri, 11 Jan 2019 14:36:17 +0800 writes: > Identified as root cause of a bug in data.table: > https://github.com/Rdatatable/data.table/issues/3267 > On my machine, strtoi("", base = 2L) produces NA_integer_ > (which seems consistent with ?strtoi: "Values which cannot > be
2019 Jan 12
0
strtoi output of empty string inconsistent across platforms
Thanks Martin. For what it's worth, this extremely representative, highly scientific Twitter poll suggests the Mac/Linux split is pretty stark (NA on Mac, 0 on Linux) https://twitter.com/michael_chirico/status/1083649190117306369?s=17 On Sat, Jan 12, 2019, 2:00 AM Martin Maechler <maechler at stat.math.ethz.ch wrote: > >>>>> Martin Maechler > >>>>>
2017 Oct 15
1
Populate one data frame with values from another dataframe for rows that match
Dear @William<mailto:wdunlap at tibco.com>, thanks for the feedback. I have tested it on the larger dataset and noticed that it created two variables, pf_raw and pf_curated. The output we were looking for, was one that takes the variable pf_mcl in curated dataset and replaces pf_mcl in matching rows within the raw dataset. @Eric<mailto:ericjberger at gmail.com>?s solution was able to
2020 May 23
0
Should 0L * NA_integer_ be 0L?
>>>>> Michael Chirico >>>>> on Sat, 23 May 2020 18:08:22 +0800 writes: > 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
2017 Oct 14
2
Populate one data frame with values from another dataframe for rows that match
Dear @Rui Barradas, thank you for the solution. It works perfectly. On 13/10/2017, 23:35, "Rui Barradas" <ruipbarradas at sapo.pt> wrote: Hello, Try the following. myDF1$studyno <- as.character(myDF1$studyno) myDF2$studyno <- as.character(myDF2$studyno) i1 <- which(names(myDF1) == "pf_mcl") merge(myDF1[-i1], myDF2,
2017 Oct 14
2
Populate one data frame with values from another dataframe for rows that match
Dear @Bert Gunter<mailto:bgunter.4567 at gmail.com>, I tried merge and I faced many challenges. @Rui Barradas<mailto:ruipbarradas at sapo.pt> solution is working. From: Bert Gunter <bgunter.4567 at gmail.com> Date: Friday, 13 October 2017 at 22:44 To: Kevin Wamae <KWamae at kemri-wellcome.org> Cc: R-help <R-help at r-project.org> Subject: Re: [R] Populate one data
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. >
2016 Jan 27
0
Suggestions for improvement as regards `as` methods, and a call for consistency in `as.Date` methods
Good evening all, This topic is gone into at a bit more length at my related Stack Overflow question here: http://stackoverflow.com/questions/34647674/why-do-as-methods-remove-vector-names-and-is-there-a-way-around-it There are two lingering issues despite the abundant insight received at SO, namely: 1) _Why_ do as methods remove their arguments' names attribute? This is a fact which is
2014 Aug 07
1
RFC: diag(x, n) not preserving integer and logical x
This is not at all something new(*). As maintainer of the Matrix package, I don't like this inconsistency of base R's diag(). We have had the following -- forever, almost surely inherited from S and S+ : diag(x) preserves the storage mode of x for 'complex' and 'double' precision, but converts integer and logicals to double : > storage.mode(x <- 1i + 1:7);
2014 Jun 04
2
error de incompatible methods
Hola Daniel, si perdona di a responder directamente y no me di cuenta. Ya se donde esta el error, pero queria preguntar si a puede ser que mi R funcione mal o algo porque esta manhana ejecute mi script y funciono perfectamente y ahora volvi a ejecutarlo y me volvio a dar el mismo problema de ayer , despues de reiniciar y demas el tinnR y el R, no se si me vacila o es que tengo algo mal en
2016 Jul 16
1
sample() fails with double or integer NA input of length one
Hi, I have discovered that sample() fails with an uninformative error message when the x argument is a single NA of type double or integer. I can reproduce the problem with the following code: base::sample(NA) # NA is of logical type above base::sample(NA_character_) base::sample(NA_complex_) base::sample(NA_real_) base::sample(NA_integer_) The last two lines throw the following error: Error