Displaying 20 results from an estimated 40000 matches similar to: "writing data to file"
2007 Sep 01
1
why doesn't as.character of this factor create a vector ofcharacters?
This message didn't seem to have been somewhat forgotten. Here is a reply.
When you constructed the data.frame, all strings were converted to
factors. If you didn't want that, it would have been possible to
specify it:
df<-data.frame(a=a,b=b,c=c,stringsAsFactors=F)
Then everything would work as intended:
one.line<-as.character(df[df$a=="Abraham",])
Actually, the real
2012 Mar 18
2
word frequency count
Hi:
I have a dataframe containing comma seperated group of words such as
milk,bread
bread,butter
beer,diaper
beer,diaper
milk,bread
beer,diaper
I want to output the frequency of occurrence of comma separated words
for each row and collapse duplicate rows, to make the output as shown
in the following dataframe:
milk,bread 2
bread,butter 1
beer,diaper 3
milk,bread 2
Thanks for help!
deb
2012 May 02
2
output Shapiro-Wild results to a table
Hello,
I have applied the Shapiro test to a matrix with 26.925 rows of data using the following
F1.norm<-apply(F1.n.mat,1,shapiro.test)
I would now like to view and export a table of the p and W values from the Shapiro test, but I am not sure how to approach this.
I have tried the following with errors.
> write.table(x=F1.norm,file="I:/R_Work/F1/Shapiro.csv",
2013 Mar 06
1
red SNA
Estimados
Le consulto porque estoy intentando presentar unos datos de alguna forma un
poco distinta, salir un poco de la costumbre.
Primero describo los datos:
Suponiendo una secuencia:
golpe al auto -> torura de vidrio -> rotura de aciento
otro auto
golpe al auto -> -> rotura de aciento , a este por alguna causa no se le
rompio el vidio o esa informaciĆ³n es desconocida.
Esta
2012 Sep 13
1
Parsing "back" to API strcuture
Dear R experts,
I'm reading data from an online database via API and it gets delivered in this messy comma separated structure,
> RAW.API <-
2010 May 10
1
ggplot: Trouble with xlim() and discrete scales
I'm learning ggplot and am a little confused. Sometimes discrete scales work
like I'd expect, and sometimes they don't. For example...
This works exactly like one would expect:
df<-data.frame(names=c("Bob","Mary","Joe","Bob","Bob"))
ggplot(df,aes(names))+geom_histogram()
But this yields an error:
2008 Jun 29
1
creating a dataframe using a list of the variable names
Hello,
I'm fairly new to R, and despite spending quite some time exploring, testing, and looking for answers, I still have a couple of questions remaining...
The first one is about creating a dataframe using a list of the variable names .
I get this output file from a database:
BOB <- c('A/A', 'C/C', '15/27')
MARY <- c('A/A', NA, '13/12')
JOHN
2011 Apr 12
2
advisory file locks in linux - do they work?
Hi - I'm trying to verify if OpenSSH/SFTP will in fact lock files with
advisory file locking in Linux. I can test locking with the linux
"flock" command to verify that file locking does work - but when I
upload or download a file with SFTP it will not detect a lock. I'm
asking about Linux specifically because about a year ago I was doing a
similar process in Solaris 9 and
2008 Nov 08
2
Data Manipulation, add frequency index
Hi, there,
I have a simple data manipulation question for you. Thank you for your help!
Suppose that I have this data about people appearing in a class
Mary
Mary
Mary
Sam
Sam
John
John
John
John
Then I want to find out what exact time(s) the student appears at the
moment such as
Mary 1
Mary 2
Mary 3
Sam 1
Sam 2
John 1
John 2
John 3
John 4
the fifth row shows tha Sam show the second times
2008 Jun 29
2
How to get an argument dynamically from a list?
Hi,
I'd like to get an argument (I think it's the right term) dynamically from a list, but cannot manage to do it.
Here is the code I use:
#output given by database
BOB <- c('A/A', 'C/C', '15/27')
MARY <- c('A/A', NA, '13/12')
JOHN <- c('A/A', 'C/A', '154/35')
CLIFF <- c('A/C', 'C/C',
2003 Jan 06
3
ownership permissions on files replaced via scp -- bug or feature?
I've noticed the following behavior on files that are overwritten with
an scp command and I can't decide if this is intended behavior or a bug?
Can someone with a little more insight please share the reasoning for
this (if any)? I've tested this with a mix of 3.4p1 and 3.5p1 hosts.
Suppose we have 2 files on different hosts, with different group
ownership and permissions. user1 is not
2009 Jul 02
3
Testing for membership in an array of strings
As an R beginner, I feel brain dead today as I can not find the answer
to a relatively simple question.
Given a array of string values, for example lets say "mary", "bob",
"danny", "sue", and "jane".
I am trying to determine how to perform a logical test to determine if
a variable is an exact match for one of the string values in the array
2009 Jun 22
2
Samba mounted home shares will break many applications
I didn't get any responses to my previous post "Wine broken on Samba
shares due to colon ":" filenames" so I am re-posting with a subject to
reflect what I now believe to the the root cause of my problems.
I recently changed from mounting my home directory using NFS to mounting
with CIFS via the pam module pam_mount.so. It turns out that I am having
problems with many
2011 Mar 05
1
file mode lost in file.copy()?
Hi,
Recently I noticed file.copy() would discard the file mode
information. Is this the expected behaviour or a bug for file.copy()?
> file.create('testfile')
[1] TRUE
> file.info('testfile')
size isdir mode mtime ctime
testfile 0 FALSE 644 2011-03-05 17:06:39 2011-03-05 17:06:39
atime uid gid uname grname
2011 Mar 05
1
file mode lost in file.copy()?
Hi,
Recently I noticed file.copy() would discard the file mode
information. Is this the expected behaviour or a bug for file.copy()?
> file.create('testfile')
[1] TRUE
> file.info('testfile')
size isdir mode mtime ctime
testfile 0 FALSE 644 2011-03-05 17:06:39 2011-03-05 17:06:39
atime uid gid uname grname
2006 Dec 20
1
Incoming Lines Confusion
First off, please, for the love of God, don't cremate me, if I should
already know the answer to this!
I've installed a small setup for an office who wanted to be able to talk to
each other instead of having to rely on MSN to communicate. Weird request, I
know, but hey, we do what we need to do to get paid. I installed soft
phones, gave everyone an extension, and bingo, they can call and
2012 Jul 03
2
"evaluating expressions" contained in a dataframe
#I have a dataframe called "tests" that contain "character expressions". These
characters are rules that use data from within another dataframe. Is there
any way within R I can access the rules in the dataframe called tests, and
then "evaluate" these "rules"?
#An example may better explain what I am trying to accomplish:
tests <-
2005 Jun 20
2
Data Parsing
Hello. I have looked at R Site Search for this problem, and it didn't
give me exactly what I needed.
Consider this dataset called "results". It has the following information:
Student Day Subject Score
Mary 1 Math Failed
David 2 Science Passed
Bob 4 Reading Passed
Marie 4
2007 May 01
3
ActiveRecord Previous/Next Record
Does ActiveRecord offer a simple solution to get previous/next records
relative to a certain record? For instance, say I have this table:
PEOPLE
id | name
1 | john
2 | mary
3 | bob
Using p = Person.find(2), is it possible to get the previous (john)
and next (bob) records using perhaps something like p.previous and
p.next? If not, how can I do this without resorting to ugly queries?
Thanks in
2007 Sep 02
2
NAs in indices
Hi All,
I'm fiddling with an program to read a text file containing periods that
SAS uses for missing values. I know that if I had the original SAS data
set instead of a text file, R would handle this conversion for me.
Data frames do not allow missing values in their indices but vectors do.
Why is that? A search of the error message points out the problem and
solution but not why they