Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [r]

R is a programming language and software environment, mostly used for statistical computing and graphics.

1
vote
0answers
13 views

Populating data frame in R and writing output in a file?

I am trying to make a data frame and write it to a file called summarized.txt that would look like this: A.xls.GY p1 B.xls.GY p2 ... Where A.xls.GY, B.xls.GY...(20 total) are file names and they ...
1
vote
0answers
36 views

Broken pipe error [on hold]

The following are my 2 Rscripts written as mapreduce code- 1) mapper.R #! usr/bin/env/ Rscript # mapper.R - Wordcount Program in R # script for Mapper (R-Hadoop Integration) trimWhiteSpace<- ...
0
votes
3answers
40 views

How to calculate mean of each 3 columns in data frame?

I have a data frame like this: > head(dat_sg2) DwoC_2318_norm.1 DwoC_2318_norm.2 DwoC_2318_norm.3 DwoC_3395_norm.1 DwoC_3395_norm.2 DwoC_3395_norm.3 DwoC_6154_norm.1 ...
-1
votes
1answer
26 views

Sort based on second column and list from highest to lowest

TGAAACATGCCTTTCACCTCCTGCCATGATTGTGAGGCCT 2 GTGTTGCCCAGGTTGGTTTCAAACTCAGCTCAAGTGATCT 1 GAGACTCCTTCAGGAGACTGGTCCCCTGTCCTCGCCTCTC 3 CATGTTCTCCTGGAAGCCATGTGAGGAAGGCACATCATGG 8 ...
1
vote
1answer
19 views

How to set R to use all of the width of my terminal?

I am running interactive R in terminal, however it doesn't use all of the width of the terminal. It only use 72 characters out of 226. It is very uncomfortable to read any data with a lot of columns ...
1
vote
1answer
108 views

Give a user permissions to start, stop or restart shiny-server

I need to give permission to a user to start, stop and restart Rstudio's shiny-server. Right now, I have been managing the service upon this user's request with sudo service restart shiny-server, but ...
0
votes
0answers
17 views

How to login and Download the file in the same session in R language?

I am trying to do login and download the file with using a package httr and jsonlite in R language. I write the following code : library(data.table) library(jsonlite) library(httr) library(properties)...
0
votes
0answers
77 views

When I try to configure RStudio for installation on Linux Mint I get a libcurl error

I'm trying to install the newest versions of R and RStudio on Linux Mint version Sylvia, and it seems I also have some Ubuntu repositories on version Xenial. I have tried using the package manager ...
0
votes
0answers
44 views

>100% CPU usage of a process in htop, then lots (>nthreads) of little processes using CPU% amounting to main process

I'm running tensorflow through R Studio. It's multithreaded in some way that I didn't program through one of R's forking packages like foreach, so I don't really understand how it works. The main ...
-2
votes
4answers
60 views

Filter specific numbers from multiple files

I have multiple files (apx. 150) that look like this: reconstructed_hap_4_Local_nt_haplo_freq_60.3 ...
1
vote
1answer
43 views

Merge two tables based on value in first column

I have 1 table like this (csv file): p1 p10 p16 p19 p25 p3 p5 p6 p8 p9 con1 567 0 3 0 18 17 8 4 6 7 con3 490 7 6 2 23 26 20 14 12 29 con4 737 1 4 1 ...
0
votes
4answers
45 views

Replacing with zero values below the treshold, but starting from specific cell

I have a matrix in which I want to replace all values with 0 if they are below 25. I want to keep first row and column. p1 p10 p16 p19 p25 p3 p5 p6 p8 p9 call1 567 0 3 0 ...
0
votes
1answer
555 views

Unmet dependencies: libjpeg8 (>= 8c) but it is not installable when installing R

I'm getting unmet dependencies when trying to install R on Debian 9 (stretch). Specifically, running: $ sudo apt-get install r-base-core results in Reading package lists... Done Building dependency ...
0
votes
3answers
218 views

Does Bash or AWK have IN operator like R programming Language?

In R, We have IN operator to check whether or not the element is present in the specific column. For example: If we have fruits and market dataframe with fruit_name and products as the column name ...
1
vote
0answers
20 views

Cropped plot labels in knitted PDF in Linux

Has anyone experienced having their plot labels cropped in knitted PDF's in Linux? This does not happen in my Windows machine. Here is a minimal r-markdown example to replicate this problem. --- ...
0
votes
1answer
526 views

Cannot download packages on R (neither RStudio nor Terminal)

