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.

0
votes
1answer
26 views

Add a part of value from file1 to column in file 2 if there is a match

I have 2 csv files: file (1 column)1: Prokaryote,Caudovirales,Myoviridae Prokaryote,Caudovirales,Podoviridae Prokaryote,Caudovirales,Siphoviridae Prokaryote,Ligamenvirales,Lipothrixviridae ...
3
votes
1answer
41 views

error while loading shared libraries; file too short

I am working on a CentOS 7 workstation. I had installed Rstudio and it was working fine until recently. But now, if I try to launch it at http://localhost:8787/ I get an error that says Unable to ...
0
votes
1answer
36 views

Extract data based on second column [closed]

Now I have a file format like ACTG,CD1,234 BGTY,CD2,561 CFRT,CD3,27 DGTY,CD4,45 EYTG,CD5,23 FJUI,CD1,78 GYHJ,CD2,89 HYHG,CD3,107 IUHJHU,CD4,55 JMJGT,CD5,77 I want my output file like: CD1,ACTG,234 ...
1
vote
1answer
31 views

Uninstall R from Docker image

I have tried: sudo apt-get remove r-base sudo apt-get remove r-base-core delete everything in .libPaths() The thing is, I'm using a Docker container which came with R installed in it. ...
0
votes
0answers
26 views

How to split a bash loop on several nodes with Slurm?

I would like to split this loop : for i in $subset do srun Rscript my_script.R --subset $i done where $subset corresponds to seq 1 number . I would like to execute each value of i on multiple nodes....
0
votes
0answers
13 views

How to call a R variable in a loop with Slurm? [migrated]

I have a R (RHO_COR.R) script and I would like to create a loop in order to split the jobs on several nodes. I show the part of the script where I would like to create the loop. res <- foreach(i =...
0
votes
0answers
20 views

Library path for R

I installed Spark and during the installation I think I changed some settings in .bash_profile. Now, when I try to compile with Markdown I get the following error: Restarting R session... Error: 2:...
0
votes
0answers
48 views

How to run Rscript on multiple files to get table of separated outcomes named as original files?

I have written R script which takes a file from the folder. (CSV. files) The total length of the trajectory of a particular object is computed (one number). I have to do this process on all files in ...
1
vote
0answers
135 views

Broken pipe error [closed]

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<- ...
-1
votes
3answers
55 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
29 views

Sort based on second column and list from highest to lowest

TGAAACATGCCTTTCACCTCCTGCCATGATTGTGAGGCCT 2 GTGTTGCCCAGGTTGGTTTCAAACTCAGCTCAAGTGATCT 1 GAGACTCCTTCAGGAGACTGGTCCCCTGTCCTCGCCTCTC 3 CATGTTCTCCTGGAAGCCATGTGAGGAAGGCACATCATGG 8 ...
1
vote
1answer
26 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
190 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
27 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
104 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
52 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
62 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
49 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
675 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
298 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
21 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. --- ...
1
vote
1answer
588 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
336 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
192 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
3k 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
1answer
278 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
320 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
55 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
1k 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
4k 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
152 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
2k 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
11k 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
423 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
492 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
332 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
41 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
336 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
303 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
6k 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
38 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
114 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 ...
2
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
673 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
75 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