Search results

  1. J

    concatenate - Loop with variables

    Forget this. With "lapply" I did it. By the way, I still need to concatenate the dummies to the original data frame...
  2. J

    concatenate - Loop with variables

    Hi, I need to obtain a set of dummies. Then I need to concatenate every one of them I generated in my simple loop. And that's what I can't figure it out. c=seq(from=1, to=200) region=round(runif(200,min=1,max=10),0) cise=round(runif(200,min=0,max=6),0) data=cbind(c,region,cise) attach(data)...
  3. J

    concatenate - Loop with variables

    Hello, I have a data frame. I generated some dummies using a simple loop. However, I can't concatenate the dummies to the original data frame. yyy=max(region) for (i in 1:yyy) { nam=paste("region",i,sep="") assign(nam,as.numeric(cise>0 & region==i))...
  4. J

    How can I report common strings in array/dataframe

    Thanks, Dason. You are very kind. I think this thread is solved.
  5. J

    How can I report common strings in array/dataframe

    Of course, dat <- data.frame(a = letters[1:5], b = letters[2:6], c = letters[3:7]) I need to perform some function to retrieve the non commons letters considering the three columns in order to export the non common letters to a vector or colum as: vector<-a, f, g I already know that using...
  6. J

    How can I report common strings in array/dataframe

    Your code worked great. One final question, what do I need to edit in order to obtain the opposite to the intersection? I mean, the rows that are not shared in every column? Thanks for your sintax, Dason. Very simple and fast.
  7. J

    How can I report common strings in array/dataframe

    I just need a vector reporting only the "strings" that exist, or are common, considering all the columns from the data frame or matrix. I don't care the row order of a "string" to report. Only the existence is the relevant. The example I provided with the images tries to explain that. Sorry if I...
  8. J

    How can I report common strings in array/dataframe

    Hello, I have no idea how to report in a vector the commons variables from a data.frame or matrix. I have a data many columns. In this example I show four columns with d1-d4 as names. So, how do I create a vector with the common strings? Something as this: It looks simple, but...
  9. J

    Loop exporting to excel file- writeWorksheetToFile

    I've made some test I found out that the package XLConnect isn't reliable when you try to make some loops. So, I just decided to append every database and after the last file is appended, I've exported using the XLConnect package. If you ask me how do I know the package XLConnect fails, It is...
  10. J

    Loop exporting to excel file- writeWorksheetToFile

    Hi, I need to read multiple dta files and exporting the content of a variable called "name". My idea is to aggregate to the right each "name" from each dta file. I made a simple loop and I know It works reading the dta files. However, It can't say the same exporting the data. Here is what I...
  11. J

    Import and working with labels from SPSS file

    Hi, It's been a while since I asked this, so I will try again: Is there any form to import a SPSS file on R but in the way SPSS deals with them? I mean, working with labels? R and the packages that provides the import tool just import one way the spss file. The numbers or labels, but not both...
  12. J

    GET DATA loop through folder

    Hi I need to run the same syntax over some files. They are in the folder named DBase. I mean, there is a db01.sav and over it run the syntax, then do the same for db02.sav and so on. How do i make it? How run the process only listing one time the files i'm interested? Thanks for your time...