2
Hello,
I’m trying to manipulate a database with 300+ observations, but each observation has a different number of columns. The problem is that from a certain point, the columns start to repeat themselves, but they have different values and I wanted to somehow join them.
What I essentially want is, within an object, to save the information of each observation in a way that helps in the visualization.
For example:
a b c d e c d e c d e
Obs_1 AA BB CC 8.3 A SSD 2.3 RN S76 5 A
Obs_2 SS DA LL 5 A SDD AD23 8.2 A
And I’d like to turn it into something like this:
a b c d e
Obs_1 AA BB CC76 8.3 A
SSD89 2.3 RN
S76 5 A
Obs_2 SS DA LL 5 A
SDD
AD23 8.2 A
Is it possible to do this in a non-manual way in R? Note that there are values in the database that have no value, some values R complete with NA, others it simply leaves blank.
Please, if the data.frame is called
dados
, edit the question with the output ofdput(head(dados, 20))
, to have an exact copy of the data structure.– Rui Barradas
The way the question was asked, without a sample dataset, and difficult to understand exactly the nature of the problem.
– Flavio Barros