similar to: how do I exort a list of numbers into csv file?

Displaying 20 results from an estimated 40000 matches similar to: "how do I exort a list of numbers into csv file?"

2011 Sep 27
3
read.csv behaviour
This might be obvious but I was wondering if anyone knows quick and easy way of writing out a CSV file with varying row lengths, ideally an initial data read from a CSV file which has the same format. See example below. I found it quite strange that R cannot write it in one go, so one must append blocks or post-process the file, is this true? (even Ruby can do it!!) Otherwise it puts
2011 Sep 27
3
read.csv behaviour
This might be obvious but I was wondering if anyone knows quick and easy way of writing out a CSV file with varying row lengths, ideally an initial data read from a CSV file which has the same format. See example below. I found it quite strange that R cannot write it in one go, so one must append blocks or post-process the file, is this true? (even Ruby can do it!!) Otherwise it puts
2009 Nov 05
1
how to collapse list into a matrix with names
Dear R-Helpers, I have the following code: data = read.csv("test.csv",header=T,na.strings="-",row.names=1) myData=as.matrix(data) ##myData is a 102x19 matrix myList = alply(myData, 2,function(x){matrix(x,ncol=6,byrow=T)}) ##myList is a list containing 19 matrices with the following names > names(myList) [1] "*ES" "*ET" "*ER"
2012 Aug 28
3
Get variable data Reading from the list
Here i have a variable MyVar <- data.frame(read.csv("D:\\Doc.csv")) And now i am storing this variable name into a list. MyList <- list() MyList [length(MyList )+1]<- "MyVar" Now what is the requirement is, i need to call the variable name "MyVar" from the list "MyList " and get the data.
2012 Feb 12
3
Writing output into a file
Hi everyone, I'm an R newbie working with the poLCA module. I achieved my target without having to bother anyone, but It seems that I've got stuck at the last minute. My problem is simple. I need to write my results into a file. My results are in the shape of a list (unbalanced columns) I've considered several methods (sink(), write.file) etc. etc. Unfortunately, I'm not the best
2012 Jan 20
1
free memory in large list?
Hi all, Lets say I have a huge list which is indexed in the following format: mylist[[i]][[j]][[k]] where the size is 100 x 100 x 100000 If I want to set mylist[[2]][[3]]=NULL How do I free the memory used by that sub-list? Thanks a lot! [[alternative HTML version deleted]]
2006 Feb 25
2
Adding header lines to a dataframe that is exported using write.csv
I would like to export a dataframe to a .csv using: >write.csv(dataframe,"dataframe.csv") but I need to add four "header" lines to the csv that are not part of the dataframe (which itself has a line of column headers). The difficulty (for me, at least!) lies in the requirement that certain elements of the header (X, Y and the number of "Q"s - please see example
2020 Oct 20
1
write.csv covert Åland to <c5>land
You don't say, but I'd guess you're using Windows. In your code page, the character ? is probably not representable. At some point in the sequence of operations involved in printing the dataframe R puts the string into the native encoding, and since that's impossible on your system, it substitutes the <c5> instead. The fact that you can sometimes display it is because
2011 Jun 26
1
bwplot questions: box order, axis breaks, and multiple y-axis labels
Hi all, I used bwplot in lattice to create a 6-panel boxplot grouped by a conditioning variable (param) that displays concentration (conc) in response to treatment (trtmnt). Here is the functional part of my code followed by my three questions: library(lattice); ww<-read.csv(file="c:/Rdata/lattice_boxplot_prep.csv",header=TRUE,sep=","); attach(ww);
2016 Feb 23
4
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
>>>>> nospam at altfeld-im de <nospam at altfeld-im.de> >>>>> on Mon, 22 Feb 2016 18:45:59 +0100 writes: > Dear R developers > I think I have found a bug that can be reproduced with two lines of code > and I am very thankful to get your first assessment or feed-back on my > report. > If this is the wrong mailing list or I
2008 Jan 18
1
Assigning into each of a list of dataframes
What is the right way to assign a new variable into each a of list of data frames? Here is my failed attempt: mylist <- list(df1 = data.frame(A = runif(5), B = runif(5)), df2 = data.frame(A = runif(5), B= runif(5))) lapply(mylist, function(x){x$Y <- x$A * x$B}) $df1 [1] 0.25589928 0.03446026 0.94992362 0.21388326 0.08668821 $df2 [1] 0.08771839 0.05643553 0.09036894
2010 Sep 04
4
Please explain "do.call" in this context, or critique to "stack this list faster"
I've been doing some consulting with students who seem to come to R from SAS. They are usually pre-occupied with do loops and it is tough to persuade them to trust R lists rather than keeping 100s of named matrices floating around. Often it happens that there is a list with lots of matrices or data frames in it and we need to "stack those together". I thought it would be a simple
2011 Feb 04
1
read.csv trap
This is not specifically a bug, but an (implicitly/obscurely) documented behavior of read.csv (or read.table with fill=TRUE) that can be quite dangerous/confusing for users. I would love to hear some discussion from other users and/or R-core about this ... As always, I apologize if I have missed some obvious workaround or reason that this is actually the desired behavior ... In a nutshell,
2013 Jan 29
2
converting XML document to table or dataframe
I am a relatively new user to R, and I am trying to learn more about converting data in an XML document into "2-dimensional format" such as a table or array. I might eventually wish to export this data into a relational database such as SQL, and/or to work with this data within the R package. My sample XML document is located at "
2016 Feb 24
2
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
On 23/02/2016 7:06 AM, Mikko Korpela wrote: > On 23.02.2016 11:37, Martin Maechler wrote: >>>>>>> nospam at altfeld-im de <nospam at altfeld-im.de> >>>>>>> on Mon, 22 Feb 2016 18:45:59 +0100 writes: >> >> > Dear R developers >> > I think I have found a bug that can be reproduced with two lines of code
2016 Feb 25
2
iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)
On 23.02.2016 14:06, Mikko Korpela wrote: > On 23.02.2016 11:37, Martin Maechler wrote: >>>>>>> nospam at altfeld-im de <nospam at altfeld-im.de> >>>>>>> on Mon, 22 Feb 2016 18:45:59 +0100 writes: >> >> > Dear R developers >> > I think I have found a bug that can be reproduced with two lines of code >>
2009 Oct 08
3
how to convert list into a vector
Hi , I want to convert a my list: > myList [[1]] [1] 1 2 3 4 5 [[2]] [1] 6 7 8 [[3]] [1] 9 10 11 into something like c(1,2,3,4,5,6,7,8,9,10,11) I realized that this is possible by > c(do.call("cbind",myList)) But only when list[[1]] through list[[3] have equal length of vectors within them Any ideas? Thank you for time, -Daniel -- View this message in context:
2011 Apr 05
1
Help in splitting a list
Dear R users, Let's say I have a list with components being 'm' matrices (as exemplified in the "mylist" object below). Now, I'd like to subset this list based on an index vector, which will partition each matrix 'm' in 2 sub-matrices. My questions are: 1. Is there an elegant way to have the results shown in mylist2 for an arbitrary number of matrices in mylist?
2011 Apr 03
1
Help in splitting ists into sub-lists
Dear List, Let's say I have a list whose components are 2 matrices (as exemplified in the "mylist" object below). I'd like to create a list with components being 4 matrices based on an logical index vector. is there a way to simplify what I'm doing to obtain the results in "mylist2"? I'd like something that would work on an arbitrary number of elements in
2001 Oct 18
2
Parsing for list components
How do I parse an identifier of a list component, e.g. mylist$mycomponent or mylist[[1]] ? Parse does not do the job, e.g. parse(text="mylist$mycomponent") returns an expression with just one term, instead of "mylist", "$", "mycomponent". What I need is a way to extract the list name (e.g. "mylist"), given an identifier of a component.