Displaying 20 results from an estimated 1609 matches for "freq".
Did you mean:
free
2012 Sep 20
3
(no subject)
..."f", "e", "g", "f", "f", "i", "g")
b<-c("a", "g", "d", "f", "g", "a", "f", "a", "b", "g")
# Of these vectors, you can create frequency lists by writing
freq.list.a<-table(a); freq.list.b<-table(b)
rm(a); rm(b)
# How do you merge these two frequency lists without merging the two
vectors first? More specifically, if I delete a and b from your
memory,
rm(a); rm(b)
# how do you generate the following table only from freq.l...
2011 Jul 30
3
ifelse returns
...ta
#=======================================================================
# Beginning of code
#=======================================================================
x<-c(2,3,4,4,5,5,6,6,8,10)
df<-as.data.frame(table(x))
df<-df[order(df$Freq),]
m<-max(df$Freq)
(MODE1<-as.vector(as.numeric(as.character(subset(df,Freq==m)[,1]))))
ifelse(sum(df$Freq)/length(df$Freq)==1,warning("No Mode: Frequency of all values is 1", call. = FALSE),MODE1)
#===================================================================...
2008 Jun 12
3
Problem with Freq function {prettyR}
Dear list,
I have a problem with freq from prettyR.
Please have a look at my syntax with a litte example:
library(prettyR)
#Version 1
test.df<-data.frame(q1=sample(1:4,8,TRUE), gender=sample(c("f","m"),8,TRUE))
test.df
freq(test.df) #No error message
#Version 2
test.df<-data.frame(gender=sample(c("f&...
2007 Sep 21
1
Help create a loopto conduct multiple pairwise operations
#Hello,
#I have three data frames, X,Y and Z with two columns each and different
numbers of rows.
# creation of data frame X
X.alleles <- c(1,5,6,7,8)
X.Freq <- c(0.35, 0.15, 0.05 , 0.10, 0.35)
Loc1 <- cbind( X.alleles,X.Freq)
X <- data.frame(Loc1)
#creation of data frame Y
Y.alleles <- c(1,4,6,8)
Y.Freq <- c(0.35, 0.35, 0.10, 0.20 )
Loc2 <- cbind(Y.alleles, Y.Freq)
Y <- data.f...
2009 Jan 20
1
generalizing expand.table: table -> data.frame
In
http://tolstoy.newcastle.edu.au/R/e2/help/06/10/3064.html
a method was given for converting a frequency table to an expanded data
frame representing each
observation as a set of factors. A slightly modified version was later
included in the NCStats package,
only on http://rforge.net/ (and it has too many dependencies to be useful).
I've tried to make it more general, allowing an input da...
2012 Mar 13
1
size of graphs when using multiple figures by row
Hi all,
I have a basic question concerning graphs in R. I?m using the par()
function and I?m working with multiple figures by row (mfrow) but my the
hight of my figures become compressed. I have 4 rows and 2 columns (because
I want to plot 8 histograms (freq = FALSE ) on it. I know I can adapt my
margins with for example ?oma? and ?mai? but I don?t know how to choose the
size of the figure? I read something about pin. That this should go about
?the current plot dimensions, (width, height), in inches. But I don?t know
which values I should use. Because...
2003 Apr 24
5
Fast R implementation of Gini mean difference
I have written the following function to calculate the weighted mean
difference for univariate data (see
http://www.xycoon.com/gini_mean_difference.htm for a related
formula). Unsurprisingly, the function is slow (compared to sd or mad)
for long vectors. I wonder if there's a way to make the function
faster, short of creating an external C function. Thanks very much
for your advice.
gmd
2005 Jul 01
2
the format of the result
I write a function to get the frequency and prop of a variable.
freq<-function(x,digits=3)
{naa<-is.na(x)
nas<-sum(naa)
if (any(naa))
x<-x[!naa]
n<-length(x)
ta<-table(x)
prop<-prop.table(ta)*100
res<-rbind(ta,prop)
rownames(res)<-c("Freq","Prop")
cat("Missing value(s) are",n...
2006 Apr 11
1
error in which(): recursive default argument reference
...12 15
However, when embedded in the fonction, the following error occurred :
> compute.word("hello")
Error in which(letters == x) : recursive default argument reference
Any insights would be helpful ...
Cheers,
Matthieu
Function :
#computes some probabilities based on (1) word frequency (word.freq),
letters visibility(letters.vis), letters frequency(letters.freq) and
viewing eccentricity (pos)
compute.word <- function(word, pos=X, word.freq=word.freq,
letters=letters, letters.vis=letters.vis, letters.freq=letters.freq)
{
word.split <- unlist(strsplit(word, spli...
2008 Oct 22
24
Problems with enabling hypervisor C and P-state control
Hi,
Is there any documentation on enabling hypervisor support for both C
and P-state control?
On xen-unstable and linux-2.6.18-xen.hg, if I enable cpuidle=1 on the
xen command line and then run xenpm, I will get output for C-states
(shown below) but it complains that "Xen cpufreq is not enabled!"
cpu id : 0
total C-states : 2
idle time(ms) : 73264
C0 : transition [00000000000000000000]
residency [00000000000000000000 ms]
C1 : transition [00000000000000025505]...
2008 Feb 14
5
data manipulation for plotting
Hi,
i'd like to plot some data that I have with the value on the x axis and freq
on the y axis.
So, I need to calculate the freq a value is seen within my data vector
for example, say i have a vector of data
data=c(1,1,1,4,5,5,6)
I want
values<-c(1,4,5,6)
freq<-c(3,1,2,1)
in order to enable me to plot this. Sorry, i'm new to R. What is s...
1998 Jan 23
2
hist: rel.freqs
In R0.61,
In hist(), should the line
rel.freqs <- counts/(sum(x) * diff(breaks))
computing the relative frequencies or height of the rectangles
in a histogram not be
rel.freqs <- counts/(sum(counts) * diff(breaks))
instead, or do I misunderstand something?
Thanks,
Philippe
--
-------------------------------------------------------...
2000 Nov 17
2
hist() and density
There were some questions about hist() a couple of days ago which
triggered this post. My question/suggestion is about the y-axis in hist.
There are reasons to prefer making the y-axis density=relative
frequency/bin width. One reason is that the height of the plot does not
depend on the bin width; another is that if your histogram is in density
then you can easily superimpose a smooth theoretical pdf on top--they will
be on the same scale. (BTW the best intro stats book--Freedman et al--only
shows stu...
2009 Feb 12
1
Latex or html output for freq() in prettyR
Hi Everybody
I need to create a lot of frequency tables with frequencies and percentages
(and cumilative freq and % as well) for a report. freq() in prettyR give
more or less what I need.
I am trying to export the result of freq() to html but the html doesn't look
look the console output.
See the following example
library(prettyR)
lib...
2000 Jul 09
1
Modified Histogram functions
...Norway Prove their worth by hitting back
E-mail: kjetikj@astro.uio.no - Piet Hein
Homepage <URL:http://www.astro.uio.no/~kjetikj/>
Webmaster@skepsis.no
hist <- function(x, ...) UseMethod("hist")
hist.default <-
function (x, breaks, freq= NULL, probability = !freq, include.lowest= TRUE,
right=TRUE, col = NULL, border = par("fg"),
main = paste("Histogram of" , deparse(substitute(x))),
xlim = range(breaks), ylim = range(y, 0),
xlab = deparse(substitute(x)), ylab,
axes = TRUE, plo...
2017 Sep 26
0
bowed linear approximations
...Interpolating the data only makes sense if there's no random component to the response (mag in your data). Otherwise, it makes more sense to get "predictions" from a statistical model that has an explicit error component for the response. In your case, a simple quadratic model in log(freq) seems to fit the data reasonably well.
To see what I mean, try
plot(log(freq), mag)
mod <- lm(mag ~ poly(log(freq), 2))
summary(mod)
points(log(freq), fitted(mod), pch=16)
lines(spline(log(freq), fitted(mod)))
Some basic regression diagnostics suggest that we can do better by taking the log...
2010 Feb 14
4
Problem in performing goodness of fit test in R.
I am trying to perform goodness of fit test using R. I am using this website http://wiener.math.csi.cuny.edu/Statistics/R/simpleR/stat013.html for help. However, I am unable to carry out the test successfully. My code follows. It is taken from the website just mentioned.
freq=c(22,21,22,27,22,36) # frequencies obtained after rolling the dice 150 times.
prob=c(1,1,1,1,1,1)/6 # specify expected frequency for each category.
chisq.test(freq,p=prob) # I do not know what this line means. I just followed instructions on the website.
The erorr I receive is "erorr in chisq....
2013 Feb 15
10
reading data
Hi,
#working directory data1 #changed name data to data1.? Added some files in each of sub directories a1, a2, etc.
?indx1<- indx[indx!=""]
lapply(indx1,function(x) list.files(x))
#[[1]]
#[1] "a1.txt"??????? "mmmmm11kk.txt"
#[[2]]
#[1] "a2.txt"??????? "mmmmm11kk.txt"
#[[3]]
#[1] "a3.txt"??????? "mmmmm11kk.txt"
#[[4]]
#[1]
2013 Apr 10
2
Table with n(%) formatting: A better way to do this?
...de helps me assess my progress as an R programmer.
Ultimately want to have code that I can turn into a function. Will then use the output produced to make tables using odfWeave and Sweave/knitr.
Thanks,
Paul
breaks <- as.data.frame(lapply(warpbreaks, function(x) rep(x, warpbreaks$breaks)))
Freq <- with(breaks, addmargins(table(wool, tension), 2))
Prop <- round( prop.table(Freq, 2) * 100, 2 )
Freq <- addmargins(Freq, 1)
Prop <- addmargins(Prop, 1)
require(odfWeave)
class(Freq) <- "character"
class(Prop) <- "character"
FreqProp <- matrixPaste(Freq,...
2014 Jun 05
3
Cannot obtain CPU freq during vbox machine creation
Dear libvirt experts,
I can not instantiate even a simple machine when using the 'vbox' hypervisor:
s14% virt-install --connect=vbox:///session --virt-type vbox --name vtest --memory 500
ERROR cannot obtain CPU freq: No such file or directory
s14% virsh -c vbox:///session
błąd: cannot obtain CPU freq: No such file or directory
(1)
How to fix this error? The VirtualBox driver seems to be installed:
s14% virsh -V
Narzędzie wiersza poleceń virsh biblioteki libvirt 1.2.5
Proszę zobaczyć stronę WWW pod adresem h...