Displaying 20 results from an estimated 20000 matches similar to: "merging and obtaining the nearest value"
2012 Oct 05
5
Missing data (Na) and chi-square tests
Dear everyone
I am a bit of a computer imbecile and are having problems with R.
I am using R in my research project to do chi-square tests on data imported
from excel .
However I have som missing data in one of my variables (columns) and I need
R to "exclude" these and make chi-square test on the data that I have.
I use a formula to make 2x2 tables which is:
data <-
2012 May 09
12
Matrix heatmap
I would like to organize my data as follows:
I have a table that contains various data, and the numbers represent a level
of similarity between these data,
eg RF00013 has 100% similarity with the data RF00014.
I would leave my table as a heatmap where darker colors represent higher
similarity, and the lighter colors represent less level of similarity.
I'm using version 2.11 of R.
these
2024 Oct 18
1
DPLYR Multiple Mutate Statements On Same DataFrame
?s 22:50 de 17/10/2024, Sparks, John escreveu:
> Hi R Helpers,
>
> I have been looking for an example of how to execute different dplyr mutate statements on the same dataframe in a single step. I show how to do what I want to do by going from df0 to df1 to df2 to df3 by applying a mutate statement to each dataframe in sequence, but I would like to know if there is a way to execute this
2012 Nov 03
2
Replacing NAs in long format
Hi,
I have the following data:
> data[1:20,c(1,2,20)]
idr schyear year
1 8 0
1 9 1
1 10 NA
2 4 NA
2 5 -1
2 6 0
2 7 1
2 8 2
2 9 3
2 10 4
2 11 NA
2 12 6
3 4 NA
3 5 -2
3 6 -1
3 7 0
3 8 1
3 9 2
3 10 3
3 11 NA
What I want to do is
2012 Nov 14
5
aggregate combination data
Dear R users,
I want to aggregate all *d *data from all combination of n *plots* taken
by k.
Thank very much!
My data is like that:
plot d 1 14 1 13 1 12 1 14 1 18 1 20 1 21 1
43 1 108 1 43 2 41 2 61 2 83 2 61 2 84 2 45 2 21 2 12 2 11 ... 100
10
100 12
--
---
Catalin-Constantin ROIBU
Forestry engineer, PhD
Forestry Faculty of Suceava
2012 Jul 19
2
Subsetting problem data, 2
Hello,
I didn't give enough information when I sent an query before, so I'm trying
again with a more detailed explanation:
In this data set, each patient has a different number of measured variables
(they represent tumors, so some people had 2 tumors, some had 5, etc). The
problem I have is that often in later cycles for a patient, tumors that
were originally measured are now missing (or
2012 Sep 02
3
Loading Chess Data
All,
What would be the most efficient way to load the data at the following
address into a dataframe?
http://ratings.fide.com/top.phtml?list=men
Thanks,
David
--
View this message in context: http://r.789695.n4.nabble.com/Loading-Chess-Data-tp4642006.html
Sent from the R help mailing list archive at Nabble.com.
2013 Feb 08
2
Can not melt data.frame
I realize it's -12C and we're having the next best thing to a blizzard but why can I not melt this data frame.
I am missing something terribly obvious but I just don't understand what the error message is saying.
John Kane
Kingston ON Canada
Code and aata below
#================================================#
library(reshape2)
melt(mydata, id.vars = c("date"))
2024 Oct 17
2
DPLYR Multiple Mutate Statements On Same DataFrame
Hi R Helpers,
I have been looking for an example of how to execute different dplyr mutate statements on the same dataframe in a single step. I show how to do what I want to do by going from df0 to df1 to df2 to df3 by applying a mutate statement to each dataframe in sequence, but I would like to know if there is a way to execute this in a single step; so simply go from df0 to df1 while executing
2017 Jul 22
1
3-day moving average for block maxima
Dear r-users,
I would like to construct 3-day moving average for block maxima series.
I tried this:
bmthree <- lapply(split(dt, dt$Year), function(x) max(sapply(1:(nrow(x)-2),
function(i) with(x, mean(Amount[i:(i+2)],na.rm=TRUE)))))
bmthree
and got the following output.
$`1971`
[1] 70.81667
$`1972`
[1] 68.94553
$`1973`
[1] 102.7236
$`1974`
[1] 73.6625
$`1975`
[1]
2012 May 04
7
Breaking up a Row in R (transpose)
I have the following:
Time A1 A1 B1 B1 C1 C2
x y x y x y
0 5 6 6 7 7 9
1 3 4 4 3 9 9
2 5 2 6 4 7 4
I want to change it to the following:
0 1 2
x y x y x y
A1 5 6 3 4 5 2
B1
2013 Apr 04
3
summing vectors
Hi All,
Year Area Q Bin FD
I have a large dataset I need to re-structure. It looks something
like this: 2000 1 1 5 0 2000 1 1 10 1 2000 1 1 15 23 2000 1 1 20 12 2000
1 1 25 1 2000 2 1 5 1 2000 2 1 10 3 2000 2 1 15 15 2000 2 1 20 11 2000
2 1 25 3 2000 1 2 5 0 2000 1 2 10 1 2000 1 2 15 23 2000 1 2 20 12 2000
1 2 25 1 2000 2 2 5 1 2000 2 2 10 3 2000 2 2 15 15 2000 2 2 20 11
2009 May 15
1
data summary and some automated t.tests.
I would like to preform a t.test to each of the measured variables
(sand.silt etc.) with a mean and sd for each of the treatments (up or
down), and out put this as a table.... I am having a hard time
starting- maybe it is to close to lunch. Any suggestions would be
greatly appreciated.
Stephen Sefick
x <- (structure(list(sample. = structure(c(1L, 7L, 8L, 9L, 10L, 11L,
12L, 13L, 14L, 2L, 3L,
2012 Sep 04
3
unexpected (?) behavior of sort=TRUE in merge function
All,
I realize from the archive that the sort argument in merge has been subject to discussion before, though I couldn't find an explanation for this behavior. I tried to simplify this to (kind of) minimal code from a real example to the following (and I have no doubts that there are smart people around achieving the same with smarter code :-)). I'm running R 2.15.1 64bit under MS Windows
2009 May 28
2
ggplot2 legend
Hi:
I need some help with the legend. I got 14 samples(Muestreo) and I
am trying to plot a smooth line for each sample. I am able to accomplish that but the problem is that the legend only displays every other sample. How can I force the legend to show all of my Muestreos? Thanks in advance.
fish_ByMuestreo <- structure(list(data = structure(list(SampleDate = structure(c(3L,
3L, 3L, 3L,
2009 Oct 09
1
Placing text in a ggplot
I am attempting to graph 12 months of temperatures, delineate the months with a vline and place the names of the months at the top of the graph.
So far I have gotten everything to work except the names, despite getting a similar graph to work yesterday the day before yesterday with Baptise A's help. Can anyone suggest what I am doing wrong. Data set is below code.
Thanks.
Code
2012 Nov 14
2
indexing for Wilcoxon test (take 2)
Hi everyone,
I've been asked to run a number of Wilcoxon tests on some behavioral data
(below is a sample). They want me to compare each trial to the first
trial, considered the control trial. I know I can use brackets to index and
select, for example, trial 1 vs. trial 4 (not exactly sure how to set that
up either) but it would save me a ton of time if there was a way to do all
the
2024 Jul 13
1
Obtaining predicted probabilities for Logistic regression
?s 12:13 de 13/07/2024, Christofer Bogaso escreveu:
> Hi,
>
> I ran below code
>
> Dat = read.csv('https://raw.githubusercontent.com/sam16tyagi/Machine-Learning-techniques-in-python/master/logistic%20regression%20dataset-Social_Network_Ads.csv')
> head(Dat)
> Model = glm(Purchased ~ Gender, data = Dat, family = binomial())
> head(predict(Model,
2010 Feb 28
1
ggplot 'annotate problem' again.
I had a problem annotating a graph last year ( see http://n4.nabble.com/Putting-names-on-a-ggplot-td907158.html#a907158 for the discussion)
Stefan (smu) provided a solution using annotate(). However I apparently did not update the graph file and,now, when I go back to the thread and try to use Stefan's solution it does not seem to work although I am sure that it did then.
The problem
2008 Jul 06
2
lattice question
I'm creating a lattice barchart based off a pretty complicated data
structure. The barchart comes out quite nice ( thanks
to lattice ) but the problem is that the horizontal axis comes out all
scrunched because the barchart doesn't know that the intervals
of Var.1 are really "associated" with the conditioning variable Var.2.
Therefore, all the intervals of Var.1 are put on