Hmmm, in fact I do not understand what you are going to do. Can you tell us what the result of your code should look like?

Uwe Ligges



miya wrote:
Hi everyone,
I am currently working with a very large data set. It is data collected a
few times a day, so there are repeated titles in the data set. I want to
assign an id number to each different title and enter this information in a
directory that I can access whenever I am working with the data.

An example of a data I am workin with follows:

1     title A
2     title C
3     title B
1     title A
2     title B
3     title C
1     title D
2     title A
3     title C
1     title B
2     title A
3     title C

What I have tried thus far is for loops.

r<-matrix(x[,1])
t<-matrix(x[,2])
for(i in 1:length(t)) {
        for(k in 1:length(r)) {
                z = matrix(c(i,t))
                A = "Article A"
                        for(j in 1:length(z)){
                                if(B=="Article A")

                                else{enter article in z}
                        }
}

This is of course giving me a lot of errors. I just have no idea where to go
with this. Does anyone have any ideas on where I can go from here to create
my directory?
I appreciate all your help.
Thank you in advance.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to