similar to: merging and obtaining the nearest value

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
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"))
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
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 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,
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
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
2008 Feb 08
1
Can I index a dataframe with a reference from/to a second dataframe?
Hello, I am unable to figure out how to code a new column in a data frame based on an existing column that matches a column in a reference data frame, in a relational-db fashion. I would like this to maintain a minimum set of reference tables that may be reused over several similar datasets. Specifically, I have two data frames as listed below, 'Bos' and 'tree.' For each case in
2011 Jun 13
1
Heatmap in R and/or ggplot2
I have a dataframe df with columns x, y, and height. I want to create a heatmap-like plot that creates a grid of x by y, and then color codes the grid depending on the value of height. Is there a ggplot2 object to do this? I'm able to easily do this in Excel with pivot tables and conditional formatting so I'm including an image that is close to the output I want. I want to be able to
2012 May 04
4
Interweaving of two datasets
I have two datasets, the first has this shape (each word is a column) Name address phone .. .. The second one has the following shape Name request I need a contingency table with for example phone and request. The people registered in these datasets are present in both datasets, BUT in the first every record is a person, so every person is counted once and is 1 row, in the second every row is