similar to: zeros in double matrix rather than character matrix

Displaying 20 results from an estimated 100 matches similar to: "zeros in double matrix rather than character matrix"

2012 Nov 28
1
how to keep all zeros in 1st row (not NA)
Hi, let me correct my previous post ("zeros in double matrix rather than character matrix"). I have included entries from the .csv file that has 4 columns of 1000 columns and 101 rows. The first column with the "Time (day)" will not be removed, but the row headers are the numbers 1 to 1000 and they will remain in the matrix. In the previous post I mentioned that R makes the
2012 Dec 31
4
error when using subset (0 observations)
Hi, how are you? My name is Irucka Embry and I would like assistance on properly subsetting some data obtained from a .csv file. > file <-"info_n.csv" > INFO<- getMetaDataFromFile(file) INFO is 92 observations of 14 variables > INFO<- subset(INFO,site.no==02169570) INFO is 0 observations of 14 variables When the site.no is used I should have 1 observation of 14
2012 Dec 20
4
comparison of large data set
Hi, how are you? I have the following truncated R code: fileobs <- "MaxFloodDepth_Observed.txt" file1 <- "MaxFloodDepth_1.txt" file2 <- "MaxFloodDepth_2.txt" ... file54 <- "MaxFloodDepth_54.txt" observeddepth = as.matrix(read.ascii.grid(fileobs)$data) observeddepth[observeddepth!=0]<-1 modeldepth1 =
2013 Mar 07
5
multiple plots and looping assistance requested (revised codes)
Hi Irucka, I tried it and was able to plot it without any errors.? Here, your code indicates you need two lines. temper[[i]][1] ?temper[[1]][1] # which is the column 1. ? Month 1???? 1 2???? 2 3???? 3 ?temper[[1]][2] #? Data1 #1?? 1.5 #2? 12.3 #3? 11.4 Suppose I use names(temper) instead of seq_along(temper) pdf("irucka.pdf") ?lapply(names(temper),function(i)
2013 Jan 09
4
select partial name and full name columns
Hi, I have the following function: getDataFromDVFileCustom <- function (file, hasHeader = TRUE, separator = "\t") { DVdatatmp <- as.matrix(read.table(file, sep = "\t", fill = TRUE, comment.char = "#", as.is = TRUE, stringsAsFactors = FALSE, na.strings = "NA")) DVdatatmper <- as.matrix(DVdatatmp[ , c("datetime",
2013 Mar 29
1
multiple plots and looping assistance requested (single plot)
HI Irucka, Please check this: temp<- structure(list(`:Bostoncitydata` = structure(list(Month = c(1L, 2L, 3L, NA), Data1 = c(1.5, 12.3, 11.4, NA), Data2 = c(9.1342, 12.31, 3.5, NA)), .Names = c("Month", "Data1", "Data2"), class = "data.frame", row.names = c(NA, -4L)), `:Chicagocitydata` = structure(list(Month = c(1L, 2L, 3L, 4L, 5L, NA), Data1 = c(1.52,
2012 Dec 19
2
probability of binary data
Hi, how are you? I am trying to replicate the binary data f(2) function in the attached document by starting with the simple example found below: observed <- matrix(c(0, 1, 0, 0, 1, 1, 1, 0, 0),3,3,byrow=TRUE) data <- matrix(c(1, 1, 0, 0, 1, 0, 0, 0, 1),3,3,byrow=TRUE) f2 = sum(probability of the matrix element where the matrix element is present in both the observed and the
2015 Aug 18
2
Server certificate verification failed
Hi all, I have the following in my apt sources.list file: deb https:// /bin/linux/ubuntu trusty/ I issued the following command to obtain the public key: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 I am receiving the following error message though after updating the Synaptic package manager: Failed to fetch
2012 Nov 19
5
help on matrix column removal based on another matrix results
Hi everyone, now I am trying to finish writing the code (I had asked for assistance on subtracting arrays) This is what I what I am running in R: > source("/home/ie/Documents/TTU/GA_Research/GLUE/R-Project/R_GLUE_Example/NSEr.R") NSEr <- function (obs, sim) { {jjh <- (as.vector(obs) - sim)^2 Xjjhs <- apply(Xjjh, 2, sum) Yii <- (obs - mean(obs))^2 Yiis <- apply(Yii, 2,
2013 Jan 27
1
lapply and SpatialGridDataFrame error
Hi all, I have a set of 54 files that I need to convert from ASCII grid format to .shp files to .bnd files for BayesX. I have the following R code to operate on those files: library(maptools) library(Grid2Polygons) library(BayesX) library(BayesXsrc) library(R2BayesX) readfunct <- function(x) { u <- readAsciiGrid(x) } modfilesmore <- paste0("MaxFloodDepth_", 1:54,
2013 Jan 15
2
error in for loop in function (object not found)
Hi all, I have attached the function file (revisedfunction) and the list of station IDs (StationIDs) in .pdf format. I have written a function to perform various operations on the station IDs in two groups. The first 6 station IDs require one less step than the remaining 68 station IDs. The file referenced at the beginning of the function is the file containing the StationIDs. > file =
2013 Mar 05
2
multiple plots and looping assistance requested
Hi all, I have a couple of questions. 1) Is there a more effective way to remove the following pattern (patternrm) from the station_id_Timeseries (see below) patternrm <- c(_2000_4_OND, _2001_1_JFM, _2001_2_AMJ, _2001_3_JAS, _2001_4_OND, _2002_1_JFM, _2002_2_AMJ, _2002_3_JAS, _2002_4_OND, _2003_1_JFM, _2003_2_AMJ, _2003_3_JAS, _2003_4_OND, _2004_1_JFM, _2004_2_AMJ, _2004_3_JAS, _2000_4_OND) #
2012 Nov 19
6
loop to subtract arrays / error
Hi everyone, I am having trouble with creating a loop to subtract arrays. In R, this is what I have done: > Vobsr <- read.csv("Observed_Flow.csv", header = TRUE, sep =",") # see data > below > Vsimr <- read.csv("1000Samples_Vsim.csv", header = TRUE, sep =",") # see > data below > Vobsr <- as.matrix(Vobsr[,-1]) # remove column 1 from
2013 Feb 13
0
seasonal sum and mean and combine multiple, different data frames in .csv
Hi Irucka, No problem. I guess this could be done using: Sample data: Dailydo<- structure(list(Date = structure(c(11231, 11232, 11233, 11234, 11235, 11236, 11207, 11208, 11209, 11179, 11180, 11181, 11151, 11152, 11123, 11093, 11064, 11065, 11035, 11036, 11008, 11009, 10979, 10980, 11347, 11348, 11380, 11381, 11410, 11406, 11438, 11439, 11470, 11502, 11528, 11560, 11561, 11593, 11594,
2013 Feb 20
0
subsetting with greater than and less than indexing
Hi Arun, thank-you for your assistance. I'm sorry that I did not provide a reproducible example. I will provide a reproducible example the next time. Using the next to last line of your code I was able to get what I needed without using the for loop. Thanks again. Irucka <-----Original Message-----> >From: arun kirshna [via R] [ml-node+s789695n4659154h50@n4.nabble.com]
2013 Mar 21
0
how do I read certain files from a directory based on number of columns?
Hi Arun, thank you. I will look through that later on today when I get a chance. I have to complete another part of this project now. Irucka <-----Original Message-----> >From: arun kirshna [via R] [ml-node+s789695n4661145h71@n4.nabble.com] >Sent: 3/12/2013 10:35:39 PM >To: iruckaE@mail2world.com >Subject: Re: how do I read certain files from a directory based on number of
2013 May 01
0
log returns, error
Hi, I could not open the file. Can you load the data into R and then use the dput function? The first link deals with dput. The latter 2 links are for dealing with NAs in data. http://www.inside-r.org/r-doc/base/dput dput {base} http://r.789695.n4.nabble.com/subset-without-removing-NAs-td3482011.html R help - subset without removing NAs
2013 Mar 21
0
"[[i]]$" <- "" indexing and lapply
Hi Arun, thank-you very much! The 2nd option worked perfectly. That was what I wanted. Now, I have another question. I am using the R packages dataRetrieval and EGRET from https://github.com/USGS-CIDA/WRTDS. I have 2 objects Daily and Sample that have the naming convention (Names = "21NC02WQ.C1000000" or whatevver the list of site names happens to be) that I need to have after running
2012 Dec 21
0
variable names in numeric list and Bayesian inference
Hi everyone, I have received assistance from my previous post (comparison of large data set), but I still need some assistance. This is the revised code (along with some new code that I am requesting assistance with correcting): files <- paste0("MaxFloodDepth_", 1:54, ".txt") fileobs <- "MaxFloodDepth_Observed.txt" readfun <- function(x) { u <-
2012 Nov 18
0
subtract multiple columns from single column for Nash Sutcliffe efficiency
Hi everyone, I am having trouble using my own data in the Nash-Sutcliffe efficiency (NSE) function. In R, this is what I have done: Vobsr <- read.csv("Observed_Flow.csv", header = TRUE, sep =",") # see data below Vsimr <- read.csv("1000Samples_Vsim.csv", header = TRUE, sep =",") # see data below Vobsr <- as.matrix(Vobsr[,-1]) # remove column 1