Displaying 20 results from an estimated 800 matches similar to: "write function (PR#10953)"
2006 Jan 30
2
yet another vectorization question
Dear R-helpers,
I'm trying to develop a function which specifies all possible expressions that
can be formed using a certain number of variables. For example, with three
variables A, B and C we can have
- presence/absence of A; B and C
- presence/absence of combinations of two of them
- presence/absence of all three
A B C
1 0
2 1
3 0
4 1
5 0
6 1
2006 Jul 24
5
change the name of file
Dear R Users,
Is it possible to make file names dependent on a changing variable?
For instance. I generate random numbers in a loop and at each iteration I
want data to write to file (I do not want to write everything in one file
using 'append'):
for (i in 1:50){
x<-matrix(runif(100, min=0,max=1),nrow=5,ncol=20)
Write(t(x),file="Data_i.txt",ncolumns=5,sep="\t")
}
2005 Dec 15
1
millions of comparisons, speed wanted
Dear all,
I have a 10 columns matrix which has 2^10=1024 unique rows, with values 0 and
1.
What I would like to do is a little complicated; in a simple statement, for a
subset (say 1000 rows) I want to perform pairwise comparisons between all
rows, find out which rows differ by only one value, replace that value by
"x", get rid of the comparisons that differ by more than one value
2006 Jul 04
1
[Fwd: formatting using the write statement]
>I have a series of write statements because
>i am writing to a file
>where the characters strings are the column names of a dataframe
>and the numbers are the elements in a particular row.
>So, a file might look like
>
>AAA 2.1
>BB 3.1
>AHLZ 0.2
>
>and it would be named "rowname".mls.
>
>so, each time i get to a new row, i create a new file and
2009 Apr 25
2
Extracting an object name?
Dear Sir or Madam:
This is an extension to a earlier post, about looping through several
thousand files, and testing student's models against a different
data-set, called rclnow, for "recall now".
The problem is, that the instructor never specified to the students,
what they should name their "lm" object.
So what they created was:
"arbitrary variable name"
2006 Dec 18
2
write() gotcha
Hi
I used write() the other day to save some results.
It seems that write() does not record the full precision of
the objects being written:
> write(pi,file="~/f",ncolumns=1)
> pi.saved <- scan("~/f")
Read 1 item
> dput(pi)
3.14159265358979
> dput(pi.saved)
3.141593
> pi-pi.saved
[1] -3.464102e-07
>
This difficulty was particularly difficult to
2008 Feb 11
1
Multiple homedir entries in smb.conf ?
Hi list,
is it possible to add multiple homedir templates to smb.conf ?
I have a running linuxsystem where homefilesets are mounted
from different windows-servers to subdirs like:
/home/server01/home/USERNAME
/home/server02/home/USERNAME
/home/server03/home/USERNAME
The users come via winbind. In the smb.conf the entry for the
homedir:
template homedir = /home/%U
So how is it possible to
2009 Jul 21
3
writte file doubt
Hi I wrotte this function but when I get the "tmp.xls" file it shows data
in a rare way. I mean not appears a matrix with 2000 rows and 100 columns.
Can anyone help me, guide me?
kim<-function(){
tmp<-randz<-matrix(rnorm(200000, mean=0,sd=0.01 ),2000,100);
dim(tmp)
write(tmp,file="tmp.xls")
Thanks in advance.
On the other hand, everytime I execute a function
2009 Nov 24
1
write to file append by column
Readers,
Scenario: data x consists of one column;
1
2
3
data y;
4
5
6
Is it possible to write to file such that the file is:
1,4
2,5
3,6
using the write.file function? I have tried the command:
write(x,file="file.csv",ncolumns=1,append=TRUE,sep=",")
write(y,file="file.csv",ncolumns=1,append=TRUE,sep=",")
but the result is:
1
2
3
4
5
6
yours,
2008 Mar 30
2
problem with white space
Hi,
I need to resample characters from a dataset that consists of an extremely
long string that is written over hundreds of thousands of lines, each of
length 50 characters. I am currently doing this by first inserting a space
after each character in the dataset and then using the following commands:
y <- as.matrix(read.table("data.txt"), stringsAsFactors=FALSE)
bstrap <-
2002 Apr 17
1
concat
i have a function that returns a list containing a variety of variable types
i am trying to run the function multiple times and return the output into a
variable with a semi-consistent naming pattern
i.e., for ten trials i want to return the list into variables
trial1,trial2,...trial10
is there a generic way to get this to happen
i have a similar process that does the same thing to an external
2007 May 20
4
Running an R script without running R
Is there any way to run an R script without running R?
As an example, suppose I have a tcl/tk interface that asks
for a number (in a GUI) and displays its factorial. Is there a
way to invoke this script without invoking R?
I'm using R 2.4.1 in GNU/Linux Fedora Core 4.
Alberto Monteiro
2012 May 15
2
Transfering data from R list to other document format
Dear users,
I want to transfer a list of results from R to some practical format, from
where I can continue manipulating, copying,... the values, e.g. :
list1 <- list("My first list", matrix(1:6, ncol=3), c(1,2,3,4,5,6) )
# Imagining I forgot something and want to add it to the list like:
list1[[4]] <- list(c(4,4,4), "This is it")
# Now I want to transfer the list to
2010 May 11
3
indexing words with alternative spellings
Some languages (e.g. German and Danish) have special letters that are
often written using two-letter combinations when the appropriate
keyboard or medium is not available:
? = ae
? = ue
? = oe
? = ae
? = oe
? = aa
? = ss
(there are undoubtedly far more examples than those)
As a user of an index, I would like to be able to search for
e.g. "schaefer" and get matches on both
2005 Aug 03
2
Multilevel logistic regression using lmer vs glmmPQL vs. gllamm in Stata
Dear all,
I am trying to replicate some multilevel models with binary outcomes
using R's "lmer" and "glmmPQL" and Stata's gllmm, respectively.
The data can be found at <http://www.uni-koeln.de/~ahf34/xerop.dta>.
The relevant Stata output can be found at <http://www.uni-
koeln.de/~ahf34/stataoutput.txt>. First, you will find the
unconditional model,
2006 Jun 04
1
strange (to me) ncolumns default value in 'write'
? stato filtrato un testo allegato il cui set di caratteri non era
indicato...
Nome: non disponibile
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060604/a8854663/attachment.pl
2005 Jun 01
1
A problem on sink() and format,suggestions appreciated
Dear R users
I get a weired problem when use sink:
since the data set pretty big, I sink intermediate result for further
use,following
lines are consistently used when write data
###########################
sink("dataname.txt")
data
sink()
##########################
at first couples of run, all 10 variables are wrote to a file in following
format:
V1 V2 ....... V10
1
2007 Jul 17
1
difficulties with "setMethod"
Dear all!
I do definetley have some difficulties. Here is my code:
> setMethod("write",
+ signature(object = "KMatrix", path = "character"),
+ function(object,path){
+ write.table(object at data,path,row.names=FALSE, sep = "\t")
+ }
+ )
error in match.call(fun, fcall) : unused
2013 Apr 25
2
Converting MySQL database to Xapian
I am looking for some guidance on converting a large MySQL database to Xapian. The current structure is that the database is broken up into 160 "sub-databases". There are 50,000 or so records in each stub database. Each record has content that I am full-text indexing. The average size of the text is about 59k characters. The database is broken up into sub-databases because the MySQL
2008 May 27
6
Openssh + AFS
The native authentication methods of openssh are
(not counting insecure RhostsRSAAuthentication)
1) public key
2) password
For users with home dirs in AFS space, method 1) does not work.
Except with (non foolproof) fiddling on the access controls within
the home directory. This might lead to security issues when done
by inexperienced users.
Without some work, only 2) remains. Being forced to send