x - c(1, 2, 3)
n - 10
## so using the recycling rules, I would like to get from FUN(x, n)==1
## I am doing:
xRecycled - rep(x, length.out=n)[n]
This works, but it seems to me that I am missing something really basic
here
- is there more straightforward way of doing this?
x[n %%
As for the standard deviation, are you sure you want this? Standard
deviation only makes sense if the data are normally distributed...
--
-- This is false, of course. What you probably meant to say is something
like:
The sample standard deviation may not tell you what you
I am trying to prepare a bed file to load as accustom track on the
UCSC genome browser.
I have a data frame that looks like the one below.
x
V1V2 V3
1 chr1 11255 55
2 chr1 11320 29
3 chr1 11400 45
4 chr2 21680 35
5 chr2 21750 84
6 chr2 21820 29
7 chr2 31890 46
8 chr3 32100
I am new to R. I am using the impute package with data contained in csv
file.
I have followed the example in the impute package as follows:
mydata = read.csv(sample_impute.csv, header = TRUE)
mydata.expr - mydata[-1,-(1:2)]
mydata.imputed - impute.knn(as.matrix(mydata.expr))
The
Actually (after some trials) there is a little problem when faced with
zeros...
getndp(1.0)
[1] 0
Are you sure this isn't what you want? 1.0 is just 1 in disguise, and
round(1.0, 0) is the same as round(1.0, 1) anyway.
Note that I thought on a very different way which was starting
Am I right in thinking that the correct way of working out how many
possible
permutations there can be in this instance is: N! / (n1!) (n2!) (n3!)...
(ni!). Where N is the number of taxa (14) and (for character 2) n1 could
be
'number of state zeros' (i.e., 2), n2 could be 'number of state
Let´s say I have 10 models, each named m1,m2,m3..., and I would like
to summarize them automatically
and simultaneously - e.g., to extract parameter estimates later on
from all models; how can I do that?
I have tried:
x=1:10 #this creates some example data
y=rnorm(10)
m1=lm(x~y)
I am plotting some data, and use text() to get variable names next to
points on the graph. What is the best way to make sure that these text
labels are readable and not overlapping when two datapoints are close?
I've tried using jitter(), but the effect is random and doesn't always
give a
I wrote some user defined function for my own. Now I want to get a
mechanism
so that every time I start R, those function will automatically be
loaded in
R without manually copying pasting. Can gurus here pls tell me how to do
that? Or I have to build my own packages bundled with those
lucy b wrote:
I have a workspace containing only data frame objects. I would like to
loop though each one and clean-up text columns in them. How can I have
R loop through the list? I have tried to find an answer in R help but
the closest solution I can find is to make a static list of
mysimbaa wrote:
I write some code which produce a graphic
Now I try at the end to output it (bitmap or jpeg) like this way :
- pop up window asking me to choose a path where to save my picture
- choose name for this picture
Your message isn't very clear, so forgive me if I have
I have this in excel
Control
543_BU
123_AT
432_CU
I want to be able to import to R so that it will read like this
c-c(543_BU,123_AT,432_CU)
See the help page for read.csv
?read.csv
...and the R Data Import/Export manual
http://cran.r-project.org/doc/manuals/R-data.html
Two things
I've read in a csv file (test.csv) which gives me the following table:
Hin1 Hin2 Hin3Hin4 Hin5 Hin6
HAI1 9534.83 4001.74 157.16 3736.93 484.60 59.25
HAI2 13272.48 1519.88 36.35 33.64 46.68 82.11
HAI3 12587.71 5686.94 656.62 572.29 351.60 136.91
HAI4
I need some help, because I don't know how this error means: Error:
variables ?Output1?, ?Output2?, ?Output3?, ?Output4?, ?Output5? were
specified with different types from the fit
Execution halted
Can you help me?
No!
Please read the posting guide at
Was wondering if it is possible to pass function name as a parameter
Yes. This isn't exactly what you wanted, but it demonstrates the
principle.
x = rnorm(5)
[1] -0.6510448 0.4591730 1.3225205 1.2314391 -0.0888139
myfun - function(fname, x) eval(parse(text=paste(fname,(x),sep=)))
I have two data frames. Suppose the first has rows
r1
r2
r3
and the second has rows
R1
R2
R3
I'd like to generate the data frame:
r1 R1
r1 R2
r1 R3
r2 R1
r2 R2
r2 R3
r3 R1
r3 R2
r3 R3
Try:
col1 - paste(r, 1:3, sep=)
Is there any function in R which sorted data as
x1 - c(1,3,2,4,5,1)
x2 - c(2,0,2,3,5,2)
TheData - data.frame(x1,x2)
TheData1 - sort(TheData, by=c(x1,x2))
Yes; see ?order and the R FAQ 7.23
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-sort-the-rows-of-a-data-frame_003f
Regards,
I realized that not everyone has Matlab and that basically the
issue
is purely how to deal with the returned data in R, so I have
revised
my example code and made it easier to copy-paste and run:
#Make a data frame in R
Maker - factor(c(HP, HP, Sony, DELL, whitebox,
Lila86 wrote:
I have two groups (men and women) and I know per group how many of them
smoke or don't smoke (women 40 of 200; men 100 of 300). I would like to
know how I can compare in R if men and women differ significantly in their
smoking. However, because there are more men in the
I noted that there is a hsv2rgb in the C-API, but no corresponding
function in
R, while rgb2hsv is available in R.
Does the functionality of hsv2rgb hide under some other name?
I agree that it does seem like such a function ought to exist. You can
use col2rgb(hsv(...)) to get what you
Is there a way to reorder the xaxis using lattice. Using the
following data, the x-axis is ordered as BP GH MH PF RE RP SF VT but
I would like the x-axis to be ordered as PF RP BP GH VT SF RE MH.
Kön Skalor Tillfälle Medelvärde
1 Kvinnor BP 1-inskrivning 36.45283
I have written a function in order to analyse gaze paths. It works
with the test data but when I try to apply the function to a data
frame that stores the real data in columns I receive the error
message that the
In if (pp 1) { :
condition has length 1 only the first element will
I have an other problem, I have this vector signData with an alternation
of
1 and -1 that corrispond to the duration of two different percepts. I
extracted the durations like this:
signData- scan(dataTR10.txt)
dur-rle(signData)$length
I think that last line should be
Is there anyone know if BUGS language allows the combination of
variables as response
It seems doesn't work in my model. The problem is between two ##.
modelCompile(numChains=1)
multiple definitions of node bm[1]
###
bm[iter] -
I'm new to R, and I've sent this message as a non-member, but since it's
pretty urgent, I'm sending it again now I'm on the mailing list (Thanks
Daniel for your suggestion nevertheless).
I have calculated a regression in the form of M ~ D + O + S, and I would
like to take this regression
I would like to be able to plot histograms/densities on a semi-log or
log-log scale.
# Get a random log-normal distribution
r - rlnorm(1000)
# Get the distribution without plotting it using tighter breaks
h - hist(r, plot=F, breaks=c(seq(0,max(r)+1, .1)))
# Plot the distribution using
is it possible to sort a file by the row names?
I presume you mean a data frame rather than a file. In which case the
answer is yes:
df - data.frame(a=1:10, b=rnorm(10), row.names=sample(letters[1:10]))
df[order(rownames(df)),]
Regards,
Richie.
Mathematical Sciences Unit
HSL
I wonder if there is any swap function in R that does the following:
x - seq(1,10,12)
This just makes x equal to 1. I'm guessing you meant something like
x - 1:10
x1 - swap(x)
x1
1 8 3 4 5 6 7 2 10
It's not terribly clear what you want swap to do. You can reorder the
elements of x
Hello Richie,
I would like to do three (or k) swap steps in each step just 2 ID
recursive swaping
x - 1:10
swap - function(x){
a - sample(x,2)
x[x==a[1]] - swap[2]
x[x==a[2]] - swap[1]
return(x)
}
swap(swap(swap(x))) - mix
I tried my best with a response before, but if you
I have to match names where names can be recorded with errors or
additions.
Now I am searching for a string search function which returns always
the closest match. E.g. searching for Washington it should
return only Washington but not Washington, D.C. But it also could be
that the list
I am trying to debug a program, and I think tryCatch will help. The
functions involved
process through so many times before I encounter the error, things
are a bit slow to
use debug and browser().
I've read the help file and postings on conditions, and am still
having trouble.
I don't understand the warning I get when executing the following code:
x - rnorm(100)
h - hist(x, plot= FALSE, freq = FALSE)
The warning is
Warning message:
In hist.default(x, plot = FALSE, freq = FALSE) :
argument ‘freq’ is not made use of
The explanation is pretty simple.
freq
I have a survivor curve that shows account cancellations during the
past 3.5 months. Â Fortunately for our business, but unfortunately
for my analysis, the survivor curve doesn't yet pass through 50%.
 Is there a safe way to extend the survivor curve and estimate at
what time we'll hit
How do you persuade lattice to draw tick marks on both the left and right
side of the y-axis, when relation=free in the scales component?
#Ticks appear on both sides
histogram(~height|voice.part, data=singer)
##Ticks only on left
histogram(~height|voice.part, data=singer,
How do you persuade lattice to draw tick marks on both the left and
right
side of the y-axis, when relation=free in the scales component?
#Ticks appear on both sides
histogram(~height|voice.part, data=singer)
##Ticks only on left
histogram(~height|voice.part, data=singer,
I have a data set containing 2,122,164 records and 38198952 fields.
I can not import this data due to momory problem.
Is there a way to solve this problem?
1. Filter the data before you import it. Do you really need all 38
million fields? Can you ignore some of the 2 million records?
As per my attached script I am ploting monthly mean data which has
missing
months.
But in the plot missing months are not shown (plot attached).
Kindly help how to show complete plot (Jan-Dec) with missing months.
I don't accept scripts from strangers, but I guess the problem looks like
Does anyone know an easy way to convert all the zero values in a
imported csv table into NA's
Depends on the data structure you gave your imported table. In a
single numeric vector (named, say, vec), the syntax is
is.na(vec[vec==0]) - TRUE
That throws errors for me. An alternative is
I have a basis question regarding the use of color in the lattice
package. I
read the ?barchart help page and searched the R archives but could not
understand how to do it.
I just need to plot a barchart using specific colors for my groups, e.g.
green and red instead of the default lattice
Thank you for a clear example, it works. I tried to play with
superpose.polygon before to no avail, this clarifies things.
You're welcome.
Another question: would you know how to add gridlines to the plot?
I'd like to have a few horizontal gridlines on my barchart plot for
better
Is there a way to use the cycle variable for rowname?
v=1:6
for (a in 1:3){
for (b in 4:5) {
v=rbind(v,a.b=1)
}
}
v
This above obviously does not work, but I couldn't find out how to use a
and
b to construct a rowname like 14, 15, 24, 25.
Not pretty, but this does the trick.
I'm trying to plot graphs using lattice with this script :
xyplot(Y ~ X | factmod,
panel = function(x, y) {
panel.grid(h=-1, v=-1, col=gray)
panel.xyplot(x, y, type=p, pch=20)
panel.points(50,Idata, data=devdata, col=red) -
this
Can we get the code for calculating Oja median for multivariate data
RSiteSearch(oja median) returns a link to this R-help post with code
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/12781.html
Regards,
Richie.
Mathematical Sciences Unit
HSL
I would like to write Greek letters followed by subscripts in a
graph (on the X-axis and in a legend). I would appreciate any help.
See FAQ 7.13 and ?plotmath for examples.
Regards,
Richie.
Mathematical Sciences Unit
HSL
The good thing about training and evangelization ...
I spent quite a lot of time evangelizing about R when I first started my
current job. Eventually my boss told me I was an R-Soul, or something
that sounded like that anyway. ; )
Regards,
Richie.
Mathematical Sciences Unit
HSL
I am trying to produce some panels with dots in an X/Y plane where the
diameter of the dots indicates a Z value (like e.g. earthquake maps
where dot
sizes indicate magnitudes and X/Y the location).
This works fine with xyplot, e.g.:
xyplot(1:3~1:3,cex=1:3,pch=16)
However, when I do
I'm trying to find a way to change the font size in a mosaic plot (the
grid version, not the base graphics one).
Here's an example to demonstrate:
#Basic plot
library(vcd)
mosaic(HairEyeColor, shade = TRUE)
#Bad first guess: this stops the default cell colouring, and doesn't
change the font
x=1:80
I want to sum up first 8 elements of x, then again next 8 elements of x,
then again another 8 elements. So, my new vector should look like:
c(36,100,164,228,292,356,420,484,548,612)
I used:
aggregate(x,list(rep(1:10,each=8)),sum)[-1]
or
I ran into some trouble handling missing values.
Assume 2 vectors (numeric) including NAs
a - c(rep(seq(1,4),4),NA,NA)
b - c(sample(1:2,14,replace=T),NA,NA,1,2)
I want to replace the values of vector a that are smaller than 2 and
larger than 3 into NAs only in case vector b equals 1
I am new to R, and was wondering how to do 3D linear
regression in R. In other words, I need to Fit a
3-Dimensional Line to Data Points (input).
I googled before posting this, and found that it is
possible in Matlab and other commercial packages. For
example, see the Matlab link:
I am looking to making a panel of pie charts fo some of my
dritribution data . I was wondering if there is a way in any R
package to write a small script to do so.
pie() will do you a one-off pie chart, but there is no equivalent using
grid/ lattice graphics. You could write a panel.pie
try(log(rnorm(25)),silent=TRUE)
[1] -0.26396185 NaN NaN -0.13078069 -2.44997193
-2.15603971 NaN 0.94917495 0.07244544 NaN
[11] -1.06341127 -0.42293099 -0.53769569 0.95134763 0.93403340
NaN -0.10502078 NaN 0.30283262 NaN
[21]
Can someone help me to understand the meaning of the following R line?
list(fk5 ~ .)
fk5 ~. is a formula, most likely used by a regression (or similar model).
fk5 is the response variable, and the dot is a placeholder for 'whatever
was on that side of the formula before'. (This is usually
For example, c(dog.is.an.animal, cat.is.an.animal, rat.is.an.
animal). How can I identify the common prefix is .is.an.animal
and delete it to give c(dog, cat, rat) ?
foo - c(dog.is.an.animal, cat.is.an.animal, rat.is.an.animal)
sub(.is.an.animal, , foo)
Being pedantic, .is.an.animal is a
p=v=
q=5
eval(parse(text=paste(p,q,sep=)))
... then the value of v is 5, OK.
but I can't with strings, for example:
p=v=
q=hello friend
eval(parse(text=paste(p,q,sep=)))
.. error
Try:
eval(parse(text=paste(p,',q,',sep=)))
Regards,
Richie.
Mathematical Sciences Unit
HSL
thegeologician wrote:
... very often time-series plots of some values are
given rather to show the temporal correlation of these, than to show the
actual numerical values! The same applies for plots of some sample
values over distance (eg. element concentration over a sample or
thegeologician wrote:
A plot of the actual temperature during a year (or thousands of years,
as people in palaeoclimate-studies are rather used to) is just so much
more intuitive, than some correlation-coefficients or such. I know I'm
largely speaking to statisticians in this forum, but
I have two data frames and am running a loop to match similar rows.
However the matching is not working well, and I suspect it is because of
the different formats of columns. For example, in col. 1 of dataframe 1
the nummbers are formatted as 1,2,3,4,5,6,7,8,9...31 However in col. 1
I have the following data called mydata in a data.frame
Col1 Col2 Col3 Col4 Col5
1 2 46 7
8 8 73 5
4 4 56 7
I want to replace the data according to the following conditions
Condition 1 if data = 3, replace with -1
Condition 2
I have a surprising problem while selecting values in a sequence created
with the seq() function...
...
test2-seq(from=0,to=1,by=.1)
...
test2==0.3
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
...
Does anyones has an explanation and a solution ?
I suspect that
How would I make the default behaviour of my plots produce output such
as the following (i.e. tick marks inside on all axes, labels only on two
(arbitrary?) sides) without needing the five additional commands each
time?
plot(1:10, axes=FALSE)
axis(1, tcl=0.5)
axis(2, tcl=0.5)
axis(3,
For example, the y axis shows 0 50 150. Is there any way to
beautify the tick labels to get 0 5 10 15, and at the top of y-axis
x10^5
(superscript 5) ? My plots all have different ylim, how to perform the
beautification automatically ?
plot((0:15)*1e5, yaxt=n, ylab=)
axis(side=2,
I would like to do looping for this process below to estimate alpha
beta from gamma distribution:
Here are my data:
day_data1 -
123456 789 10 11 12
13 14 15 16 17 18 19 20 21 22 23
1943 48.3 18.5 0.0 0.0 18.3 0.0 0.0
The (imho) unintuitive behaviour is to do with the subsetting function
[.factor, not which. There are a couple of workarounds:
In that case, your intuition needs readjustment
There are other systems which (de facto) drop unused levels by default,
and it is a real pain to work
Suppose I write:
f1 - function(x) x + 1
f2 - function(x) 2 * f1(x)
f2(10)
# 22
f1 - function(x) x - 1
f2(10)
# 18
This is quite obvious. But is there any way to define f2
in such a way that we freeze the definition of f1?
f1 - function(x) x+1
f1frozen - f1
f2 - function(x)
Is there a way to modify the choice of notch size [1] in R's boxplot
routine from outlining a 5% significance region, to say 1% or lower?
Yes, but it's not as simple as specifying the significance level. You'll
have to update the function boxplot.stats, specifically the line
conf - if
I have a table like below outside R environment
Varible_Name
Labels
Bad_Percent
Good_Percent
Var1_Postal_Code_Availibility
1
0,149367931
0,850632069
0
0,19709687
0,80290313
Variable_Name column contains a single entry, the variable name, this
is
the title of
What has become more and more obvious to me after I started using R
about two years ago is that I have collected a large number of data
files, scripts, and workspaces (.Rdata files) in several catalogs on my
computer. It is also obvious that my memory is not up to the task of
keeping
x1-paste(A, 1:6, sep = )
x2- round(rgamma(6,2,1))
x3-paste(B, 1:6, sep = )
x4- round(rgamma(6,2,1))
data1 - data.frame(x1,x2,x3,x4)
I would like to get
data2 - c(A1=4, A2=1, A3=0,...)
Is there any standard for such a case?
I presume that 4, 2, 0 are the first few values of x2. In which
I am a new R user, and not very good at statistics and maths
I find it difficult to find the minimum of this item:
((p*(b-1)-1)*(p+1)^(b-1)+1)/p^2
It seems that the method optim can find the minimum. I tried several
times , but R constanly tells that failure to find b or
I've been trying to find a way to improve (if
possible) the efficiency of the code, especially when the number of
components to calculate is higher than 100.
pca.nipals - function(X, ncomp, iter = 50, toler =
sqrt(.Machine$double.eps))
# X...data matrix, ncomp...number of components,
#
datg=t(sapply(split(datgic, datgic$NPERMNO, drop=TRUE),
function(x){return(
x[nrow(x),] )}))
I get something like this...
GVKEY NPERMNO GIC year
10001 12994 10001 55102010 2007
10002 19049 10002 40101015 2007
10009 16739 10009 40101010 1999
Has this been made
If I have this daily rainfall data, how do call a particular day?
Year,Month,Day,Amount
1900,12,22,1.3
1900,12,23,0
1900,12,24,0
1900,12,25,0
1900,12,26,0
1900,12,27,0
1900,12,28,0
1900,12,29,4.8
1900,12,30,0.3
1900,12,31,0.5
1901,1,1,0
1901,1,2,3
1901,1,3,0
1901,1,4,0.5
Hi, I have a problem regarding matrix handeling. I am working with
a serie of matrixes containing several columns. Now I would like to
delete those rows of the matrixes,that in one of the columns contain
values less than 50 or greater than 1000.
Try this:
m - matrix(runif(150, 0, 1050),
I am a new user and I have been struggling for hours. So finally I
decide to ask you:
If I have a matrix P, and P.2 = P%*%P, and P.3=P.2%*%P
is there a function to calculate the power of a matrix?? if not how can
i do:
for (i in 1:10) {P.i=P^i}
after this I need to sum them up and my
I'm trying to set up a lattice plot with two y-axes for each panel. (Yes,
I know that multiple y-axes are generally a bad idea; the graph is for
someone else and they want it that way.) I've used a custom
yscale.component in xyplot to achieve this:
myyscale.component - function(...)
{
ans
T1 - read.delim(file=S://SEDIM//Yvonne//2_5//T1.txt,col.names=
c(Dye/Sample_Peak, Sample_File_Name, Size, Height,
Area_in_Point, Area_in_BP, Data_Point, Begin_Point,
Begin_BP, End_Point, End_BP, Width_in_Point, Width_in_BP,
User_Comments, User_Edit))
T1 - subset(T1, Size 1000 Size 50)
It's fairly straightforward to plot cumulative histograms using the
hist()
function. You do something like:
h - hist(rnorm(100), plot=FALSE)
h$counts- cumsum(h$counts)
plot(h)
However, I have failed to find any example where this is done using the
lattice histogram() function. I
I have tried without success to find a way including the square root
symbol
in lattice strips as part of my conditioning labels. I have tried
supplementing by creating a list of vectors using the var.name function
coupled with the expression function used in xlab/ylab.
S=c(World_is_beautiful, one_two_three_four,My_book)
I need to extract the last but one element of the strings. So, my
output should look like:
Ans=c(is,three,My)
gsub() can do this...but wondering how do I give the regular
expression
sapply(strsplit(S, _), function(x)
Bert Gunter wrote:
What is your recommended way of dealing with a left-censored response
(non-detects) in (linear Gaussian) mixed effects models?
Specifics: Response is a numeric positive measurement (of volume,
actually);
but when it falls below some unknown and slightly random value
In a lattice plot like this:
win.graph()
xyplot(tmx~frequ|as.factor(as.numeric(spf)),groups=as.factor(blm),
data=tmx,type=l,pch=16,xlab=frequency (N),ylab=Area held (ha),
auto.key=list(blm,points=F,lines=T,title=Blm factor,cex.title=0.7,
cex=0.7,corner=c(1,1)),main=Mangroves
I have a vector:
q1-c(4660,5621,5629,8030,8080,8180,8501,8190,8370,8200)
The following command gives me the mean of its elements:
mean(q1)
[1] 7346.1
What can I do to do the same for the variable 'height', but only for the
cases/rows which have one of the elements of q1 as
How to swap and rearrange the row so that I will have
Jan-Dec in order?
est31
p0 est.alpha est.beta est.rate
Jan 0.8802867 0.7321440 7.241757 0.1380880
Mar 0.8598566 0.7096567 7.376367 0.1355681
May 0.6204301 0.8657272 6.036106 0.1656697
July 0.5032258 0.9928488 4.027408
I am looking for an R implementation of the four parameter kappa
distribution (cdf, pdf, quantile, and ransom numbers), or at a minimum,
the generalized logistic distribution.
I searched for kappa distribution on Rseek (http://www.rseek.org) and
the functions you want appear to be in the
I'm attempting to plot a cubic relationship between two variables
controlling for the effects of a third variable. In this short
example, I'm trying to use AGE to predict CORTEX while controlling for
the effects of TIV (total intracranial volume):
cortex =
I am fairly new to R and this list (this is my first post), so I am
wondering whether
there is a possibility to view posts on this list conveniently on a
website besides
reading my email.
You can see them on Nabble, but there is a delay of a couple of hours.
I need to apply a function on each column of each matrix contained in
a list. Consider the following code,
x - 1:3
my.data - list(matrix(c(1,2,3,4,5,6),ncol=2),
matrix(c(4,5,6,7,8,9),ncol=2))
par(mfrow=c(2,2))
results - sapply(1:length(my.data),
function(ii)
I am looking to create a pie chart from a given column in a .csv file.
My class variables are as follows:
entry_type, uniquekey, types, title,url, abstract, journal,
author, month,
year, howpublished
So say I want to export a pie chart that groups together all entries
under
Ive found out a way around my problem. I was trying to plaot a histogram
of
strings, but I had to change it into integers. I ran an sql query on the
original DB that I got the CSV file from and used COUNT to get the
number of
each unique item in a given column. I then used these numbers to
I?ve written a script to run several multivariate statistical analysis
automatically.
As one result a biplot and screeplot is produced.
Now I?d like to display the name of the inputdatset as part of the title
of
these graphics and I do not want to enter it each time I run the script.
How
1. How to plot several lines in a figure? Suppose I have several sets of
points (xi,yi), where xi and yi are equal-length vector. plot(x1,y1)
will
give a line connecting these points. Another plot(x2,y2) will erase what
plot before and plot the new line. Can I have these lines all drawn in
There are six assignments in total. It won't take you long if you were
familiar with R. For those who are interested, please send me an email
with your profile (your experience with R, how long and how often have
you been using it.) I will be paying through paypal. Thanks!
Now see, you made
fp is a data frame like this
,[ fp ]
|Frequenz AmpNorm
| 1 3322 0.0379490639
| 2 3061 0.0476033058
| 3 2833 0.0592954124
| 4 2242 0.1275510204
`
i want to find the Frequenz where AmpNorm is max.
Use which.max.
fp -
I have a graph with groups of variables. I have include the group
names as variables so that I can have them positioned correctly.
Unfortunately this means that the group names have to follow all of
the same rules as the variables within the groups. I would rather
have those group names
Can anyone tell me what is skip=2, skip =7
From ?read.csv:
skip: integer: the number of lines of the data file to skip before
beginning to read data.
and %in% mean here?
%in% matches values; see ?'%in%', and example('%in%')
Regards,
Richie.
Mathematical Sciences Unit
HSL
It seems that the structure of your data is that you have two groups
(Real Bad Stuff and Other Crazy Things) which are then subdivided into
further categories. I'd be tempted to set your data up like this:
dfr - data.frame(
score=c(23, 14, 17, 8, 43, 13),
group=rep(c(Real Bad Stuff,
I have some trouble with the number of decimals in R (currently R
2.9.0). For instance:
options()$digits
[1] 3
let me hope that I will get three digits where useful when a number is
printed. BUT:
44.25+31.1+50
[1] 125
No way to get the right result 125.35
Can anybody tell
if i have the following function,
f - function(x) x^3-2*x^2+3*x-5
i need a simple function for the derivative of this with respect to
'x', so that i can then sub in values to the the derivative
function, and use Newtons method of finding a root for this.
You could take a look at
I have a large data frame and I want to look at the distribution of
each variable very quickly by plotting an individual histogram for
each variable.
I'd like to do so using lattice.
Here is a small example using the iris data set:
1 - 100 of 226 matches
Mail list logo