Re: [R] Filling a variable with unmentioned categories

2011-11-18 Thread jim holtman
will this work for you: > str(x) 'data.frame': 10 obs. of 2 variables: $ price: chr "0,00" "0,00" "0,02" "0,03" ... $ mentioned: int 1 1 1 1 1 1 1 1 1 1 > # create vector with range of 'price' > allPrices <- paste('0,', sprintf("%02d", 0:19), sep = '') > # find missing prices and add wi

Re: [R] Filling a variable with unmentioned categories

2011-11-18 Thread Milan Bouchet-Valat
Le vendredi 18 novembre 2011 à 15:06 +, Mario Giesel a écrit : > Hello, list, > > I've been struggling with this task for a while looking for an efficient way > to solve it: > There are two variables 'price' and 'mentioned'. > I want to 'enlarge' data so that missing price points within the p

[R] Filling a variable with unmentioned categories

2011-11-18 Thread Mario Giesel
Hello, list,   I've been struggling with this task for a while looking for an efficient way to solve it: There are two variables 'price' and 'mentioned'. I want to 'enlarge' data so that missing price points within the price range are added to variable price. Also variable 'mentioned' is to recei