similar to: Inconsistent handling of character NA?

Displaying 20 results from an estimated 10000 matches similar to: "Inconsistent handling of character NA?"

2009 Jul 10
3
strange strsplit gsub problem 0 is this a bug or a string length limitation?
I was working with the rmetrics portfolioBacktesting function and dug into the code to try to find why my formula with 113 items, i.e. A1 thru A113, was being truncated and I only get 85 items, not 113. Is it due to a string length limitation in R or is it a bug in the strsplit or gsub functions, or in my string? I'd very much appreciate any suggestions ============Input script:
2003 Aug 15
6
plot.lm mislabels points with na.exclude (PR#3750)
R 1.7.1 on Windows XP The "normal Q-Q plot" produced by plot.lm() mislabels points when the model is fitted using na.action=na.exclude. Example: x <- 1:50 y <- x + rnorm(50) y[c(5,10,15)] <- NA # insert some NA's y[40] <- 50 # add an outlier plot(lm(y ~ x, na.action=na.omit)) # outlier correctly labeled in all # four plots
2005 Jul 07
3
What method I should to use for these data?
Dear R user: I am studying the allele data of two populations. the following is the data: a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 pop1 0.0217 0.0000 0.0109 0.0435 0.0435 0.0000 0.0109 0.0543 0.1739 0.0761 0.1413 0.1522 0.1087 0.0870 0.0435 0.0217 0.0109 pop2 0.0213 0.0213 0.0000 0.0000 0.0000 0.0426 0.1702 0.2128 0.1596 0.1809 0.0957 0.0745 0.0106
2018 Sep 11
1
var() with 0-length vector -- docs inconsistent with result
R 3.5.1 on Windows 7 The documentation for 'var' says: "These functions return 'NA' when there is only one observation (whereas S-PLUS has been returning 'NaN'), and fail if 'x' has length zero." The function 'sd' (based on 'var') has similar documentation. However, I get: var(numeric(0)) [1] NA rather than an error. Personally I
2013 Jun 27
1
'modifyList' drops (not adds) NULL components
Dear list, Utils::modifyList() drops NULL components in its second argument, instead of adding them to the first argument. Compare: > modifyList(x=list(A=1), val=list(B=2, C=3)) $A [1] 1 $B [1] 2 $C [1] 3 > modifyList(x=list(A=1), val=list(B=NULL, C=3)) $A [1] 1 $C [1] 3 To me this seems inconsistent with the documentation ("Elements in 'val' which are missing from
2019 Oct 25
3
register spilling and printing live variables
Hello, I have studied register allocation in theoretical aspects and exploring the same in the implementation level. I need a minimal testcase for register spilling to analyze spilling procedure in llvm. I tried with a testcase taking 20 variables but all the 20 variables are getting stored in the stack using %rbp. Maybe my live variable analysis is wrong. Please help me with a minimal testcase
2003 Jul 21
2
Bug in file.copy: overwrite=FALSE ignored (PR#3529)
I am using R 1.7.1 on Windows XP Pro. The 'overwrite=FALSE' argument appears to be ignored in file.copy(): > file.exists(c("file1.txt", "file2.txt")) [1] TRUE TRUE > file.copy(from="file2.txt", to="file1.txt", overwrite=FALSE) [1] TRUE > and sure enough, file1.txt has been overwritten. Rich Raubertas Biometrics Research, RY33-300 Merck
2011 Aug 25
4
{R} How to extract correctly from vector?
Dear list, I have problem that I cannot solve and would like to ask your opinion. I tried to ask a few days ago already but got no answer and all my attempts to solve it by myself since then failed. Sorry for repeated posting! Here the problem broken down a bit. My problem basically is, that I want to use the elements of a character vector as names for objects and by recalling only the
2002 Apr 23
2
Bug in read.table() (PR#1477)
The following command, temp <- read.table("c:/rfr/r/test.txt") reads the text file "test.txt", which contains the following lines: 21437 21438 21419-2 21420-2 21421-2 21422-2 and produces the following result: > temp V1 1 21437+0i 2 21438+0i 3 0+0i 4 0+0i 5 0+0i 6 0+0i > These "numbers" are actually sample ID's, and I
2005 Oct 31
2
nlme error message
Dear Friends, I am seeking for any help on an error message in lme functions. I use mixed model to analyze a data with compound symmetric correlation structure. But I get an error message: "Error in corMatrix.corCompSymm(object) : NA/NaN/Inf in foreign function call (arg 1)". If I change the correlation structure to corAR1, then no error. I have no clue how to solve this problem.
2012 May 05
1
Query about memory used in list and dataframe
Hi, I had a query regarding which object, a list or a dataframe, consumes more R memory. Let me clarify this: For example, I have a df of 6 rows and 12 columns, say 'test'. I do object.size() and find it uses 3.3 KB of memory. I run a loop and make a list, say 'testlist', of 6 elements, each element being the above mentioned df 'test'. The size of this list is 19.9 KB,
2012 Feb 17
5
How to change the order of columns in a data frame?
Dear all, I have a data frame in which the columns need to be ordered. The first column X is at the right position, but the remaining columns X1-Xn should be ordered like this: X1, X2, X3 etc instead of like below. > colnames(pos1) [1] "X" "X1" "X10" "X11" "X12" "X13" "X14" "X15" "X16"
2013 Feb 04
4
If() values in one dataframe then return values from another
I have a large data frame ("data1") that looks like: A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 [1,] 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 [2,] 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 0 0 0 0 [3,] 1 1 0 1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 [4,] 1 1 1 1
2009 Oct 08
2
plotting a set of discrete distributions
I have the following data set, representing the the estimated number of some event (est), when the actual number was 3, 4, ..., 15. The numbers in the cells are the observed *frequencies* of each combination of (actual, estimated), so each column (a3 -- a15) gives a single discrete frequency distribution. Thus, when the actual number was 6, the estimated values were 5,6,7 with frequencies 7,
2005 Sep 20
2
script.aculo.us: pause before effect.appear
I''ve created a simple script (below) which calls the effect.appear script in order to make a group of items appear at the page load. I would like to have the images randomly appear at different times; e.g. the 3rd image might start appearing 2 seconds after load, the 6th image immediately after load, the first image 1 second after load, etc... How can I achieve this affect? ---
2006 Dec 31
7
zero random effect sizes with binomial lmer
I am fitting models to the responses to a questionnaire that has seven yes/no questions (Item). For each combination of Subject and Item, the variable Response is coded as 0 or 1. I want to include random effects for both Subject and Item. While I understand that the datasets are fairly small, and there are a lot of invariant subjects, I do not understand something that is happening
2012 Feb 16
2
how to rbind matrices from different loops
Dear R experts, I am having difficulty using loops productively and would like to please ask for advice. I have a dataframe of ids and groups. I would like to break down the dataframe into groups, find the unique sets of ids, then reassemble. My thought was to use a loop, but I have been unable to finish this loop in a logical way. I would like to find the unique ids for group 1, group 2,
2004 Feb 11
6
AGREP
Hi all, I have two questions 1 - I have the version 1.4.1 of R, and it doesn't have the 'agrep' function in the base library. Is there a way to make this funcion avaliable in R 1.4.1? I mean, how to 'copy' it from R 1.8.1 and 'paste' it in R 1.4.1? 2 - The AGREP function doesn't give me the Levenshtein distance (edit distance). Is there a function in R that does
2008 Jan 08
2
problem when extacting columns of a data frame in a new data frame
Dear R-users, I would like to create a new data frame composed of 2 columns of another data frame. But it does not give me what I want... > casesCNST[1:10,] case X1 X2 X3 X4 expected 1 A1 0 0 0 0 E 2 A2 0 0 0 1 C 3 A3 0 0 0 2 C 4 A4 0 0 0 3 C 5 A5 0 0 0 4 C 6 A6 0 0 1 0 C 7 A7 0 0 1 1 C 8
2003 Jan 13
2
Bug in boxplot(..., add=TRUE) ?
R 1.6.1 on Windows NT4: The boxplot() function appears to draw its own tick marks and axis values even when called with add=TRUE. As a toy example, try x <- rnorm(100) f <- factor(rep(1:4, each=25)) plot(c(0,4), c(-3,3), type="n", xaxt="n", yaxt="n") boxplot(x ~ f, add=TRUE) My expectation is that a high-level plotting function will not mess with the axes