Displaying 20 results from an estimated 9000 matches similar to: "write.csv problems"
2024 Jun 29
1
write.csv problems
?s 17:02 de 28/06/2024, Spencer Graves escreveu:
> Hello, All:
>
>
> ????? I'm getting strange errors with write.csv with some objects of
> class c('findFn', 'data.frame'). Consider the following:
>
>
> df1 <- data.frame(x=1)
> class(df1) <- c('findFn', 'data.frame')
> write.csv(df1, 'df1.csv')
> # Error in
2024 Jun 29
1
write.csv problems
Hi, Rui et al.:
On 6/29/24 14:24, Rui Barradas wrote:
> ?s 17:02 de 28/06/2024, Spencer Graves escreveu:
>> Hello, All:
>>
>>
>> ?????? I'm getting strange errors with write.csv with some objects of
>> class c('findFn', 'data.frame'). Consider the following:
>>
>>
>> df1 <- data.frame(x=1)
>> class(df1) <-
2012 May 20
4
write.xls
Hello, All:
The "writeFindFn2xls" function in the "sos" package tries to
write an Excel file with 3 sheets ('PackageSum2', 'findFn', 'call').
Unfortunately, it is often unable to do this because of configuration
problems that are not easy to fix. I've found 3 contributed packages
that provide facilities to write Excel files with
2006 Jul 04
1
problem getting R 2.3.1 svn r38481 to pass make check-all
Hi,
I noticed this problem on my home desktop running FC4 and again on my
laptop running FC5. Both have previously compiled and passed make
check-all on 2.3.1 svn revisions from 10 days ago or so. On both these
machines, make check-all is consistently failing (4 out of 4 attempts on
the FC 4 desktop and 3 out of 3 on the FC 5 laptop) in the
p-r-random-tests tests. This is with both default
2012 Jul 19
3
Maintaining Column names while writing csv file.
Dear R helpers,
I have one trivial problem while writing an output file in csv format.
I have two dataframes say df1 and df2 which I am reading from two different csv files.
df1 has column names as date, r1, r2, r3 while the dataframe df2 has column names as date, 1w, 2w.
(the dates in both the date frames are identical also no of elements in each column are equal say = 10).
I merge these
2011 Aug 18
2
Best way/practice to create a new data frame from two given ones with last column computed from the two data frames?
Dear expeRts,
What is the best approach to create a third data frame from two given ones, when
the new/third data frame has last column computed from the last columns of the two given
data frames?
## Okay, sounds complicated, so here is an example. Assume we have the two data frames:
df1 <- data.frame(Year=rep(2001:2010, each=2), Group=c("Group 1","Group 2"), Value=1:20)
2013 Feb 26
2
merging or joining 2 dataframes: merge, rbind.fill, etc.?
#I want to "merge" or "join" 2 dataframes (df1 & df2) into a 3rd
(mydf). I want the 3rd dataframe to contain 1 row for each row in df1
& df2, and all the columns in both df1 & df2. The solution should
"work" even if the 2 dataframes are identical, and even if the 2
dataframes do not have the same column names. The rbind.fill function
seems to work. For
2012 Oct 11
1
as.data.frame.matrix() returns an invalid object
Hi,
Two ways to create what should normally be the same data frame:
> df1 <- data.frame(a=character(0), b=character(0))> df1
[1] a b
<0 rows> (or 0-length row.names)
> df2 <- as.data.frame(matrix(character(0), ncol=2,
dimnames=list(NULL, letters[1:2])))
> df2
[1] a b
<0 rows> (or 0-length row.names)
unique() works as expected except that I
2011 Nov 08
2
compare linear regressions
Hi,
I'm trying to compare two linear regressions. I'm using the
following approach:
##################
xx<-1:100
df1 <- data.frame(x = xx, y = xx * 2 + 30 + rnorm(n=length(xx),sd=10), g = 1)
df2 <- data.frame(x = xx, y = xx * 4 + 9 + rnorm(n=length(xx),sd=10), g = 2)
dta <- rbind(df1, df2)
dta$g <- factor(dta$g)
2004 Feb 19
1
Comparing two regression slopes
I would suggest the method of Sokal and Rholf (1995) S. 498, using the F
test.
Below I repeat the analysis by Spencer Graves:
Spencer:
> df1 <- data.frame(x=1:3, y=1:3+rnorm(3))
> df2 <- data.frame(x=1:3, y=1:3+rnorm(3))
> fit1 <- lm(y~x, df1)
> s1 <- summary(fit1)$coefficients
> fit2 <- lm(y~x, df2)
> s2 <- summary(fit2)$coefficients
> db <-
2007 May 05
1
loop in function
Dear Mailing-List,
I think this is a newbie question. However, i would like to integrate a
loop in the function below. So that the script calculates for each
variable within the dataframe df1 the connecting data in df2. Actually it
takes only the first row. I hope that's clear. My goal is to apply the
function for each data in df1. Many thanks in advance. An example is as
follows:
df1
2013 Jan 02
2
rbind: inconsistent behaviour with empty data frames?
The rbind on empty and nonempty data frames behaves inconsistently. I am
not sure if by design.
In the first example, first row is deleted, which may or may not be on
purpose:
df1 <- data.frame()
df2 <- data.frame(foo=c(1, 2), bar=c("a", "b"))
rbind(df1, df2)
foo bar
2 2 b
Now if we continue:
df1 <- data.frame(matrix(0, 0, 2))
names(df1) <- names(df2)
2009 Jan 21
3
merging several dataframes from a list
Hi there,
I have a list of dataframes (generated by reading multiple files) and all
dataframes are comparable in dimension and column names. They also have a
common column, which, I'd like to use for merging. To give a simple example of
what I have:
df1 <- data.frame(c(LETTERS[1:5]), c(2,6,3,1,9))
names(df1) <- c("pos", "data")
df3 <- df2 <- df1
df2$data
2012 Jul 11
4
Help with loop
Hi,
I have two dataframes:
The first, df1, contains some missing data:
cola colb colc cold cole
1 NA 5 9 NA 17
2 NA 6 NA 14 NA
3 3 NA 11 15 19
4 4 8 12 NA 20
The second, df2, contains the following:
cola colb colc cold cole
1 1.4 0.8 0.02 1.6 0.6
I'm wanting all missing data in df1$cola to be replaced by the value of
df2$cola.
2011 Nov 30
1
Replace columns in a data.frame randomly splitted
Dear community,
I'm working with the data.frame attached (
http://r.789695.n4.nabble.com/file/n4122926/df1.xls df1.xls ), let's call it
df1.
I typed: df1<- read.xls("C:/... dir .../df1.xls",colNames= TRUE, rowNames=
TRUE)
Then I splited randomly df1 using splitdf function
(http://gettinggeneticsdone.blogspot.com/2011/03/splitting-
dataset-revisited-keeping.html)
2007 May 05
1
(no subject)
Dear Mailing-List,
I think this is a newbie question. However, i would like to integrate a
loop in the function below. So that the script calculates for each
variable within the dataframe df1 the connecting data in df2. Actually it
takes only the first row. I hope that's clear. My goal is to apply the
function for each data in df1. Many thanks in advance. An example is as
follows:
df1
2005 Jun 09
1
Subassignments involving NAs in data frames
I'm seeing some inconsistent behavior when re-assigning values in a data
frame. The first assignment turns all of the 0s in my data frame to 2s,
the second fails to do so.
> df1 <- data.frame(a = c(NA, 0, 3, 4))
> df2 <- data.frame(a = c(NA, 0, 0, 4))
> df1[df1 == 0] <- 2 ## Works
> df2[df2 == 0] <- 2
Error: NAs are not allowed in subscripted assignments
Checking an
2006 Jul 01
1
noncentral F-distributed random numbers (PR#9055)
Full_Name: Long Qu
Version: 2.3.1
OS: Windows XP
Submission from: (NULL) (64.113.93.235)
The QQ-plot of two versions of simulating noncentral F-distributed random
numbers has quite different scales:
> qqplot(rf(1000,2,15,3),qf(runif(1000),2,15,3))
The rf() function reads:
> rf
function (n, df1, df2, ncp = 0)
{
if (ncp == 0)
.Internal(rf(n, df1, df2))
else rchisq(n, df1,
2008 Dec 28
2
Conditional operation on multiple columns from two data frames
Hi-
I have two data frames for which I wish to conditionally subtract the values
of one dataframe from the other.
I want to subtract df1$x from df2$x when their id is equal and the absolute
value of difference between the dates is 12 hours or less. If there is no
match of equal id's and dates less than 12 hours apart I want it to return
"NA". Note that df1 has missing values in x
2008 Feb 19
2
Looping through a list of objects & do something...
Hey Folks,
Could somebody show me how to loop through a list of dataframes? I want to
be able to generically access their elements and do something with them.
For instance, instead of this:
df1<- data.frame(x=(1:5),y=(1:5));
df2<- data.frame(x=(1:5),y=(1:5));
df3<- data.frame(x=(1:5),y=(1:5));
plot(df1$x,df1$y);
plot(df2$x,df2$y);
plot(df3$x,df3$y);
I would like to do something like: