Displaying 20 results from an estimated 30 matches for "responsenam".
Did you mean:
responsename
2019 Mar 12
3
as.data.frame.table() does not recognize default.stringsAsFactors()
...2 b 2
3 c 1
> class(d3$x)
[1] ?factor"
> d4<-as.data.frame(table(x),stringsAsFactors=F)
> class(d4$x)
[1] ?character"
# Display the code showing the different stringsAsFactors handling in table and matrix:
> as.data.frame.table
function (x, row.names = NULL, ..., responseName = "Freq", stringsAsFactors = TRUE,
sep = "", base = list(LETTERS))
{
ex <- quote(data.frame(do.call("expand.grid", c(dimnames(provideDimnames(x,
sep = sep, base = base)), KEEP.OUT.ATTRS = FALSE, stringsAsFactors = stringsAsFactors)),
Freq =...
2008 Nov 30
4
simple question with table()
...uestion with 14 possible answers. None of
the respondents choose the 13th answer, so when I table() the results,
R says:
1 2 3 4 5 6 7 8 9 10 11 12 14
31 52 7 21 40 7 8 2 28 2 2 1 17
13 is missing... anyone knows how to tell table() that there are 14
modalities in the answers? I tried with
responseName
=c("1","2","3","4","5","6","7","8","9","10","11","12","13","14")
but all I have is:
error in table....
all the arguments must have the same length
thank y...
2007 Feb 16
2
How is the line in av.plot calculated?
I suspect that the line in the added variable plot (library car) is a SLR of
the residuals, but I can't seem to find this written anywhere. Can someone
confirm this? Thanks.
Tom
[[alternative HTML version deleted]]
2011 Mar 26
1
bwplot [lattice]: how to get different y-axis scales for each row?
...t;),
attr=paste("attribute=", seq_len(3), sep=""))
set.seed(1)
data <- rexp(prod(dim))
arr <- array(data=data, dim=dim, dimnames=dimnames)
arr[,2,,] <- arr[,2,,]*10
arr[,4,2,2] <- arr[,4,2,2]*10
z <- abs(sweep(arr, 3, 1))
df <- as.data.frame.table(z, responseName="error")
## box plot
bwplot(error ~ methods | attr * groups, data=df,
as.table=TRUE, notch=TRUE,
scales=list(alternating=c(1,1), tck=c(1,0)))
## with relation="sliced"
bwplot(error ~ methods | attr * groups, data=df,
as.table=TRUE, notch=TRUE,
sc...
2011 Mar 26
1
bwplot: how to get plotmath labels?
...""),
methods=c(expression(method==1), expression(alpha=1)),
attr=paste("attribute=", seq_len(3), sep=""))
data <- rexp(prod(dim))
arr <- array(data=data, dim=dim, dimnames=dimnames)
z <- abs(sweep(arr, 3, 1))
df <- as.data.frame.table(z, responseName="error")
## box plot
bwplot(error ~ methods | attr * groups, data=df,
as.table=TRUE, outer=FALSE, strip=TRUE, notch=TRUE,
scales=list(alternating=c(1,1), tck=c(1,0)))
2005 Nov 27
4
Counting the occurence of each unique "charecter string"
LS,
I would really like to know how to count the frequency/occurrence of chachters inside a dataset. I am working with extreemly large datasets of forest inventory data with a large variety of different species inside it.
Each row inside the dataframe represents one individual tree and the simplified dataframe looks something like this:
num species dbh
1 sp1
2005 Nov 27
4
Counting the occurence of each unique "charecter string"
LS,
I would really like to know how to count the frequency/occurrence of chachters inside a dataset. I am working with extreemly large datasets of forest inventory data with a large variety of different species inside it.
Each row inside the dataframe represents one individual tree and the simplified dataframe looks something like this:
num species dbh
1 sp1
2019 Mar 14
0
as.data.frame.table() does not recognize default.stringsAsFactors()
...actor"
>> d4<-as.data.frame(table(x),stringsAsFactors=F)
>> class(d4$x)
> [1] ?character"
>
>
> # Display the code showing the different stringsAsFactors handling in table and matrix:
>
>> as.data.frame.table
> function (x, row.names = NULL, ..., responseName = "Freq", stringsAsFactors = TRUE,
> sep = "", base = list(LETTERS))
> {
> ex <- quote(data.frame(do.call("expand.grid", c(dimnames(provideDimnames(x,
> sep = sep, base = base)), KEEP.OUT.ATTRS = FALSE, stringsAsFactors = stringsAsFactors))...
2006 Apr 04
2
documenting s4 methods in package
...@removed)))
if(all(i==0)){
return(list())
} else {
if(simplify) x@outlier.removal[seq(along=i)[i==0]]
<mailto:x@outlier.removal[seq(along=i)[i==0]]<-NULL> <-NULL
tmp <-
lapply(x@outlier.removal,getRemovedDf.OAD,x@predictorName,x@responseName)
if(descrip){
f <- as.data.frame(descrip[!"history"%in%names(x@descrip)])
return(lapply(tmp,function(x)cbind(f,x)))
} else {
return(tmp)
}
}
}
)
MAN FILE
\name{getRemovedDf.OAD}
\alias{g...
2016 May 23
2
data frame method for as.table()
Hello,
Currently it's possible to convert an object of class table to a data frame
with as.data.frame.table(), but there's no ready-made function, AFAIK, to do
the reverse operation, i.e. conversion of a data frame to a table.
Do you think it would be a good idea to add a data.frame method to
as.table(), to allow such conversions?
The idea is that if `x' is a table and `y <-
2009 Jul 08
3
matching each row
I have two dataframes, the first column of each dataframe is a unique id
number (the rest of the columns are data variables).
I would like to figure out how many times each id number appears in each
dataframe.
So far I can use:
length( match (dataframeA$unique.id[1], dataframeB$unique.id) )
but this only works on each row of dataframe A one-at-a-time.
I would like to do this for all of
2009 Aug 03
4
Table to Data-frame
Hello
How to pass from table to data-frame ?
Thanks
2008 Nov 30
0
Fwd: simple question with table()
...8
> 9 10 11 12 14
> 31 52 7 21 40 7 8 2
> 28 2 2 1 17
>
> 13 is missing... anyone knows how to tell table() that there are 14
> modalities in the answers? I tried with
>
> responseName
> =c("1","2","3","4","5","6","7","8","9","10","11","12","13","14")
>
> but all I have is:
>
> error in table....
> all the arguments must h...
2009 May 29
1
data manipulation involving aggregate
hi all,
I often have a data frame like this example
data.frame(sq=c(1,1,1,2,2,3,3,3,3),area=c(1,2,3,1,2,3,1,2,3),habitat=c("garden","garden","pond","field","garden","river","garden","field","field"))
for each "sq" I have multiple "habitat"s each with an associated "area".
I
2010 Apr 02
2
panel data
Hello, I have an unbalanced panel data set that looks like:
ID,YEAR,HEIGHT
Tom,2007,65
Tom,2008,66
Mary,2007,45
Mary,2008,50
Harry,2007,62
Harry,2008,62
James,2007,68
Jack,2007,70
Jordan,2008,72
That is, James, Jack, and Jordan are missing a YEAR.
Is there any command that will "fill in" the missing YEAR such that the end
result will be balanced and look like:
ID,YEAR,HEIGHT
2012 Apr 19
3
How to "flatten" a multidimensional array into a dataframe?
Hi,
I have a three dimensional array, e.g.,
my.array = array(0, dim=c(2,3,4), dimnames=list( d1=c("A1","A2"),
d2=c("B1","B2","B3"), d3=c("C1","C2","C3","C4")) )
what I would like to get is then a dataframe:
d1 d2 d3 value
A1 B1 C1 0
A2 B1 C1 0
.
.
.
A2 B3 C4 0
I'm sure there is one function to do
2012 Feb 13
3
Change dataframe-structure
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt.
Name: nicht verf?gbar
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120213/d2a5afa6/attachment.pl>
2016 May 23
0
data frame method for as.table()
...to xtabs() at the end:
"The as.data.frame method for objects inheriting from class "table" can be used to convert the array-based representation of a contingency table to a data frame containing the classifying factors and the corresponding entries (the latter as component named by responseName). This is the inverse of xtabs."
For example, from ?xtabs, using the ?UCBAdmissions dataset, which is a 3 dimension table:
> str(UCBAdmissions)
table [1:2, 1:2, 1:6] 512 313 89 19 353 207 17 8 120 205 ...
- attr(*, "dimnames")=List of 3
..$ Admit : chr [1:2] "Admitted...
2009 Jul 14
2
How to provide list as an argument for the data.frame()
Hi R -users,
i've a table as describe below. I'm reading the numeric value presented in this table to populate a list.
#table
#============
#X A B C
#x1 2 3 4
#x2 5 7 10
#x4 2 3 5
#============
rawData <- read.table("raw_data.txt",header=T, sep="\t")
myList=list()
counter=0
for (i in c(1:length(rawData$X)))
{
print (i)
2010 Jul 05
2
repeated measures with missing data
Dear R help group, I am teaching myself linear mixed models with missing data since I would like to analyze a stats design with these kind of models. The textbook example is for the procedure "proc MIXED" in SAS, but I would like to know if there is an equivalent in R. This example only includes two time-measurements across subjects (a t-test "with missing values"), but I