similar to: How to write to a table column by column?

Displaying 20 results from an estimated 10000 matches similar to: "How to write to a table column by column?"

2007 Jun 23
3
Setting up a blank table with column names in the hard drive
Dear Friends. Greetings! This should be a very common operation and I believe there should be a nice way in R to handle it. I couldn't find it in the manual or by searching on line. I am wondering if I could ask for some help in this community. I am trying to record the results of my program to a csv file in the hard drive so as to save memory space and also to read the results in excel
2007 Apr 15
1
nls.control( ) has no influence on nls( ) !
Dear Friends. I tried to use nls.control() to change the 'minFactor' in nls( ), but it does not seem to work. I used nls( ) function and encountered error message "step factor 0.000488281 reduced below 'minFactor' of 0.000976563". I then tried the following: 1) Put "nls.control(minFactor = 1/(4096*128))" inside the brackets of nls, but the same error message
2007 Aug 03
2
Saving an expression to a file
Dear Friends. I have a very long expression and I use function D to find its derivative, which will be even longer. I save the resulting expression in a variavle, say bbb. But when I tried to display bbb on the screen, the R screen is not long enough for me to view it. Is there a way to save the expression to a file? Best Wishes Yuchen Luo [[alternative HTML version deleted]]
2007 Jun 21
4
"if" within a function
Dear Friends. I found a puzzling phenomenon in R when you use 'if' within a function: # defining a function aaa aaa=function(a) {if (a==1) {aaa=1}; if (a!=1) {aaa=2} } # using the function: > b=20 > bbb=aaa(b) > bbb [1] 2 > typeof(bbb) [1] "double" > > > c=1 > ccc=aaa(c) > ccc NULL > typeof(ccc) [1] "NULL" It seems that only the last
2007 Aug 29
4
How to signal the end of the table?
I am using a "for" loop to read a table row by row and I have to specify how many records are there in the table. I need to read row by row because the table is huge and the memory not large enough for the whole table.: number.of.records=100 fp=file("abc.csv","r") pos=seek(fp, rw="read") for (i in 1:number.of.record){ current.row=scan(file=fp,
2007 Sep 05
3
'singular gradient matrix’ when using nls() and how to make the program skip nls( ) and run on
Dear friends. I use nls() and encounter the following puzzling problem: I have a function f(a,b,c,x), I have a data vector of x and a vectory y of realized value of f. Case1 I tried to estimate c with (a=0.3, b=0.5) fixed: nls(y~f(a,b,c,x), control=list(maxiter = 100000, minFactor=0.5 ^2048),start=list(c=0.5)). The error message is: "number of iterations exceeded maximum of
2007 Apr 06
2
Reading a csv file row by row
Hi, my friends. When a data file is large, loading the whole file into the memory all together is not feasible. A feasible way is to read one row, process it, store the result, and read the next row. In Fortran, by default, the 'read' command reads one line of a file, which is convenient, and when the same 'read' command is executed the next time, the next row of the same file
2007 Apr 12
2
How to manipulate the pointer of a file?
Dear friends. With file( ) to obtain a pointer of a file, every time we use scan ( ) to read one row of it, the pointer will point to the next row of the file. In the following example, d1 and d2 are obtained the same way but they correspond to different rows of the same file because the pointer of the file moves down a row when a row of the file is read. The following is an example: a1
2007 Aug 29
1
How to let the program know the end of a file is reached?
Dear collegues. I am using scan( ) to read from a table (a csv file). I am wondering how to let the program know that the end of the file is reached? Your help will be highly appreciated! Best Wishes Yuchen Luo [[alternative HTML version deleted]]
2007 Sep 07
1
'initial value not feasible' in constrOptim
Dear friends. I am using function constrOptim(c(0.5,0.3,0.5), fit.error, fit.error.grr, ui=-1*ui,ci=-1*ci) and I am confronted with error message "initial value not feasible" I plug in the initial value of (0.5,0.3,0.5) to function fit.error and fit.error.grr and have pretty reasonable result. I inequality "ui %*% theta - ci >= 0" as suggested in the R manual and it is
2007 Jul 15
1
Looping through a series of (csv) files
Dear Colleagues. This should be a very common operation and I believe there should be a nice way in R to handle it. I couldn't find it in the manual or by searching online. I am wondering if I could ask for some help in this community. I have 48 csv files; each stores the data for a specific month. The 48 corresponding months are consecutively from January, 2001 to December, 2004. I name
2007 Apr 06
1
Reading a large csv file row by row
Hi, my friends. When a data file is large, loading the whole file into the memory all together is not feasible. A feasible way is to read one row, process it, store the result, and read the next row. In Fortran, by default, the 'read' command reads one line of a file, which is convenient, and when the same 'read' command is executed the next time, the next row of the same file
2007 Sep 09
2
What does it mean by "initial value not available"?
Dear friends. I use ConstrOptim( ) and got error message "initial value not available". My understanding of "initial value not available" is that one of the following 3 cases happens: 1.The objective function is not well defined at the point of the initial value. 2. The differentiation of the objective function is not well defined at the point of the initial value. 3. The
2007 Aug 12
1
How to store the parameter estimated by nls( ) to a variable?
Dear Colleagues. I believe this should be a problem encountered by many: nls( ) is a very useful and efficient function to use if we are just to display the estimated value on screen. What if we need R to store the estimated parameter in a variable? For example: x=rnorm(10, mean=1000, sd=10) y=x^2+100+rnorm(10) a=nls(y~(x^2+para),control=list(maxiter = 1000, minFactor=0.5
2010 Jul 22
4
Installation
Hi all, I''m struggling to install Xen Hypervisor on my PC, but after one week''s attempt again and again, it still doesn''t work. Anyone can give some suggestion or helpful link? 1. download the xen 4.0.0 stable tarball from here, http://www.xen.org/products/xen_source.html 2. unzip the tar and run install.sh and ''make world'' 3. make install 4. then I
2007 Sep 10
2
Are the error messages of ConstrOptim() consisten with each other?
Dear Friends. I found something very puzzling with constOptim(). When I change the parameters for ConstrOptim, the error messages do not seem to be consistent with each other: > constrOptim(c(0.5,0.3,0.5), f=fit.error, gr=fit.error.grr, ui=ui,ci=ci) Error in constrOptim(c(0.5, 0.3, 0.5), f = fit.error, gr = fit.error.grr, : initial value not feasible > constrOptim(c(0.5,0.9,0.5),
2007 Nov 28
2
Different value between R variance and definition of variance
Hi! Let us define random variable: > x = seq(0,1,length=100) If we calculate variance following definition E[(x-E(x))^2] we get: > mean( (x - mean(x))^2 ) # == mean(x^2) - mean(x)^2 0.08501684 And if we use internal R function var: > var(x) 0.08587559 Can anyone tells me why the difference?
2009 Sep 21
2
Executing R scripts from another R script
Hello, everyone I run Eclipse Ganymede and R 2.7.2 at work. I have one R script file where I open in memory a new xls file (using xlsReadWritePro), call other R scripts, which are in the same folder as the main R script, which get data from an existing xls file, process data, and output results in the xls file which is in memory. That is the idea. But I cannot make it work. First, I do not
2007 Aug 18
2
Problem with lsa package (data.frame) on Windows XP
Dear R team, The following piece of code (to use the lsa package) works fine on my mac os x, but when I run the same code on Windows XP, it doesn't work any more. ### code: library("lsa") matrix1 = textmatrix("C:\\Documents and Settings\\tine stalmans.TINE. 000\\LSA\\cuentos\\", stemming=TRUE, language="spanish", minWordLength=2, minDocFreq=1,
2009 Jul 02
2
Export data to Multiple Sheets in Excel via xlsReadWritePro
Is there a way to export multiple datasets into multiple excel spreadsheets using xlsReadWritePro or with xlsReadWrite? Chris Anderson 707.315.8486 www.sassydeals4u.com ____________________________________________________________ Turn any room into a work of art. Click now for beautiful oriental rugs!