similar to: Reformat meteorological data

Displaying 20 results from an estimated 1100 matches similar to: "Reformat meteorological data"

2008 Jun 24
1
Error message: Bad value
Dear R help, In the middle of my session, I started receiving the error message "bad value" regardless of what I entered. I had to close R and restart it. When the error occurred, I was creating basic lattice plots, with no other add-on packages running. I am running R through John Fox's XEmacs interface, XEmacs version 21.4.20 on a Windows XP Pro machine with 2 GB of RAM. I have
2010 Aug 12
4
conditional selection of dataframe rows
Dear helpeRs, I have a dataframe (14947 x 27) containing measurements collected every 5 seconds at several different sampling locations. If one measurement at a given location is less than zero on a given day, I would like to delete all measurements from that location on that day. Here is a toy example: toy <- data.frame(CH = rep(3:5,3), DAY = c(rep(4,5), rep(5,4)), SLOPE =
2010 Sep 28
2
Reshape
Hello, helpeRs, I've been trying, unsuccessfully, to change a dataframe from long to wide format using reshape (the original). I would appreciate it if someone could demonstrate the correct syntax. The script below will create a toy example. The new wide data should have a column name for each unique entry in the "fame" column. Under each column should be either the
2007 Mar 23
4
Conversion from string to date type
Hi, I'm on my very first steps to R and so I hope that I do not ask a really stupid questions but I did not found it via R-Search, in the FAQ or Google (BTW, the name "R" is not a really good seekiong criterion ;-) ). I have a data file containing a table that containes dates and values like date\t value1\t value2, ... 01.03.2007\t 17\t 42\t ... 02.03.2007\t 2\t 3\t ...
2012 Dec 15
2
troubles reading a text file
Dear R experts, For quite some time I have been trying to solve a mistery of reading a seemingly trouble-free text file. The data is temperature reconstruction arranged as a huge grid, preceded by seven "header lines" (which you see better if file is opened in Firefox or Chrome). This is the data (gridded temperature reconstruction)
2005 Mar 11
2
Calculating lengths of runs of 0 or 1 sequences in meteorological data
Dear List Members, I need some help about programming in S language. My problem is as follows: I have meteorological data (about rainfall measurement each day from 1989-2002), say like http://www.angelfire.com/ab5/get5/data.rainfall.txt or http://www.angelfire.com/ab5/get5/R.rainfall.txt in a sequence of 0(denoting dry day)'s and 1(denoting wet day)'s. I want to construct a frequency
2017 Jun 03
2
New var
Thank you all for the useful suggestion. I did some of my homework. library(data.table) DFM <- read.table(header=TRUE, text='obs start end 1 2/1/2015 1/1/2017 2 4/11/2010 1/1/2011 3 1/4/2006 5/3/2007 4 10/1/2007 1/1/2008 5 6/1/2011 1/1/2012 6 10/5/2004 12/1/2004',stringsAsFactors = FALSE) DFM DFM$D =as.numeric(difftime(as.Date(DFM$end,format="%m/%d/%Y"),
2017 Jun 04
2
New var
Thank you Jeff and All, Within a given time period (say 700 days, from the start day), I am expecting measurements taken at each time interval;. In this case "0" means measurement taken, "1" not taken (stopped or opted out and " -1" don't consider that time period for that individual. This will be compared with the actual measurements taken (Observed-
2017 Jun 04
0
New var
# read.table is NOT part of the data.table package #library(data.table) DFM <- read.table( text= 'obs start end 1 2/1/2015 1/1/2017 2 4/11/2010 1/1/2011 3 1/4/2006 5/3/2007 4 10/1/2007 1/1/2008 5 6/1/2011 1/1/2012 6 10/5/2004 12/1/2004 ',header = TRUE, stringsAsFactors = FALSE) # cleaner way to compute D DFM$start <- as.Date( DFM$start, format="%m/%d/%Y" ) DFM$end
2017 Jun 04
0
New var
Since the number of choices is small (6), how about this? Starting with Jeff's initial DFM: DFM <- structure(list(obs = 1:6, start = structure(c(16467, 14710, 13152, 13787, 15126, 12696), class = "Date"), end = structure(c(17167, 14975, 13636, 13879, 15340, 12753), class = "Date"), D = c(700, 265, 484, 92, 214, 57), bin = structure(c(6L, 3L, 5L, 1L, 3L, 1L), .Label
2017 Jan 17
2
bug in rbind?
I suspect there may be a bug in base::rbind.data.frame Below there is minimal example of the problem: m <- matrix (1:12, 3) dfm <- data.frame (c = 1 : 3, m = I (m)) str (dfm) m.names <- m rownames (m.names) <- letters [1:3] dfm.names <- data.frame (c = 1 : 3, m = I (m.names)) str (dfm.names) rbind (m, m.names) rbind (m.names, m) rbind (dfm, dfm.names) #not working rbind
2011 Aug 27
2
Am having trouble calling a function
In my main R program, I have source("retaanalysis/Functions/doAirport.R") .... stuff to read data and calculate ads sapply(ads, function(x) {doAirport(x, base)} ) And doAirport has # analyze the flights for a given airport doAirport = function(df, base) { # Get rid of unused runway factor levels (from other airports) df$lrw <- drop.levels(df$lrw) # In gdata package #
2017 Jul 16
2
About doing figures
Hi R users, I still have the problem about plotting. I wanted to put the datasets on one figure, x-axis represents values B, y-axis represents values C, while different colors label column A. Each record uses a circle on the figure, while hollow circles represent DF=1 and solid circles represent DF=2. I put my code below, but the A labels do not correspond to the true record, so I don't know
2013 May 17
3
Command line not responding
Running 9.0-Stable on an i386. Whenever I type a command at the prompt I get the output /usr/local/lib/libintl.so.9: Undefined symbol "_ThreadRuneLocale" and nothing else - the command will not run. Just the above output. Commands like "ls" and "exit" work, but not much else. This happends whether I am logged in a user or as root. Cannot even halt the system from
2017 Jul 16
2
About doing figures
Hi Jim, For true color, I meant that the points in the figure do not correspond to the values from the dataframe. Also, why to use rainbow(9) here? And the legend is straight in the middle, is it possible to reformat it to the very bottom? Thanks again. On Sun, Jul 16, 2017 at 2:50 AM, Jim Lemon <drjimlemon at gmail.com> wrote: > Hi lily, > As I have no idea of what the "true
2017 Jul 16
0
About doing figures
Hi lily, As I have no idea of what the "true record" is, I can only guess. Maybe this will help: # get some fairly distinct colors rainbow_colors<-rainbow(9) # this should sort the numbers in dfm$A dfm$Acolor<-factor(dfm$A) plot(dfm$B,dfm$C,pch=ifelse(dfm$DF==1,1,19), col=rainbow_colors[as.numeric(dfm$Acolor)]) legend("bottom",legend=sort(unique(dfm$A)),
2017 Jul 16
0
About doing figures
For more than 10 records, how to reformat the colors? Also, how to show the first legend only, but at the bottom, while the second legend in your code is not necessary? In all, the same A values have the same color, but different symbols in DF==1 and DF==2. Thanks for your help. On Sun, Jul 16, 2017 at 9:28 AM, lily li <chocold12 at gmail.com> wrote: > Hi Jim, > > For true color,
2011 Aug 11
2
Extract values from a data frame
Hi everyone, I have a data frame that looks *sort of* like this: name <- letters[1:5] signal.1 <- c("12", "bad signal", "noise", "10", "X") length.signal.1 <- 5:9 intensity.signal.1 <- 3:7 signal.2 <- c("13", "noise", "19.2", "X", "V") length.signal.2 <- 2:6 intensity.signal.2
2006 Sep 20
4
Calculating mean together with split
Hi I have a table called npl containing results of simulations. It contains about 19000 entries and the structure looks like this: NoPlants sim run year DensPlants 1 6 lng_cs99_renosterbos 1 4 0.00192 . . . it has 43 different entries for sim and year goes from 1 to 100, and run from 1 to 5. I would like to calculate the mean of DensPlants for each
2014 Mar 06
1
Create dataframe in C from table and return to R
Hi , I am trying to create a dataframe in C and sebd it back to R. Can anyone point me to the part of the source code where it is doing , let me explain the problem I am having . -------------------------------------------------------------------- My simple implementation is like this SEXP formDF() { SEXP dfm ,df , dfint , dfStr,lsnm; char *ab[3] =