naxvictory.blogg.se

How to modify data in spss 16 modler
How to modify data in spss 16 modler





how to modify data in spss 16 modler

The set of new values will have to be the same size as the set of values that you are replacing. Now all you have to do is assign a new set of values to these old values.

how to modify data in spss 16 modler

Or, even better, you can subset the column vector deck2$value: deck2 You can single out just the values of the aces by subsetting the columns dimension of deck2. Hence, you can describe them with R’s notation system: deck2 To play war, you just need to change the values of your aces from 1 to 14.Īs long as you haven’t shuffled your deck, you know just where the aces are. Every other card gets the value that it already has in deck. They receive the highest value of all the cards, which would be something like 14. In the game of war, aces are king (figuratively speaking). You can also remove columns from a data frame (and elements from a list) by assigning them the symbol NULL: deck2 $new <- NULL head(deck2) This provides a great way to add new variables to your data set: deck2 $new <- 1 : 52 head(deck2) R will expand the object to accommodate the new values: vec <- 0 You can also create values that do not yet exist in your object. You can replace multiple values at once as long as the number of new values equals the number of selected values: vec <- c( 1, 1, 1) Here’s how you can select the first value of vec: vecĪnd here is how you can modify it: vec <- 1000 Let’s put this into action with a real example: vec <- c( 0, 0, 0, 0, 0, 0) R will update the selected values in the original object. Then use the assignment operator <- to overwrite those values. First, describe the value (or values) you wish to modify. You can use R’s notation system to modify values within an R object.







How to modify data in spss 16 modler