similar to: Replacing 0s with NA

Displaying 20 results from an estimated 10000 matches similar to: "Replacing 0s with NA"

2006 Nov 07
1
OBS in Column 1
Hello R Freaks, is there a way to omit the counts in the first column of a data.frame. Thanks a lot for your help Thorsten
2005 May 02
1
newbie ifelse matrix question
Hi all, I have time series data in a matrix format 20 rows x 205 columns and have been trying to replace outliers with NA. My first column contains the outliers threshold (3 Standard deviations) for each row - here's a bit of the first row sd3 V1 V2 V3 V4 V5 V6 V7 V8 V9 1 13.03267 1797157 75 84 58 -1.958649 0.048775 2.056198 8.063622
2010 Oct 04
3
How To Extract Row from A Data Frame
I have a data frame that looks like this: > print(df) V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 1 FN 8.637 28.890 31.430 31.052 29.878 33.215 32.728 32.187 29.305 31.462 2 FP 19.936 30.284 33.001 35.100 30.238 34.452 35.849 34.185 31.242 35.635 3 TN 0.000 17.190 16.460 21.100 17.960 15.120 17.200 17.190 15.270 15.310 4 TP 22.831 31.246 33.600 35.439 32.073
2012 Jan 08
1
creating vectors from data-frames
I am having a problem with creating a vector from a rows or columns, I searched around and found as.vector(x), but it does not seem to do what it says it does I have included an example below, of doing what would seem to be the method required to create a vector, but instead it creates a one row data frame. What is required to actually create a vector. Many thanks Philip > data
2013 Feb 15
3
datos climáticos cambio de formato
Hola!! tengo un data.frame donde cada fila corresponde a un año y cada columna a un mes (De enero a diciembre) > head(valT) V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 1941 18.0 16.3 15.2 10.1 8.1 8.3 8.8 9.2 7.9 12.2 11.9 14.6 1942 17.2 15.9 13.6 11.6 8.7 6.2 6.4 7.2 9.7 12.0 14.1 16.7 1943 17.6 17.3 13.5 12.5 10.5 7.0 8.2 7.9 -999.9 -999.9
2005 Jan 06
2
patterns of missing data: determining monotonicity
Here is a problem that perhaps someone out here has an idea about. It vaguely reminds me of something I've seen before, but can't place. Can anyone help? For multiple imputation, there are simpler methods available if the patterns of missing data are 'monotone' --- if Vj is missing then all variables Vk, k>j are also missing, vs. more complex methods required when the
2005 Oct 28
3
replacing a factor value in a data frame
Hi All, I have the following problem, that's driving me mad. I have a dataframe of factors, from a genetic scan of SNPs. I DO have NAs in the dataframe, which would look like: V4 V5 V6 V7 V8 V9 V10 1 TT GG TT AC AG AG TT 2 AT CC TT AA AA AA TT 3 AT CC TT AC AA <NA> TT 4 TT CC TT AA AA AA TT 5 AT CG TT CC AA AA TT 6 TT CC TT AA AA AA TT 7 AT CC
2009 Aug 27
5
Help on efficiency/vectorization
Dear R users, I am trying to extract the rownames of a data set for which each columns meet a certain criteria. (condition - elements of each column to be equal 1) I have the correct result, however I am seeking for more efficient (desire vectorization) way in implementing such problem as it can get quite messy if there are hundreds of columns. Arbitrary data set and codes are shown below for
2013 Feb 28
1
help for an R automated procedures
Dear, I would like to post the following question to the r-help on Nabble (thanks in advance for the attention, Gustavo Vieira): Hi there. I have a data set on hands with 5,220 cases and I'd like to automate some procedures (but I have almost no programming knowledge). The data has some continuous variables that are grouped by 2 others: the name of species and the locality where they were
2004 Sep 15
3
Read.fwf
Dear List I have a fixed width file with variables of varying width. The help is pretty transparent for this feature, but I can't seem to figure out how I can make effective use of the package with my data. In my dataset, the first 80 columns are of width 1 followed by other variables with width larger than 1. I think the correct way to do this, by brute force, would be >
2014 Jul 02
2
error al leer una linea desde un archivo de texto
A mi también me funciona para los dos casos: > dat <- read.csv("d11-16.csv", header=FALSE, sep=",", dec=".", skip=11, nrows=1) > dat V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 1 masa total en µg 30.04633 ug PEAKS MUY PEQUENOS NA NA NA NA NA NA NA > dat18 <- read.csv("d11-18.csv", header=FALSE,
2013 Apr 10
3
how to calculate average of each column
Hey All, I have a large dataset and I want to calculate the average of each column then return a new dataset. Here is my question: I dont know if there is a function that can allow me to calculate the average every 60 records of data in the whole dataset, and return a new data frame. Not sure if I have to divide the dataset first for every 60, then do the mean or can i directly do that. thanks
2005 Oct 13
1
expand.grid problem
Hi all, I want to make all possible combination from dataset below: V1 <- c(0,1,2) V2 <- c(0,1) V3 <- c(0,1) V4 <- c(0,1) V5 <- c(0,1) V6 <- c(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20) V7 <- c(0,1,2,3,4,5,6) V8 <- c(0,1) V9 <- c(0,1) V10 <- c(0,1) V11 <- c(0,1) V12 <- c(0,1) V13 <- c(0,1) V14
2012 Aug 15
2
to remove columns and rows
Dear, I am using R I'm trying to identify and remove columns and rows in a data frame that are has elements equals. For example in dataframe below. The columns 1, 2,3,4,5 ,6 and 10 (file1) has elements equal then should be removed. How can I ask R to remove those columns with same elements in new dataframe (file2) to result a matrix as follows: file1 1 0 2 2 1 1 5 1 1 1 1 0
2004 Aug 03
4
How to select a whole column? Thanks!
Dear all, I hope to remove a whole column from a data frame or matrix (> 2000 columns). All value in the column are same. The first thing is to select those columns. For instance, I hope to remove the V3~6 column, for all the value in those colume is zero. V3 V4 V5 V6 V7 V8 V9 V10 1 0 0 0 0 0.000 0.000 0.000 0.000 2 0 0 0 0 0.000 0.000 0.000 0.000 3 0 0 0
2012 Jun 15
8
Apply() on columns
Hi, I have some trouble with the following: I have a table of 7 rows and 6columns. The columns 1,2,3 have information about the number of employees. The columns 4,5,6 have information about the number of working hours. Each row, is corresponding with a week. My goal is to make a boxplot, histogram etc. of the columns 4, 5 and 6 (thus, the data of the number of working hours). How can I select by
2011 Sep 01
2
how to plot a series of data in a dataframe?
hi i have a dataframe with the name "obsdata" V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 1 1001 3 24 12 24.7 44.4 70.1 49.3 33.7 3.0 6.8 2.7 NA 2 1001 3 25 0 70.1 49.3 33.7 138.2 152.5 NA 4.2 6.9 17.5 3 1001 3 25 12 33.7 187.7 286.5 386.7 NA 16.2 46.0 48.8 43.1 4 1001 3 26 0 88.6 129.4 NA NA
2012 Feb 13
2
see NA
Dear All I want to chose just spacial columns in R. (read table) data1<- read.table("/home/Documents/data.txt",header=F,sep = "\t", as.is =F) data.2<-data1[sub.data[,1],] The dimension of data.2 is correct but my data are transformed NA head(data.2) V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21 V22 V23 V24 NA <NA> NA NA NA
2015 Aug 22
3
sprintf error: "only 100 arguments allowed"
I'm trying to apply a function defined in the VW R docs, that attemps to convert a data.table object to Vowpal Wabbit format. In the process i'm getting the error in printf mentioned in the subject. The original function is here: https://github.com/JohnLangford/vowpal_wabbit/blob/master/R/dt2vw.R Below there is a small example that reproduces the error. The function works great with
2011 May 25
2
Fwd: transpose ?
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20110525/4926c5ee/attachment.pl>