similar to: how to ignore "NA" or replace it by another value

Displaying 20 results from an estimated 20000 matches similar to: "how to ignore "NA" or replace it by another value"

2006 Sep 21
2
delete a entire vector of a dataframe
delete a entire vector of a dataframe Hello, i want to delete a vector and tried "rm (t.d$V712)". This did not work, message was, could not find variable. I thought the $ defines the vectro in a dataframe, when I just type "t.d$V712" the content of this vector is displayed. Greetings, Thomas
2007 Feb 23
6
TRUE/FALSE as numeric values
Hello, I want to select in a column of a dataframe all numbers smaller than a value x but when I type in test<-(RSF_EU$AREA<=x) I receiv as answer: > test [1] TRUE FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE [18] TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE [35] FALSE TRUE
2006 Oct 13
1
NA-handling in glm.fit?
Dear Sir or Madam, I'm wondering if there is any routine or argument in the function 'glm.fit' that makes it handle NA's. The function 'glm' can handle NA's but I can't make make it work (or find anything written on this in the help files) with 'glm.fit'. Is it even possible in'glm.fit'? How? Thanks before hand, Fredrik Thuring, Business Researcher
2009 Aug 08
2
Factor Analysis in R
Hi I am trying to run Factor Analysis using R...I am using the syntax factanal(m1, factors=3) but it's giving me an message Error in cov.wt(z) : 'x' must contain finite values only ...I am using a data set which is having only numeric variables and have some NA's also in it..What should I do next..Someone please help me out with the syntax..Thanks in advance Cheers Arup --
2006 Jun 12
3
NA values
Dear all R users, I am wondering whether there is any way to replace all "NA" values in a data frame by some numerical value, suppose 1000? Thanks and Regards [[alternative HTML version deleted]]
2009 Aug 28
1
Plotmath, sweave and lattice graphics interaction problem
Dear List, I have hit this problem with using a plotmath expression in an axis label on a lattice plot I'm including in a Sweave document. The actual document is far too long and boring (unless you are interested in the hydrochemistry of upland lakes) to include here, but the following minimal example reproduces the problem; basically, the PDF produced by Sweave has missing characters in the
2009 Aug 26
1
Batch replacement, by factor, of values in a data frame
Dear List, I'm wondering if there is a better/cleaner/more efficient way of replacing 0 values in a variable with the minimum of the non-missing and non-zero values of that same variable, but doing it within the levels of a factor? Consider the dummy example data presented at the end of my message. Within each 'Site' there are some 0 values and possibly some NA's. I can compute
2010 Jan 19
5
OT: Software for specific visualisation of data...ideas?
Dear List, A student in the Department where I work would like to produce a graphic similar to this one: http://image.guardian.co.uk/sys-files/Guardian/documents/2009/09/16/Public_spending_160909.pdf Does anyone know if the figure in the pdf can be generated in a specific software application for example? Any suggestions would be most gratefully received by the student concerned. Many thanks,
2004 Nov 04
3
sub- and superscript in plot labels
Dear List, I need to add a subscript and a superscript to some of the ions in the labels on some plots. I have got to here but now I'm stuck: plot(1:10, xlab = expression(paste("nm SO"[4], " ", mu, "eq cm"^{-2}, " yr"^{-1}))) Which gives almost what I require. No matter what I tried, however, I could not get bot a sub script *and* a superscript
2009 Jun 12
3
Replacing 0s with NA
Hello I have a dataset in which I would like to replace 0s with NAs. There is a lot of information on how to replace NAs with 0, but I have struggled to find anything with regards to doing the reverse. Any recommendations would be great. Cheers Christine
2012 Dec 29
2
Error in plot.envfit(ef, p.max = 0.1) : (subscript) logical subscript too long
Hello there, I'm trying to plot vectors with p<0.1 in a NMDS ordination plot using p.max. Below the scripts I'm using. I guess I'm missing something! could you please give me a hand? species<-metaMDS(species_matrix)ef<-envfit(species,environmentaldata_file,permu=999,na.rm=TRUE)efplot(species, dis="sites")plot(ef,p.max=0.1) Error in plot.envfit(ef, p.max = 0.1) :
2010 Oct 05
2
loess and NA
Hi everyone. I'm trying to do a loess with missing value on independant variable. doc = c(2.27904, 2.59536, 7.44696, NA, 6.24264, 4.58400, 5.79192, 5.39502, 7.41216, 4.09440, 4.22868, 4.24620, 5.43804, 1.95528); distance = c(26.5,56.5, 90.3, 123.0, 147.5, 176.0, 215.7, 229.3, 252.0, 325.3, 362.0, 419.3, 454.6, 470.0); myloess = loess(doc ~ distance, na.action = na.omit); plot(distance,
2009 Sep 04
1
NA in cca (vegan)
Dear all, I would like to calculate a cca (package vegan) with species and environmental data. One of these environmental variables is cos(EXPOSURE). The problem: for flat releves there is no exposure. The value is missing and I can't call it 0 as 0 stands for east and west. The cca does not run with missing values. What can I do to make vegan cca ignoring these missing values? Thanks a lot,
2009 Sep 15
5
identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????
Dear R, the condition: identical(length(x),1) returns FALSE but print(length(x)) returns 1 and: is.vector(x) is TRUE. is.integer(length(x)) is TRUE length(x) ==1 is TRUE I am puzzled. Regards -- Corrado Topi Global Climate Change & Biodiversity Indicators Area 18,Department of Biology University of York, York, YO10 5YW, UK Phone: + 44 (0) 1904 328645, E-mail: ct529 at york.ac.uk
2006 Oct 31
3
one problem about how to hold graphic with R
Sorry to disturb you, but can you help me to solve one little problem? I want to draw a graphic after another with R but I cannot find the first one after that. Do you know the command to hold the graphic with R? I remember with Matlab you may use "hold on". Thanks. -- Baohua Yang Email:yangbaohua@gmail.com [[alternative HTML version deleted]]
2005 May 16
2
Fitting Contour to Data Points
Apologies for the mass mailing today! I am attempting to produce a contour plot for phsical data on a map matrix. I have a small number of data points which each has an (x,y) co-ordinate together with a corresponding value which I would like to cvreate a contour plot for. I have tried the following code: contour(data$x,data$y,data$value) but am told: Error in contour.default(data$x, data$y,
2011 Jan 27
3
agnes clustering and NAs
Hello, In the documentation for agnes in the package 'cluster', it says that NAs are allowed, and sure enough it works for a small example like : > m <- matrix(c( 1, 1, 1, 2, 1, NA, 1, 1, 1, 2, 2, 2), nrow = 3, byrow = TRUE) > agnes(m) Call: agnes(x = m) Agglomerative coefficient: 0.1614168 Order of objects: [1] 1 2 3 Height (summary): Min. 1st Qu. Median Mean 3rd
2005 Aug 16
2
problem using model.frame()
Hi I'm having a problem with model.frame, encapsulated in this example: y1 <- matrix(c(3,1,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1), nrow = 5, byrow = TRUE) y1 <- as.data.frame(y1) rownames(y1) <- paste("site", 1:5, sep = "") colnames(y1) <- paste("spp", 1:4, sep = "") y1 model.frame(~ y1) Error in model.frame(formula, rownames,
2006 Oct 17
2
Predicted value at a new level in lm
Y X Z 42.0 7.0 33.0 33.0 4.0 41.0 75.0 16.0 7.0 28.0 3.0 49.0 91.0 21.0 5.0 55.0 8.0 31.0 data<-read.table("d.txt",header=TRUE) mod<-lm(data$Y~data$X+data$Z) --------------------------------------- I would like to know the predict value at a new level, say X=10 Z=30 Is there a function available to calculate it
2005 Nov 03
4
merging dataframes
Dear List, I often have to merge two or more data frames containing unique row names but with some columns (names) common to the two data frames and some columns not common. This toy example will explain the kind of setup I am talking about: mat1 <- as.data.frame(matrix(rnorm(20), nrow = 5)) mat2 <- as.data.frame(matrix(rnorm(20), nrow = 4)) rownames(mat1) <- paste("site",