I'm very new to linux, my only experience being using a computer that belonged to somebody else before, meaning that everything was already configured/downloaded and I had no problem doing my job on ...
1
vote
0answers
309 views

R: how to install RCurl on Debian Linux 9 (stretch)?

I have tried all kind of libcurl apt packages and so forth. I need RCurl for h2o in Debian Stretch. How can I install RCurl in Debian? ** R ** data ** inst ** preparing package for lazy loading ** ...
0
votes
2answers
182 views

Match the nearest timestamp in milliseconds

I have a large data.txt file as below; for every timestamp, I need to find the nearest time match 5 minutes later and the value on column 4. Now print both in two new columns. for example for "2018-...
5
votes
1answer
2k views

Lots of red in htop — does that mean my tasks are tripping over each other?

I've read that the color red indicates "kernel processes." Does that mean little daemons that are regulating which task gets to use the CPU? And by extension, transaction costs in an oversubscribed ...
0
votes
2answers
232 views

Split Large files based on line number, run it and then append the final output into one file

I am using an R package. The input files required to run in the the package are large(as big as 65 Gb of size) So I have decided to split the file in chunks based on line number and then merge the ...
1
vote
0answers
280 views

How to increase memory limit and number of cores that Rstudio uses on a cluster

I launched Rstudio using FastX on Rivanna cluster (CentOS Linux release 7.3.1611 (Core)): https://arcs.virginia.edu/rivanna The main goal for doing that was to significantly increase the speed of ...
-1
votes
4answers
53 views

Extract row with maximum value from multiply represented second variable

I have a problem that I cant seem to solve. I have a massive tab-delimited text file similar to: chr 10 20 20 a chr 30 40 10 b chr 30 40 15 b chr 30 40 11 b What I need is to: 1) extract all ...
0
votes
1answer
856 views

Install ncdf4 R package with shell script

I am trying to install the ncdf4 R package into a remote machine by using an R script ran by a shell script. I tried to install other packages and it works fine but with the ncdf4 package it doesn't. ...
1
vote
1answer
3k views

