ReadCSV reads the file in as a nested list, so you can't access it
directly via columnname.  It would be possible to write a function that
does that, but it would have to do a lot of checking to make sure the
input is right. The list is nested by row then by column. But
Transpose() will reverse  row/column, as long as each row has the same
number of columns.   to do what you want, you might do


wordinfo <- Transpose(ReadCSV("SPRitems.csv"))

posout <- Nth(wordinfo,1)
sent <- Nth(wordinfo,2)
type <- Nth(wordinfo,4)

etc.



Alternately, you might iterate through the rows and pull out the
details on each stimulus/trial.

 wordinfo <- ReadCSV("SPRitems.csv") 
  loop(i,Length(wordinfo))
  {
   trial <- Nth(wordinfo,i)
    pos <- Nth(trial,1)
  }


Good luck!


On Wed, 2018-08-01 at 14:43 +0900, Christopher Nicklin wrote:
> Dear PEBL,
> 
> PhD program at Temple University in Japan. I am currently interested
> in reaction time tests, and have found PEBL to be an excellent tool
> for making tests. thank you for all of your efforts.
> I have a quick question.
> Is it possible to import columns from .csv spreadsheets as lists?
> For example, my spreadsheet, "SPRItems.csv", contains several columns
> that I would like to import as lists.
> The column names are:
> 
> task_pos, sent_n, word, type, length, freq, ngsl, end, so1
> 
> So far, I have
> 
> wordinfo <- ReadCSV("SPRitems.csv")
> 
> I have tried expressions such as
> 
> task_posout <- wordinfo.task_pos
> task_posout <- wordinfo/task_pos
> task_posout <- wordinfo[ ,1]
> 
> Is it possible to import one of the columns, say Col C, as a list?
> 
> At the moment, my test works by using 9 separate .txt files, with
> each one representing one column from the spreadsheet. The script
> would be more efficient and I would be able to make a much better
> test if I could pull the columns directly from the spreadsheet.
> 
> Regards,
> Christopher
> 
> -------------------------------------------------------------------
> -----------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Pebl-list mailing list
> Pebl-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pebl-list

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Pebl-list mailing list
Pebl-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pebl-list

Reply via email to