similar to: save output of print() to txt file

Displaying 20 results from an estimated 10000 matches similar to: "save output of print() to txt file"

2012 Jan 01
4
matrix position to list of coordinates
How can I extract a list of the positions in the matrix? > A=matrix(1:8, nrow=2,ncol=4) > A [,1] [,2] [,3] [,4] [1,] 1 3 5 7 [2,] 2 4 6 8 Something like this pos.A 1 1 1 2 1 3 1 4 2 1 2 2 2 3 2 4
2011 Nov 28
5
window manager interface commands for linux
How can i replicate this in Linux: source(file.choose()) I've tried source(tkgetOpenFile()) but with no luck
2011 Dec 14
2
plot matrix of characters
Hi, I am looking for options to plot the following type of matrices: "A" "B" "C" "D" "A" "A" "C" "C" "A" "A" "A" "C" as a image like this: http://www.phaget4.org/R/image002.jpg
2011 Dec 13
4
sum with dates
How do I sum 15 years to my dataset? original dataset dates val 1 2001-01-12 1.2 2 2001-02-12 1.2 3 2001-03-12 1.2 result dates val 1 2016-01-12 1.2 2 2016-02-12 1.2 3 2016-03-12 1.2
2011 Nov 08
3
lapply to list of variables
Hi Can someone help me with this? How can I apply a function to a list of variables. something like this listvar=list("Monday","Tuesday","Wednesday") func=function(x){x[which(x<=10)]=NA} lapply(listvar, func) were Monday=[213,56,345,33,34,678,444] Tuesday=[213,56,345,33,34,678,444] ... in my case I have a neverending list of vectors. Thanks!
2012 Feb 06
3
Logistic Regression
I am looking for R packages that can make a Logistic Regression model with parameter estimation by Maximum Likelihood Estimation. Many thanks for helping out.
2001 Jan 17
4
Can one set --no-save in .Rprofile
(On Unix/Linux) Is it possible to set the --no-save command line option as an option in the .Rprofile file. I have looked in the sources and do not see any obvious (user initiated) ways of changing the command line defaults, but I am hoping I have missed something. I *know* I can write my own shell script wrapper that calls R with whatever arguments I want (and I do that). However there
2011 Dec 28
3
transparency using plot+points with sp classes
How can I make one point graphics with transparency These are all sp classes: plot(polygons_area,axes=TRUE,asp=1.5,main="Title",xlab="Latitude", ylab="Longitude") points(observations2000,type = "p",pch=21,col="green") points(observation1999,type = "p",pch=21,col="blue") points(reference.points,type =
2012 Feb 03
3
strftime - Dates from Excel files
Hi I have many excel files were the Date field was not declared as date, so the dates look like this: 1/2/1978 I know that the format is day/month/year How can I make R change this to Date format? If I use strftime, I get wrong dates: dataset=c("1/2/1978") strftime(dataset,"%d/%m/%Y") "19/02/0001" Thanks in advance.
2011 Jul 29
5
HIRHAM netcdf files
Can someone help me out with a "small" problem? I've started using netcdf files recently, and I want to extract the grid id and also the coordinates from a HIRHAM netcdf file. I know how to extract a slice of dataset both in space and in time and I also know the area that this file should cover, however I have no idea regarding the reference for both LAT/LON and RLAT/RLON. I tried
2002 Mar 05
1
dribble for R?
Is there something like the LISP function dribble in R? This would log all the output to a file but still show it on the terminal too. sink just diverts the output, but I dont see a way to do what dribble would do? Johann -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2009 Feb 17
2
printing out the summary for lm into a txt file
Hi All, I am trying to run several linear regressions and print out the summay and the anova reslts on the top of each other for each model. Below is a sample progarm that did not work. is it possible to print the anova below the summary of lm in one file? thanks for your help ###################################################### data<-read.table("data.txt", header=T,
2014 Oct 08
4
Pregunta sobre manipulación de shapefile
Gracias Beatriz, efectivamente, lo que indicas en tu ejemplo es lo que obtengo al final de mi proceso. En todo caso pruebo tu opción con mis datos, si es como imagino seguro que es más rápida de montar y más elegante que tratar el resultado de un sink() (recuerdo que en su momento lo intenté con fotify pero no supe bien como atacarlo, no conocía el enlace que me mandas, por tanto lo pruebo de
2017 Nov 01
0
Function to save results
Hi Priya, You did not follow the logic of the pseudo-code. The sink("filename"), sink() pair captures whatever output is generated between the first sink statement and the second sink statement. You need (possibly) to do: sink("C://Users//Priya//Desktop//Attractor analysis_all genes//synaptogenesis//attr.txt") net <- loadNetwork("C://Users//Priya//Desktop//Attractor
2017 Nov 01
0
Function to save results
Some comments: 1. sink() does not return a value. There is on point to set attr <- sink(...). Just give the command sink("C://....etc") 2. to complete the saving to the file you must give a second sink command with no argument: sink() So your code would be (pseudo-code, not actual code) sink( "filename" ) do something that prints output which will be captured by sink
2011 Nov 01
3
Export to .txt
Hi, I would like to export all my workspace (even with the evaluation of commands) to the text file. I know about the sink() function but it doesnt work as I would like. My R-function looks like this: there are instructions for user displayed by cat() command and browser() commands for fulfilling them. While using the sink() command the instructions dont display :( Can anyone help me with a
2017 Nov 01
2
Function to save results
Hi Eric,I tried as you suggested but I could not find the output in the text file I created (attr.txt) net <- loadNetwork("C://Users//Priya//Desktop//Attractor analysis_all genes//synaptogenesis//regulationof_dopamine_signaling_submodule3.txt")sink("C://Users//Priya//Desktop//Attractor analysis_all genes//synaptogenesis//attr.txt") sink() attr <- getAttractors(net,
2017 Nov 01
2
Function to save results
Hi,I want the results to be saved automatically in a output text file after the script has finished running. I used the sink function in the following example, but the results file (output.txt) was empty. net <- loadNetwork("C://Users//Priya//Desktop//Attractor analysis_all genes//synaptogenesis//regulationof_dopamine_signaling_submodule3.txt")# First I loaded theinput file for
2017 Nov 01
1
Function to save results
Hi David,Thank you for the example.When I try to use the cat function, I get an error cat(attr<-getAttractors(net, type="asynchronous"))Error in cat(attr <- getAttractors(net, type = "asynchronous")) : argument 1 (type 'pairlist') cannot be handled by 'cat' Please let me know, if I have used the function in right way?. Thank you Priya ?
2017 Nov 01
0
Function to save results
Let's try a simple example. > # Create a script file of commands > # Note we must print the results of quantile explicitly > cat("x <- rnorm(50)\nprint(quantile(x))\nstem(x)\n", file="Test.R") > > # Test it by running it to the console > source("Test.R") 0% 25% 50% 75% 100% -2.4736219 -0.7915433