Running R script via shell script. syntax error near unexpected token `('

I am currently trying to run an R script via a shell script. Here the R script: test = rnorm(1:100, 1000) write.csv(test, 'test.csv') And here the bash script which calls the R one: #!/bin/bash -l ...
1
vote
2answers
127 views

syntax coloring R terminal

I use R in the terminal. I use an editor for writing the code but to test out parts of the script I use terminal as the scripts get written. Is there a way to get r session in the terminal to have R ...
0
votes
1answer
64 views

Keep values in a particular column based on priority and remove the other values for each row

On giving this command, I am getting like this awk '{print $7}' myfile.txt /myfolder/1001.AB.txt.gz,/myfolder/1001.CD.txt.gz /myfolder/1011.filtered.txt,/myfolder/1011.AB.txt.gz,myfolder/1011.CD.txt....
3
votes
1answer
1k views

How do I install R on Debian Stretch, given the r-api-3 issue?

I've tried to install the current version of R (3.4.2) from CRAN on a new computer running a fresh install of Debian Stretch, and it doesn't fully work. For example, root@machine:/home/myname# ...
-1
votes
2answers
10k views

Install R on Linux Mint 18.2 Sonya Mate

I tried to install R on Mint without success. Here are instructions, that I already tried to follow on YouTube: sudo apt-get install r-base [sudo] password for xwing: Reading package lists... Done ...
1
vote
1answer
343 views

How to offline installe package and dependencies already downloaded with yumdownloader

I need to perform an installation (of R package) in a server without internet access so i used yumdownloader to download the package and used --resolve to also download the dependencies, but when i ...
0
votes
1answer
463 views

FreeBSD and R mongolite package installation error: missing openssl.pc file

I am having problem with mongolite R package installation on FreeBSD. It seems that it is due to the fact that FreeBSD does not store openssl.pc file whatsoever. So my question is how to deal with ...
2
votes
3answers
309 views

remove duplicate entries in one column and linearize the values in multiple rows to a single row

I have a table that looks like this: DAPPUDRAFT_194440 Phosphorous DAPPUDRAFT_194440 Temperature DAPPUDRAFT_194472 Phosphorous Fishkairomones DAPPUDRAFT_194472 Temperature ...
0
votes
1answer
40 views

Select every two rows if they begin with the same name

I have a table that looks like this: name something 1 100036498|F|0--20:T>G something 2 100036501|F|0--44:C>T something 3 ...
0
votes
1answer
292 views

Can't find r-base package

I'm using Debian 9.1 and tried to install the r-base using the command sudo apt-get install r-base But it says that it can't find the r-base package.
2
votes
1answer
286 views

How to install MLR R frontend shinyMLR in Debian?

Not in apt search but the package details here. Found in OS X so should be in Linux too. You can install the backend as sudo in R prompt by install.packages("mlr"), docs here about the package. ...
1
vote
1answer
35 views

Why RStudio source pdf output difference with R prompt?

I get correct output of the following code for Rscript code.r but damaged file when running RStudio source in the minimal project, which I do not understand. Code pdf("test.pdf") plot(iris) There ...
1
vote
1answer
5k views

Loop over a data frame comparing elements of the firts and second row

I want to loop over a dataframe, I want to compare one of the elements of the actual row and the next row. for example, I have a data frame that looks like this: V1 V2 V3 ...
6
votes
3answers
4k views

Debian 9 and RStudio

I just switched to Debian following the recent release of version 9. I do a lot of work with RStudio and thus tried to install the stable and testing versions which both failed due to the missing ...
0
votes
1answer
37 views

Unable to type character “n” in ubuntu command line interfaces (R, mysql, python,…)

I am having a maddening problem which I hope someone has seen. I am working on ubuntu, remotely over putty. In the shell console, either bash or tcsh, everything is fine. Everything is also fine ...
1
vote
1answer
108 views

Sort order to order this list in a specific order

I know there are tons of sorting questions on here, but I'm unable to resolve my use case. I am trying to sort a list in R (on Ubuntu 16.04) and am at my wits end! I've been trying to mess with the ...
3
votes
1answer
1k views

How to save R stargazer(data.frame) output in .tex document?

This thread is the continua of the thread How to save R xtable(data.frame) output in .tex document? but with the package stargazer where the approach proposed for xtable does not work. Code DF <-...
1
vote
1answer
584 views

How to save R xtable(data.frame) output in .tex document?

I want to present R data.frame output as LaTeX table. Data structure is data.frame. Doing print(DF.tex), the output looks fine in STOUT, in contrast to the the file. Expected output: UTF-8 format ...
1
vote
2answers
1k views

How to install R-base sid in Debian jessie?

I want to install R-base sid here in Debian. It would be great if some CRAN packages installed can be maintained in the SID version. Code sudo apt install r-base/unstable Output Reading package ...
-2
votes
1answer
67 views

What are difference of four different Linux version R? [closed]

I want to install R into Linux, which version of R should I choose, Debian, Redhat,suse and Ubuntu? Please give advice?Thanks
0
votes
3answers
780 views

How to select on CSV files by R sqldf/data.table/dplyr?

I know the thread How can I inner join two csv files in R which has a merge option, which I do not want. I have two data CSV files. I am thinking how to query like them like SQL with R. Two CSV ...
0
votes
2answers
2k views

How to declare this R CSV data as numerical?

I added spaces around my fields in CSV file in Vim csv.vim plugin. Now, I am having difficulties in declaring the column classes as numerical (num etc). Having negative values there also cause ...
0
votes
1answer
81 views

How to change %Hh%M to %M form in R CSV?

I am thinking how you can dynamically change the time duration form (etc 11h11 resembling %Hh%M) to minute form like %M. I think it is best to maintain the original data form used by EMFIT-QS device. ...
-1
votes
1answer
419 views

How to handle timezones in timestamps in R? [closed]

I have non-UTC timezone times given as 17th August 2016 at 21:41 at Swedish timezone (UTC+1). I have two of such recordings for each entry. I am thinking how to record them nicely in CSV file. I ...
1
vote
1answer
382 views

Running R project script with arguments within AWK in a Bash Script (Ubuntu Linux)

I have this code where the cmd usually works if I sprintf something to it, but when I try to run my Rscript, it does not work. Any hints? I get the error: awk: cmd. line:9: cmd = Rscript ./...
1
vote
1answer
72 views

secure apt R pgp key no_pubkeys found

I already applied the solutions on these pages Why failing to get CRAN key for R backports? and https://cran.r-project.org/bin/linux/debian/#secure-apt for installing R on Debian Linux Jessie ...
1
vote
2answers
214 views

Gsub to keep string between ;

I have a a dataset in R: "Pppppp;Cccccccc;Ooooo;My_string;Gggggg;" I would like to keep Mystring (so to remove everything before and after). My string is always located after the third ";". The ...